@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
@@ -1,7 +1,6 @@
1
- import { readFileSync } from 'fs';
2
- import { isAbsolute, resolve, relative } from 'path';
3
-
4
1
  // src/auto-i18n-extractor/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
  filesScanned: 0,
@@ -331,5 +330,6 @@ ${lines.join("\n")}${more}`;
331
330
  }
332
331
  };
333
332
  var auto_i18n_extractor_default = plugin;
334
-
335
- export { auto_i18n_extractor_default as default };
333
+ export {
334
+ auto_i18n_extractor_default as default
335
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * branch-guard plugin — PreToolUse hook that blocks commits, pushes,
3
+ * and merges to protected branches (default: main, master).
4
+ *
5
+ * Tools registered:
6
+ * - branch_guard_status : Show protected branches, mode, and counters.
7
+ *
8
+ * Hooks registered:
9
+ * - PreToolUse with matcher `bash|git|git_autocommit`. Inspects the tool
10
+ * input for git commit / push / merge commands (bash), structured git
11
+ * operations (git), or the tool call itself (git_autocommit). If the current
12
+ * branch is protected, the call is blocked with a clear reason.
13
+ *
14
+ * Config (`config.extensions['branch-guard']`):
15
+ *
16
+ * ```jsonc
17
+ * {
18
+ * "enabled": true, // set false to make the hook a no-op
19
+ * "branches": ["main", "master"], // protected branch names
20
+ * "mode": "block", // "block" | "warn" | "off"
21
+ * "blockMerge": true, // also block merges into protected
22
+ * "blockPush": true, // also block pushes from protected
23
+ * "blockCommit": true // also block commits on protected
24
+ * }
25
+ * ```
26
+ *
27
+ * @public
28
+ */
29
+ import type { Plugin } from '@wrongstack/core';
30
+ declare const plugin: Plugin;
31
+ export default plugin;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/branch-guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAuM/C,QAAA,MAAM,MAAM,EAAE,MAoPb,CAAC;eAEa,MAAM"}
@@ -1,34 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * branch-guard plugin — PreToolUse hook that blocks commits, pushes,
5
- * and merges to protected branches (default: main, master).
6
- *
7
- * Tools registered:
8
- * - branch_guard_status : Show protected branches, mode, and counters.
9
- *
10
- * Hooks registered:
11
- * - PreToolUse with matcher `bash|git|git_autocommit`. Inspects the tool
12
- * input for git commit / push / merge commands (bash), structured git
13
- * operations (git), or the tool call itself (git_autocommit). If the current
14
- * branch is protected, the call is blocked with a clear reason.
15
- *
16
- * Config (`config.extensions['branch-guard']`):
17
- *
18
- * ```jsonc
19
- * {
20
- * "enabled": true, // set false to make the hook a no-op
21
- * "branches": ["main", "master"], // protected branch names
22
- * "mode": "block", // "block" | "warn" | "off"
23
- * "blockMerge": true, // also block merges into protected
24
- * "blockPush": true, // also block pushes from protected
25
- * "blockCommit": true // also block commits on protected
26
- * }
27
- * ```
28
- *
29
- * @public
30
- */
31
-
32
- declare const plugin: Plugin;
33
-
34
- export { plugin as default };
1
+ export * from './branch-guard/index.js';
2
+ export { default } from './branch-guard/index.js';
@@ -1,6 +1,5 @@
1
- import { execFile } from 'child_process';
2
-
3
1
  // src/branch-guard/index.ts
2
+ import { execFile } from "node:child_process";
4
3
  var API_VERSION = "^0.1.10";
5
4
  var state = {
6
5
  invocationCount: 0,
@@ -299,5 +298,6 @@ var plugin = {
299
298
  }
300
299
  };
301
300
  var branch_guard_default = plugin;
302
-
303
- export { branch_guard_default as default };
301
+ export {
302
+ branch_guard_default as default
303
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Plugin catalog — single source of truth for plugin names and their
3
+ * canonical source paths. Used by `spec-linker` to detect unlinked
4
+ * plugin references in markdown files.
5
+ *
6
+ * The catalog is built at module load time by importing each plugin
7
+ * source and reading its `name` field. This means the catalog is
8
+ * always in sync with the actual plugins — adding a new plugin
9
+ * (exporting it from `./index.ts` AND adding a row to the table
10
+ * below) is enough for `spec-linker` to start detecting references
11
+ * to it.
12
+ *
13
+ * To add a new plugin: see the table in `catalog.ts`. The `name`
14
+ * must match the plugin's `name` field; the `path` is the
15
+ * relative source directory under `packages/plugins/src/`.
16
+ *
17
+ * @public
18
+ */
19
+ import type { Plugin } from '@wrongstack/core';
20
+ interface CatalogEntry {
21
+ /** The plugin's `name` field. */
22
+ name: string;
23
+ /** Relative path under `packages/plugins/src/`, e.g. `./src/auto-doc`. */
24
+ path: string;
25
+ }
26
+ /**
27
+ * Read-only view of the catalog as a Map from plugin name to its
28
+ * source path. Frozen so consumers cannot mutate it.
29
+ */
30
+ export declare const PLUGIN_CATALOG: ReadonlyMap<string, string>;
31
+ /**
32
+ * The list of catalog entries, ordered by the table above. Used by
33
+ * `spec-linker` to iterate names in a stable order for detection.
34
+ */
35
+ export declare const PLUGIN_CATALOG_ENTRIES: readonly CatalogEntry[];
36
+ /** Convenience accessor: just the names, in declaration order. */
37
+ export declare const PLUGIN_NAMES: readonly string[];
38
+ export type { Plugin };
39
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAuE/C,UAAU,YAAY;IACpB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;CACd;AA+FD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAInD,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,YAAY,EAEzD,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAA8C,CAAC;AAIzF,YAAY,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * changelog-writer plugin — turns session activity into
3
+ * Keep-a-Changelog entries.
4
+ *
5
+ * While the session runs, the plugin passively collects work signals
6
+ * from the event bus: files touched by `write`/`edit`, and commit
7
+ * subjects observed from `git_autocommit` / `bash git commit`
8
+ * invocations. Commit subjects in conventional-commit format are
9
+ * mapped to Keep-a-Changelog sections:
10
+ *
11
+ * feat → Added · fix → Fixed · perf/refactor → Changed ·
12
+ * docs → Documentation · chore/build/ci → Maintenance ·
13
+ * revert/remove → Removed · sec/security → Security
14
+ *
15
+ * Tools:
16
+ * - `changelog_add` — record an entry manually ("Added dark mode")
17
+ * - `changelog_preview` — render the pending Unreleased block
18
+ * - `changelog_write` — merge the pending entries into
19
+ * `CHANGELOG.md` under `## [Unreleased]` (creates the file with a
20
+ * Keep-a-Changelog header when missing); pending entries are
21
+ * cleared after a successful write
22
+ *
23
+ * Both `changelog_preview` and `changelog_write` accept `polish: true`
24
+ * to rewrite the block into user-facing release-notes wording via the
25
+ * host LLM (`api.llm`) — provider/model follow the plugin's
26
+ * `config.extensions['changelog-writer'].llm` override, then the
27
+ * session default. Polish is best-effort: on any LLM failure (or when
28
+ * the response stops looking like the block) the raw entries are used.
29
+ *
30
+ * Config (`config.extensions['changelog-writer']`):
31
+ *
32
+ * ```jsonc
33
+ * {
34
+ * "enabled": true,
35
+ * "filePath": "CHANGELOG.md",
36
+ * "collectCommits": true,
37
+ * "maxEntries": 200
38
+ * }
39
+ * ```
40
+ *
41
+ * Toggle off with `{ "name": "changelog-writer", "enabled": false }`
42
+ * in `config.plugins`, or `"enabled": false` in the options above.
43
+ *
44
+ * @public
45
+ */
46
+ import type { Plugin } from '@wrongstack/core';
47
+ type Section = 'Added' | 'Changed' | 'Fixed' | 'Removed' | 'Security' | 'Documentation' | 'Maintenance';
48
+ export interface ChangelogEntry {
49
+ section: Section;
50
+ text: string;
51
+ origin: 'commit' | 'manual';
52
+ when: string;
53
+ }
54
+ /** Parse "feat(scope): add dark mode" → { section: Added, text: "add dark mode (scope)" }. */
55
+ export declare function commitToEntry(subject: string): {
56
+ section: Section;
57
+ text: string;
58
+ };
59
+ /** Extract the commit subject from a `git commit -m "..."` command, if any. */
60
+ export declare function commitSubjectFromCommand(command: string): string | null;
61
+ export declare function renderUnreleasedBlock(entries: ChangelogEntry[]): string;
62
+ /**
63
+ * Merge a rendered Unreleased block into existing changelog content:
64
+ * inserted directly under `## [Unreleased]` (existing unreleased
65
+ * content is preserved below the new lines). Creates the standard
66
+ * header when the file has no Unreleased heading.
67
+ */
68
+ export declare function mergeIntoChangelog(existing: string | null, block: string): string;
69
+ declare const plugin: Plugin;
70
+ export default plugin;
71
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/changelog-writer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM/C,KAAK,OAAO,GACR,OAAO,GACP,SAAS,GACT,OAAO,GACP,SAAS,GACT,UAAU,GACV,eAAe,GACf,aAAa,CAAC;AAElB,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAmGD,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAQjF;AAED,+EAA+E;AAC/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvE;AAeD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,CAiBvE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBjF;AAMD,QAAA,MAAM,MAAM,EAAE,MAqRb,CAAC;eAEa,MAAM"}
@@ -1,73 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * changelog-writer plugin — turns session activity into
5
- * Keep-a-Changelog entries.
6
- *
7
- * While the session runs, the plugin passively collects work signals
8
- * from the event bus: files touched by `write`/`edit`, and commit
9
- * subjects observed from `git_autocommit` / `bash git commit`
10
- * invocations. Commit subjects in conventional-commit format are
11
- * mapped to Keep-a-Changelog sections:
12
- *
13
- * feat → Added · fix → Fixed · perf/refactor → Changed ·
14
- * docs → Documentation · chore/build/ci → Maintenance ·
15
- * revert/remove → Removed · sec/security → Security
16
- *
17
- * Tools:
18
- * - `changelog_add` — record an entry manually ("Added dark mode")
19
- * - `changelog_preview` — render the pending Unreleased block
20
- * - `changelog_write` — merge the pending entries into
21
- * `CHANGELOG.md` under `## [Unreleased]` (creates the file with a
22
- * Keep-a-Changelog header when missing); pending entries are
23
- * cleared after a successful write
24
- *
25
- * Both `changelog_preview` and `changelog_write` accept `polish: true`
26
- * to rewrite the block into user-facing release-notes wording via the
27
- * host LLM (`api.llm`) — provider/model follow the plugin's
28
- * `config.extensions['changelog-writer'].llm` override, then the
29
- * session default. Polish is best-effort: on any LLM failure (or when
30
- * the response stops looking like the block) the raw entries are used.
31
- *
32
- * Config (`config.extensions['changelog-writer']`):
33
- *
34
- * ```jsonc
35
- * {
36
- * "enabled": true,
37
- * "filePath": "CHANGELOG.md",
38
- * "collectCommits": true,
39
- * "maxEntries": 200
40
- * }
41
- * ```
42
- *
43
- * Toggle off with `{ "name": "changelog-writer", "enabled": false }`
44
- * in `config.plugins`, or `"enabled": false` in the options above.
45
- *
46
- * @public
47
- */
48
-
49
- type Section = 'Added' | 'Changed' | 'Fixed' | 'Removed' | 'Security' | 'Documentation' | 'Maintenance';
50
- interface ChangelogEntry {
51
- section: Section;
52
- text: string;
53
- origin: 'commit' | 'manual';
54
- when: string;
55
- }
56
- /** Parse "feat(scope): add dark mode" → { section: Added, text: "add dark mode (scope)" }. */
57
- declare function commitToEntry(subject: string): {
58
- section: Section;
59
- text: string;
60
- };
61
- /** Extract the commit subject from a `git commit -m "..."` command, if any. */
62
- declare function commitSubjectFromCommand(command: string): string | null;
63
- declare function renderUnreleasedBlock(entries: ChangelogEntry[]): string;
64
- /**
65
- * Merge a rendered Unreleased block into existing changelog content:
66
- * inserted directly under `## [Unreleased]` (existing unreleased
67
- * content is preserved below the new lines). Creates the standard
68
- * header when the file has no Unreleased heading.
69
- */
70
- declare function mergeIntoChangelog(existing: string | null, block: string): string;
71
- declare const plugin: Plugin;
72
-
73
- export { type ChangelogEntry, commitSubjectFromCommand, commitToEntry, plugin as default, mergeIntoChangelog, renderUnreleasedBlock };
1
+ export * from './changelog-writer/index.js';
2
+ export { default } from './changelog-writer/index.js';
@@ -1,7 +1,6 @@
1
- import { readFileSync, writeFileSync } from 'fs';
2
- import { resolve, isAbsolute, relative } from 'path';
3
-
4
1
  // src/changelog-writer/index.ts
2
+ import { readFileSync, writeFileSync } from "node:fs";
3
+ import { isAbsolute, relative, resolve } from "node:path";
5
4
  var state = {
6
5
  entries: [],
7
6
  filesTouched: /* @__PURE__ */ new Set(),
@@ -376,5 +375,10 @@ var plugin = {
376
375
  }
377
376
  };
378
377
  var changelog_writer_default = plugin;
379
-
380
- export { commitSubjectFromCommand, commitToEntry, changelog_writer_default as default, mergeIntoChangelog, renderUnreleasedBlock };
378
+ export {
379
+ commitSubjectFromCommand,
380
+ commitToEntry,
381
+ changelog_writer_default as default,
382
+ mergeIntoChangelog,
383
+ renderUnreleasedBlock
384
+ };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * checkpoint plugin — in-session file snapshots with one-call undo.
3
+ *
4
+ * Before every `write`/`edit` the plugin captures the file's current
5
+ * content (a `PreToolUse` hook reads the file from disk *before* the
6
+ * tool mutates it). Snapshots are held in an in-memory ring, so the
7
+ * agent can always roll back a bad edit — even one made outside git
8
+ * (untracked files, mid-refactor states, dirty worktrees).
9
+ *
10
+ * Tools:
11
+ * - `checkpoint_list` — list captured snapshots (newest first)
12
+ * - `checkpoint_restore` — restore a file (or all files of a
13
+ * checkpoint) to its captured content; files that did not exist
14
+ * at capture time are noted, never deleted
15
+ * - `checkpoint_create` — manually snapshot a list of files before
16
+ * a risky operation (bulk rename, codemod, script run)
17
+ *
18
+ * This deliberately complements git: `git checkout` needs a commit
19
+ * to restore to; checkpoint restores to *any* pre-edit state from
20
+ * this session, including states that were never committed.
21
+ *
22
+ * Config (`config.extensions['checkpoint']`):
23
+ *
24
+ * ```jsonc
25
+ * {
26
+ * "enabled": true,
27
+ * "autoCapture": true, // snapshot before every write/edit
28
+ * "maxSnapshots": 50, // ring size
29
+ * "maxFileBytes": 1048576 // skip files larger than this (1 MiB)
30
+ * }
31
+ * ```
32
+ *
33
+ * Toggle off with `{ "name": "checkpoint", "enabled": false }` in
34
+ * `config.plugins`, or `"enabled": false` in the options above.
35
+ *
36
+ * @public
37
+ */
38
+ import type { Plugin } from '@wrongstack/core';
39
+ export interface Snapshot {
40
+ id: string;
41
+ createdAt: string;
42
+ /** What triggered the capture: 'auto:write', 'auto:edit', or 'manual'. */
43
+ origin: string;
44
+ files: Array<{
45
+ path: string;
46
+ /** null = file did not exist at capture time. */
47
+ content: string | null;
48
+ bytes: number;
49
+ }>;
50
+ }
51
+ declare const plugin: Plugin;
52
+ export default plugin;
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkpoint/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM/C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,iDAAiD;QACjD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AA+HD,QAAA,MAAM,MAAM,EAAE,MAwUb,CAAC;eAEa,MAAM"}
@@ -1,55 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * checkpoint plugin — in-session file snapshots with one-call undo.
5
- *
6
- * Before every `write`/`edit` the plugin captures the file's current
7
- * content (a `PreToolUse` hook reads the file from disk *before* the
8
- * tool mutates it). Snapshots are held in an in-memory ring, so the
9
- * agent can always roll back a bad edit — even one made outside git
10
- * (untracked files, mid-refactor states, dirty worktrees).
11
- *
12
- * Tools:
13
- * - `checkpoint_list` — list captured snapshots (newest first)
14
- * - `checkpoint_restore` — restore a file (or all files of a
15
- * checkpoint) to its captured content; files that did not exist
16
- * at capture time are noted, never deleted
17
- * - `checkpoint_create` — manually snapshot a list of files before
18
- * a risky operation (bulk rename, codemod, script run)
19
- *
20
- * This deliberately complements git: `git checkout` needs a commit
21
- * to restore to; checkpoint restores to *any* pre-edit state from
22
- * this session, including states that were never committed.
23
- *
24
- * Config (`config.extensions['checkpoint']`):
25
- *
26
- * ```jsonc
27
- * {
28
- * "enabled": true,
29
- * "autoCapture": true, // snapshot before every write/edit
30
- * "maxSnapshots": 50, // ring size
31
- * "maxFileBytes": 1048576 // skip files larger than this (1 MiB)
32
- * }
33
- * ```
34
- *
35
- * Toggle off with `{ "name": "checkpoint", "enabled": false }` in
36
- * `config.plugins`, or `"enabled": false` in the options above.
37
- *
38
- * @public
39
- */
40
-
41
- interface Snapshot {
42
- id: string;
43
- createdAt: string;
44
- /** What triggered the capture: 'auto:write', 'auto:edit', or 'manual'. */
45
- origin: string;
46
- files: Array<{
47
- path: string;
48
- /** null = file did not exist at capture time. */
49
- content: string | null;
50
- bytes: number;
51
- }>;
52
- }
53
- declare const plugin: Plugin;
54
-
55
- export { type Snapshot, plugin as default };
1
+ export * from './checkpoint/index.js';
2
+ export { default } from './checkpoint/index.js';
@@ -1,8 +1,7 @@
1
- import { mkdirSync, writeFileSync, statSync, readFileSync } from 'fs';
2
- import { stat, readFile } from 'fs/promises';
3
- import { dirname, resolve, isAbsolute, relative } from 'path';
4
-
5
1
  // src/checkpoint/index.ts
2
+ import { mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
3
+ import { readFile, stat } from "node:fs/promises";
4
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
6
5
  var state = {
7
6
  snapshots: [],
8
7
  nextId: 1,
@@ -361,5 +360,6 @@ var plugin = {
361
360
  }
362
361
  };
363
362
  var checkpoint_default = plugin;
364
-
365
- export { checkpoint_default as default };
363
+ export {
364
+ checkpoint_default as default
365
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * code-metrics plugin — lightweight per-file code metrics using regex-based
3
+ * line counting and complexity heuristics.
4
+ *
5
+ * Tools registered:
6
+ * - measure_code_metrics : Compute lines, comments, blanks, function count,
7
+ * and cyclomatic-complexity-like score for a file or directory.
8
+ * - metrics_status : Report config + counters.
9
+ *
10
+ * Hooks registered:
11
+ * - PostToolUse with matcher `write|edit` to source files, injecting a
12
+ * one-line metric summary of the changed file.
13
+ *
14
+ * Config (`config.extensions['code-metrics']`):
15
+ *
16
+ * ```jsonc
17
+ * {
18
+ * "enabled": true,
19
+ * "extensions": [".ts", ".tsx", ".js", ".jsx"],
20
+ * "maxFiles": 50
21
+ * }
22
+ * ```
23
+ *
24
+ * @public
25
+ */
26
+ import type { Plugin } from '@wrongstack/core';
27
+ declare const plugin: Plugin;
28
+ export default plugin;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-metrics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA8P/C,QAAA,MAAM,MAAM,EAAE,MAgMb,CAAC;eAEa,MAAM"}
@@ -1,31 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * code-metrics plugin — lightweight per-file code metrics using regex-based
5
- * line counting and complexity heuristics.
6
- *
7
- * Tools registered:
8
- * - measure_code_metrics : Compute lines, comments, blanks, function count,
9
- * and cyclomatic-complexity-like score for a file or directory.
10
- * - metrics_status : Report config + counters.
11
- *
12
- * Hooks registered:
13
- * - PostToolUse with matcher `write|edit` to source files, injecting a
14
- * one-line metric summary of the changed file.
15
- *
16
- * Config (`config.extensions['code-metrics']`):
17
- *
18
- * ```jsonc
19
- * {
20
- * "enabled": true,
21
- * "extensions": [".ts", ".tsx", ".js", ".jsx"],
22
- * "maxFiles": 50
23
- * }
24
- * ```
25
- *
26
- * @public
27
- */
28
-
29
- declare const plugin: Plugin;
30
-
31
- export { plugin as default };
1
+ export * from './code-metrics/index.js';
2
+ export { default } from './code-metrics/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/code-metrics/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
  measureCount: 0,
@@ -334,5 +333,6 @@ var plugin = {
334
333
  }
335
334
  };
336
335
  var code_metrics_default = plugin;
337
-
338
- export { code_metrics_default as default };
336
+ export {
337
+ code_metrics_default as default
338
+ };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * commit-message-validator plugin — PreToolUse hook that validates
3
+ * conventional-commit format on `git_autocommit` and `bash` (git commit)
4
+ * before the commit is created.
5
+ *
6
+ * Tools registered:
7
+ * - commit_validator_status : Show config + per-session counters.
8
+ *
9
+ * Hooks registered:
10
+ * - PreToolUse with matcher `bash|git_autocommit`. Inspects the
11
+ * commit message (from toolInput.message for git_autocommit, or
12
+ * parsed from `-m` flag for bash git commit). If the message does
13
+ * not match the conventional-commit format, the call is blocked.
14
+ *
15
+ * Config (`config.extensions['commit-validator']`):
16
+ *
17
+ * ```jsonc
18
+ * {
19
+ * "mode": "block", // "block" | "warn"
20
+ * "requireScope": false, // require a scope in parentheses
21
+ * "allowedTypes": [], // empty = all types allowed; or ["feat","fix","docs",...]
22
+ * "maxSubjectLength": 72 // subject line character limit
23
+ * }
24
+ * ```
25
+ *
26
+ * @public
27
+ */
28
+ import type { Plugin } from '@wrongstack/core';
29
+ declare const plugin: Plugin;
30
+ export default plugin;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commit-validator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAsP/C,QAAA,MAAM,MAAM,EAAE,MAgSb,CAAC;eAEa,MAAM"}
@@ -1,33 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * commit-message-validator plugin — PreToolUse hook that validates
5
- * conventional-commit format on `git_autocommit` and `bash` (git commit)
6
- * before the commit is created.
7
- *
8
- * Tools registered:
9
- * - commit_validator_status : Show config + per-session counters.
10
- *
11
- * Hooks registered:
12
- * - PreToolUse with matcher `bash|git_autocommit`. Inspects the
13
- * commit message (from toolInput.message for git_autocommit, or
14
- * parsed from `-m` flag for bash git commit). If the message does
15
- * not match the conventional-commit format, the call is blocked.
16
- *
17
- * Config (`config.extensions['commit-validator']`):
18
- *
19
- * ```jsonc
20
- * {
21
- * "mode": "block", // "block" | "warn"
22
- * "requireScope": false, // require a scope in parentheses
23
- * "allowedTypes": [], // empty = all types allowed; or ["feat","fix","docs",...]
24
- * "maxSubjectLength": 72 // subject line character limit
25
- * }
26
- * ```
27
- *
28
- * @public
29
- */
30
-
31
- declare const plugin: Plugin;
32
-
33
- export { plugin as default };
1
+ export * from './commit-validator/index.js';
2
+ export { default } from './commit-validator/index.js';
@@ -77,7 +77,8 @@ function parseCommitMessage(message, cfg) {
77
77
  errors.push(
78
78
  `Type "${type}" is not in allowedTypes: ${cfg.allowedTypes.join(", ")}. Standard types: ${STANDARD_TYPES.join(", ")}.`
79
79
  );
80
- } else if (cfg.allowedTypes.length === 0 && !STANDARD_TYPES.includes(type)) ;
80
+ } else if (cfg.allowedTypes.length === 0 && !STANDARD_TYPES.includes(type)) {
81
+ }
81
82
  if (cfg.requireScope && !scope) {
82
83
  errors.push("A scope is required (e.g. feat(auth): ...).");
83
84
  }
@@ -371,5 +372,6 @@ Suggested rewrite (${suggest.model}):
371
372
  }
372
373
  };
373
374
  var commit_validator_default = plugin;
374
-
375
- export { commit_validator_default as default };
375
+ export {
376
+ commit_validator_default as default
377
+ };