@wrongstack/plugins 0.293.0 → 0.295.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +7 -71
  2. package/dist/accessibility-auditor/index.d.ts +1 -1
  3. package/dist/accessibility-auditor/index.d.ts.map +1 -1
  4. package/dist/accessibility-auditor.js +50 -33
  5. package/dist/agent-handoff/index.d.ts +1 -1
  6. package/dist/agent-handoff/index.d.ts.map +1 -1
  7. package/dist/agent-handoff.js +30 -1
  8. package/dist/api-compatibility-gate/index.d.ts +1 -1
  9. package/dist/api-compatibility-gate/index.d.ts.map +1 -1
  10. package/dist/api-compatibility-gate.js +21 -16
  11. package/dist/audit/index.d.ts +386 -0
  12. package/dist/audit/index.d.ts.map +1 -0
  13. package/dist/audit.d.ts +1 -0
  14. package/dist/audit.js +454 -0
  15. package/dist/auto-doc/index.d.ts +1 -1
  16. package/dist/auto-doc/index.d.ts.map +1 -1
  17. package/dist/auto-doc.js +3 -1
  18. package/dist/auto-escalate/index.d.ts +1 -1
  19. package/dist/auto-escalate/index.d.ts.map +1 -1
  20. package/dist/auto-i18n-extractor/index.d.ts +1 -1
  21. package/dist/auto-i18n-extractor/index.d.ts.map +1 -1
  22. package/dist/auto-i18n-extractor.js +7 -1
  23. package/dist/branch-guard/index.d.ts +1 -1
  24. package/dist/branch-guard/index.d.ts.map +1 -1
  25. package/dist/branch-guard.js +111 -1
  26. package/dist/catalog.d.ts +5 -30
  27. package/dist/catalog.d.ts.map +1 -1
  28. package/dist/changelog-writer/index.d.ts +1 -1
  29. package/dist/changelog-writer/index.d.ts.map +1 -1
  30. package/dist/changelog-writer.js +137 -3
  31. package/dist/checkpoint/index.d.ts +3 -1
  32. package/dist/checkpoint/index.d.ts.map +1 -1
  33. package/dist/checkpoint.js +41 -16
  34. package/dist/code-metrics/index.d.ts +1 -1
  35. package/dist/code-metrics/index.d.ts.map +1 -1
  36. package/dist/code-metrics.js +34 -29
  37. package/dist/commit-validator/index.d.ts +1 -1
  38. package/dist/commit-validator/index.d.ts.map +1 -1
  39. package/dist/commit-validator.js +17 -7
  40. package/dist/config-validator/index.d.ts +1 -1
  41. package/dist/config-validator/index.d.ts.map +1 -1
  42. package/dist/context-pins/index.d.ts +1 -1
  43. package/dist/context-pins/index.d.ts.map +1 -1
  44. package/dist/context-pins.js +6 -5
  45. package/dist/cost-tracker/index.d.ts +1 -1
  46. package/dist/cost-tracker/index.d.ts.map +1 -1
  47. package/dist/cost-tracker.js +109 -2
  48. package/dist/cron/index.d.ts +1 -1
  49. package/dist/cron/index.d.ts.map +1 -1
  50. package/dist/cron.js +1 -0
  51. package/dist/dead-code-detector/index.d.ts +1 -1
  52. package/dist/dead-code-detector/index.d.ts.map +1 -1
  53. package/dist/dead-code-detector.js +31 -18
  54. package/dist/dep-guard/index.d.ts +1 -1
  55. package/dist/dep-guard/index.d.ts.map +1 -1
  56. package/dist/dependency-vulnerability-gate/index.d.ts +1 -1
  57. package/dist/dependency-vulnerability-gate/index.d.ts.map +1 -1
  58. package/dist/dependency-vulnerability-gate.js +67 -20
  59. package/dist/diff-summary/index.d.ts +1 -1
  60. package/dist/diff-summary/index.d.ts.map +1 -1
  61. package/dist/diff-summary.js +128 -30
  62. package/dist/doc-sync-guard/index.d.ts +1 -1
  63. package/dist/doc-sync-guard/index.d.ts.map +1 -1
  64. package/dist/doc-sync-guard.js +7 -1
  65. package/dist/duplicate-code-detector/index.d.ts +26 -1
  66. package/dist/duplicate-code-detector/index.d.ts.map +1 -1
  67. package/dist/duplicate-code-detector.js +280 -69
  68. package/dist/error-lens/index.d.ts +1 -1
  69. package/dist/error-lens/index.d.ts.map +1 -1
  70. package/dist/factories/index.d.ts +4 -0
  71. package/dist/factories/index.d.ts.map +1 -0
  72. package/dist/factories.d.ts +1 -0
  73. package/dist/factories.js +74 -0
  74. package/dist/feature-flag-tracker/index.d.ts +1 -1
  75. package/dist/feature-flag-tracker/index.d.ts.map +1 -1
  76. package/dist/feature-flag-tracker.js +59 -33
  77. package/dist/file-watcher/index.d.ts +1 -1
  78. package/dist/file-watcher/index.d.ts.map +1 -1
  79. package/dist/file-watcher.js +6 -7
  80. package/dist/format-on-save/index.d.ts +3 -1
  81. package/dist/format-on-save/index.d.ts.map +1 -1
  82. package/dist/format-on-save.js +289 -59
  83. package/dist/generated-plugin-exports.d.ts +65 -0
  84. package/dist/generated-plugin-exports.d.ts.map +1 -0
  85. package/dist/git-autocommit/index.d.ts +1 -1
  86. package/dist/git-autocommit/index.d.ts.map +1 -1
  87. package/dist/import-organizer/index.d.ts +1 -1
  88. package/dist/import-organizer/index.d.ts.map +1 -1
  89. package/dist/import-organizer.js +141 -20
  90. package/dist/index.d.ts +4 -183
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +18298 -17279
  93. package/dist/injection-shield/index.d.ts +1 -1
  94. package/dist/injection-shield/index.d.ts.map +1 -1
  95. package/dist/interface-contract-guard/index.d.ts +1 -1
  96. package/dist/interface-contract-guard/index.d.ts.map +1 -1
  97. package/dist/interface-contract-guard.js +87 -53
  98. package/dist/knowledge-graph/index.d.ts +1 -1
  99. package/dist/knowledge-graph/index.d.ts.map +1 -1
  100. package/dist/knowledge-graph.js +7 -6
  101. package/dist/license-audit-gate/index.d.ts +1 -1
  102. package/dist/license-audit-gate/index.d.ts.map +1 -1
  103. package/dist/lint-gate/index.d.ts +1 -1
  104. package/dist/lint-gate/index.d.ts.map +1 -1
  105. package/dist/lint-gate.js +112 -1
  106. package/dist/llm-cache/index.d.ts +5 -1
  107. package/dist/llm-cache/index.d.ts.map +1 -1
  108. package/dist/llm-cache.js +16 -8
  109. package/dist/loop-breaker/index.d.ts +1 -1
  110. package/dist/loop-breaker/index.d.ts.map +1 -1
  111. package/dist/loop-breaker.js +25 -9
  112. package/dist/manifest/index.d.ts +16 -0
  113. package/dist/manifest/index.d.ts.map +1 -0
  114. package/dist/manifest.d.ts +1 -0
  115. package/dist/manifest.js +152 -0
  116. package/dist/migration-planner/index.d.ts +1 -1
  117. package/dist/migration-planner/index.d.ts.map +1 -1
  118. package/dist/migration-planner.js +5 -1
  119. package/dist/model-router/index.d.ts +1 -1
  120. package/dist/model-router/index.d.ts.map +1 -1
  121. package/dist/notify-hub/index.d.ts +1 -1
  122. package/dist/notify-hub/index.d.ts.map +1 -1
  123. package/dist/notify-hub/webhook-channel.d.ts +1 -1
  124. package/dist/notify-hub/webhook-channel.d.ts.map +1 -1
  125. package/dist/notify-hub.js +41 -4
  126. package/dist/path-guard/index.d.ts +1 -1
  127. package/dist/path-guard/index.d.ts.map +1 -1
  128. package/dist/performance-regression-gate/index.d.ts +1 -1
  129. package/dist/performance-regression-gate/index.d.ts.map +1 -1
  130. package/dist/plugin-stack-observer/index.d.ts +1 -1
  131. package/dist/plugin-stack-observer/index.d.ts.map +1 -1
  132. package/dist/pr-drafter/index.d.ts +1 -1
  133. package/dist/pr-drafter/index.d.ts.map +1 -1
  134. package/dist/pr-drafter.js +28 -29
  135. package/dist/process-guard/index.d.ts +1 -1
  136. package/dist/process-guard/index.d.ts.map +1 -1
  137. package/dist/prompt-firewall/index.d.ts +1 -1
  138. package/dist/prompt-firewall/index.d.ts.map +1 -1
  139. package/dist/prompt-firewall.js +140 -11
  140. package/dist/refactor-suggester/index.d.ts +1 -1
  141. package/dist/refactor-suggester/index.d.ts.map +1 -1
  142. package/dist/refactor-suggester.js +148 -33
  143. package/dist/release-notes-generator/index.d.ts +1 -1
  144. package/dist/release-notes-generator/index.d.ts.map +1 -1
  145. package/dist/release-notes-generator.js +29 -22
  146. package/dist/runtime/bounded-map.d.ts +86 -0
  147. package/dist/runtime/bounded-map.d.ts.map +1 -0
  148. package/dist/runtime/credential-patterns.d.ts +42 -0
  149. package/dist/runtime/credential-patterns.d.ts.map +1 -0
  150. package/dist/runtime/index.d.ts +18 -0
  151. package/dist/runtime/index.d.ts.map +1 -1
  152. package/dist/runtime/llm.d.ts +1 -1
  153. package/dist/runtime/llm.d.ts.map +1 -1
  154. package/dist/runtime/local-bin.d.ts +120 -0
  155. package/dist/runtime/local-bin.d.ts.map +1 -0
  156. package/dist/runtime/safe-json.d.ts +25 -0
  157. package/dist/runtime/safe-json.d.ts.map +1 -0
  158. package/dist/runtime.js +332 -22
  159. package/dist/schema-evolution-guard/index.d.ts +1 -1
  160. package/dist/schema-evolution-guard/index.d.ts.map +1 -1
  161. package/dist/schema-evolution-guard.js +7 -1
  162. package/dist/secret-scanner/index.d.ts +1 -1
  163. package/dist/secret-scanner/index.d.ts.map +1 -1
  164. package/dist/secret-scanner.js +181 -48
  165. package/dist/security-hotspot-scanner/index.d.ts +1 -1
  166. package/dist/security-hotspot-scanner/index.d.ts.map +1 -1
  167. package/dist/security-hotspot-scanner.js +158 -20
  168. package/dist/semantic-search-indexer/index.d.ts +1 -1
  169. package/dist/semantic-search-indexer/index.d.ts.map +1 -1
  170. package/dist/semantic-search-indexer.js +7 -1
  171. package/dist/semver-bump/index.d.ts +1 -1
  172. package/dist/semver-bump/index.d.ts.map +1 -1
  173. package/dist/semver-bump.js +97 -43
  174. package/dist/session-recap/index.d.ts +1 -1
  175. package/dist/session-recap/index.d.ts.map +1 -1
  176. package/dist/shell-check/index.d.ts +1 -1
  177. package/dist/shell-check/index.d.ts.map +1 -1
  178. package/dist/smart-rename/index.d.ts +1 -1
  179. package/dist/smart-rename/index.d.ts.map +1 -1
  180. package/dist/spec-linker/index.d.ts +1 -1
  181. package/dist/spec-linker/index.d.ts.map +1 -1
  182. package/dist/spec-linker.js +222 -20772
  183. package/dist/template-engine/index.d.ts +1 -1
  184. package/dist/template-engine/index.d.ts.map +1 -1
  185. package/dist/template-engine.js +34 -8
  186. package/dist/test-coverage-gate/index.d.ts +1 -1
  187. package/dist/test-coverage-gate/index.d.ts.map +1 -1
  188. package/dist/test-coverage-gate.js +34 -14
  189. package/dist/test-flake-detector/index.d.ts +1 -1
  190. package/dist/test-flake-detector/index.d.ts.map +1 -1
  191. package/dist/test-flake-detector.js +31 -20
  192. package/dist/test-generator/index.d.ts +1 -1
  193. package/dist/test-generator/index.d.ts.map +1 -1
  194. package/dist/test-runner-gate/index.d.ts +1 -1
  195. package/dist/test-runner-gate/index.d.ts.map +1 -1
  196. package/dist/test-runner-gate.js +132 -9
  197. package/dist/todo-listener/index.d.ts +1 -32
  198. package/dist/todo-listener/index.d.ts.map +1 -1
  199. package/dist/todo-listener.js +30 -1
  200. package/dist/todo-tracker/index.d.ts +1 -1
  201. package/dist/todo-tracker/index.d.ts.map +1 -1
  202. package/dist/todo-tracker.js +3 -4
  203. package/dist/token-budget/index.d.ts +1 -1
  204. package/dist/token-budget/index.d.ts.map +1 -1
  205. package/dist/token-throttle/index.d.ts +1 -1
  206. package/dist/token-throttle/index.d.ts.map +1 -1
  207. package/dist/token-throttle.js +17 -2
  208. package/dist/type-gate/index.d.ts +1 -1
  209. package/dist/type-gate/index.d.ts.map +1 -1
  210. package/dist/type-gate.js +106 -19
  211. package/package.json +80 -68
@@ -60,7 +60,21 @@ function estimateRequestTokens(request, charsPerToken) {
60
60
  walk(request["messages"]);
61
61
  return Math.ceil(chars / charsPerToken);
62
62
  }
63
- var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
63
+ function sleep(ms, signal) {
64
+ if (signal?.aborted) return Promise.resolve();
65
+ return new Promise((resolve) => {
66
+ const timer = setTimeout(() => {
67
+ signal?.removeEventListener("abort", onAbort);
68
+ resolve();
69
+ }, ms);
70
+ timer.unref?.();
71
+ function onAbort() {
72
+ clearTimeout(timer);
73
+ resolve();
74
+ }
75
+ signal?.addEventListener("abort", onAbort, { once: true });
76
+ });
77
+ }
64
78
  var plugin = {
65
79
  name: "token-throttle",
66
80
  version: "0.1.0",
@@ -119,6 +133,7 @@ var plugin = {
119
133
  name: "token-throttle",
120
134
  owner: "token-throttle",
121
135
  async wrapProviderRunner(_ctx, request, inner) {
136
+ const signal = _ctx?.signal;
122
137
  const req = request ?? {};
123
138
  state.invocations += 1;
124
139
  const now = Date.now();
@@ -132,7 +147,7 @@ var plugin = {
132
147
  api.metrics.counter("throttled");
133
148
  api.metrics.histogram("delay_ms", delay);
134
149
  api.log.info("token-throttle: delaying provider call", { delayMs: delay, projected });
135
- await sleep(delay);
150
+ await sleep(delay, signal);
136
151
  }
137
152
  const response = await inner(_ctx, request);
138
153
  const used = (response?.usage?.input ?? 0) + (response?.usage?.output ?? 0) || projected;
@@ -29,7 +29,7 @@
29
29
  *
30
30
  * @public
31
31
  */
32
- import type { Plugin } from '@wrongstack/core';
32
+ import type { Plugin } from '@wrongstack/core/types';
33
33
  declare const plugin: Plugin;
34
34
  export default plugin;
35
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/type-gate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAuM/C,QAAA,MAAM,MAAM,EAAE,MAiOb,CAAC;eAEa,MAAM"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/type-gate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AA+NrD,QAAA,MAAM,MAAM,EAAE,MAkOb,CAAC;eAEa,MAAM"}
package/dist/type-gate.js CHANGED
@@ -3,7 +3,69 @@ import { existsSync } from "node:fs";
3
3
 
4
4
  // src/runtime/index.ts
5
5
  import { execFile } from "node:child_process";
6
- import { basename, extname, isAbsolute, relative, resolve } from "node:path";
6
+ import { basename, extname as extname2, isAbsolute as isAbsolute2, relative as relative2, resolve as resolve2 } from "node:path";
7
+
8
+ // src/runtime/local-bin.ts
9
+ import { createRequire } from "node:module";
10
+ import { delimiter, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
11
+ import { accessSync, constants, readFileSync } from "node:fs";
12
+ import { buildWin32CmdShimInvocation, resolveWin32Command } from "@wrongstack/tools/win32";
13
+ function resolveExecInvocation(command, args = []) {
14
+ const resolved = resolveWin32Command(command);
15
+ const normalizedResolved = resolved.toLowerCase();
16
+ const needsShell = process.platform === "win32" && (normalizedResolved.endsWith(".cmd") || normalizedResolved.endsWith(".bat"));
17
+ if (needsShell) {
18
+ const shim = buildWin32CmdShimInvocation(resolved, args);
19
+ return { cmd: shim.command, args: shim.args, windowsVerbatimArguments: true };
20
+ }
21
+ return { cmd: resolved, args: [...args], windowsVerbatimArguments: false };
22
+ }
23
+ function isInside(parent, candidate) {
24
+ const rel = relative(parent, candidate);
25
+ return rel === "" || !rel.startsWith(`..${sep}`) && rel !== ".." && !isAbsolute(rel);
26
+ }
27
+ var binCache = /* @__PURE__ */ new Map();
28
+ var BIN_CACHE_MAX = 64;
29
+ var NEGATIVE_BIN_CACHE_TTL_MS = 5e3;
30
+ function cachePut(key, value) {
31
+ while (binCache.size >= BIN_CACHE_MAX) {
32
+ const oldest = binCache.keys().next().value;
33
+ if (oldest === void 0) break;
34
+ binCache.delete(oldest);
35
+ }
36
+ binCache.set(key, { value, cachedAt: Date.now() });
37
+ return value;
38
+ }
39
+ function resolveNodeBin(packageName, binName, cwd, extraArgs = []) {
40
+ const key = `${packageName}|${binName}|${cwd}`;
41
+ const cached = binCache.get(key);
42
+ if (cached !== void 0) {
43
+ if (cached.value !== null || Date.now() - cached.cachedAt < NEGATIVE_BIN_CACHE_TTL_MS) {
44
+ return cached.value === null ? null : { ...cached.value, args: [cached.value.entry, ...extraArgs] };
45
+ }
46
+ binCache.delete(key);
47
+ }
48
+ let resolved = null;
49
+ try {
50
+ const requireFromProject = createRequire(resolve(cwd, "package.json"));
51
+ const packagePath = requireFromProject.resolve(`${packageName}/package.json`);
52
+ const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
53
+ const relativeBin = typeof packageJson.bin === "string" ? packageJson.bin : packageJson.bin?.[binName] ?? Object.values(packageJson.bin ?? {})[0];
54
+ if (relativeBin && !isAbsolute(relativeBin)) {
55
+ const packageDir = dirname(packagePath);
56
+ const entry = resolve(packageDir, relativeBin);
57
+ if (isInside(packageDir, entry)) {
58
+ resolved = { cmd: process.execPath, args: [entry], entry };
59
+ }
60
+ }
61
+ } catch {
62
+ resolved = null;
63
+ }
64
+ cachePut(key, resolved);
65
+ return resolved === null ? null : { ...resolved, args: [resolved.entry, ...extraArgs] };
66
+ }
67
+
68
+ // src/runtime/index.ts
7
69
  var META_CHARS = /["'`;&|<>\r\n]/;
8
70
  var MAX_BUFFER_BYTES = 16 * 1024 * 1024;
9
71
  function hasLeadingDash(arg) {
@@ -17,9 +79,9 @@ function safeSplit(command) {
17
79
  function withinProjectPath(projectRoot, candidate) {
18
80
  if (candidate.length === 0 || candidate.length > 4096) return false;
19
81
  if (hasLeadingDash(candidate)) return false;
20
- const resolved = isAbsolute(candidate) ? resolve(candidate) : resolve(projectRoot, candidate);
21
- const rel = relative(projectRoot, resolved);
22
- return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
82
+ const resolved = isAbsolute2(candidate) ? resolve2(candidate) : resolve2(projectRoot, candidate);
83
+ const rel = relative2(projectRoot, resolved);
84
+ return rel === "" || !rel.startsWith("..") && !isAbsolute2(rel);
23
85
  }
24
86
  function everyFlagAllowed(allowed, args) {
25
87
  for (const arg of args) {
@@ -31,14 +93,14 @@ function everyFlagAllowed(allowed, args) {
31
93
  }
32
94
  function sanitizeRunnerPath(value, options = {}) {
33
95
  if (!value || hasLeadingDash(value)) return null;
34
- const projectRoot = resolve(options.projectRoot ?? process.cwd());
96
+ const projectRoot = resolve2(options.projectRoot ?? process.cwd());
35
97
  if (!withinProjectPath(projectRoot, value)) return null;
36
- return isAbsolute(value) ? resolve(value) : resolve(projectRoot, value);
98
+ return isAbsolute2(value) ? resolve2(value) : resolve2(projectRoot, value);
37
99
  }
38
100
  function resolveRunnerCommand(runtime, command, options = {}) {
39
101
  const tokens = safeSplit(command);
40
102
  if (!tokens || tokens.length === 0) return null;
41
- const projectRoot = resolve(options.projectRoot ?? process.cwd());
103
+ const projectRoot = resolve2(options.projectRoot ?? process.cwd());
42
104
  const launcher = runtime.packageManager;
43
105
  const [head, second, ...rest] = tokens;
44
106
  if (!head) return null;
@@ -69,7 +131,7 @@ function resolveRunnerCommand(runtime, command, options = {}) {
69
131
  return { cmd: head, args: [second, exe, ...tail], display };
70
132
  }
71
133
  }
72
- if (isAbsolute(head)) {
134
+ if (isAbsolute2(head)) {
73
135
  if (!withinProjectPath(projectRoot, head)) return null;
74
136
  const base = basename(head);
75
137
  if (base !== runtime.executable && base !== launcher) return null;
@@ -90,7 +152,7 @@ function runRunnerCommand(argv, options) {
90
152
  });
91
153
  }
92
154
  return new Promise((resolvePromise) => {
93
- const projectRoot = resolve(options.projectRoot ?? process.cwd());
155
+ const projectRoot = resolve2(options.projectRoot ?? process.cwd());
94
156
  const trimmedCwd = options.cwd.trim();
95
157
  if (!withinProjectPath(projectRoot, trimmedCwd)) {
96
158
  resolvePromise({
@@ -108,21 +170,37 @@ function runRunnerCommand(argv, options) {
108
170
  const stderrChunks = [];
109
171
  let stdoutBytes = 0;
110
172
  let stderrBytes = 0;
111
- options.signal?.addEventListener("abort", () => {
173
+ const onAbort = () => {
112
174
  timedOut = true;
113
- }, { once: true });
175
+ };
176
+ let invocation;
177
+ try {
178
+ invocation = resolveExecInvocation(argv[0], argv.slice(1));
179
+ } catch (err) {
180
+ resolvePromise({
181
+ code: null,
182
+ stdout: "",
183
+ stderr: `runtime helper: ${err instanceof Error ? err.message : String(err)}`,
184
+ timedOut: false,
185
+ spawnError: true
186
+ });
187
+ return;
188
+ }
189
+ options.signal?.addEventListener("abort", onAbort, { once: true });
114
190
  const child = execFile(
115
- argv[0],
116
- argv.slice(1),
191
+ invocation.cmd,
192
+ invocation.args,
117
193
  {
118
194
  cwd: trimmedCwd,
119
195
  timeout: options.timeoutMs,
120
196
  signal: options.signal,
121
197
  maxBuffer: MAX_BUFFER_BYTES,
122
198
  windowsHide: true,
123
- shell: false
199
+ shell: false,
200
+ ...invocation.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {}
124
201
  },
125
202
  (err) => {
203
+ options.signal?.removeEventListener("abort", onAbort);
126
204
  if (timedOut) {
127
205
  resolvePromise({
128
206
  code: null,
@@ -185,7 +263,8 @@ function runRunnerCommand(argv, options) {
185
263
  });
186
264
  }
187
265
  function withinProject(p) {
188
- return withinProjectPath(process.cwd(), p) || relative(process.cwd(), p) === ".";
266
+ const cwd = process.cwd();
267
+ return withinProjectPath(cwd, p) || relative2(cwd, p) === ".";
189
268
  }
190
269
 
191
270
  // src/type-gate/index.ts
@@ -209,9 +288,15 @@ var DEFAULTS = {
209
288
  maxErrors: 5,
210
289
  runOnChange: [".ts", ".tsx", ".js", ".jsx", ".mts", ".cts"]
211
290
  };
291
+ var runOnChangeSet = new Set(DEFAULTS.runOnChange);
212
292
  function readConfig(raw) {
213
- if (!raw || typeof raw !== "object") return { ...DEFAULTS };
293
+ if (!raw || typeof raw !== "object") {
294
+ runOnChangeSet = new Set(DEFAULTS.runOnChange);
295
+ return { ...DEFAULTS };
296
+ }
214
297
  const r = raw;
298
+ const runOnChange = Array.isArray(r["runOnChange"]) ? r["runOnChange"].filter((x) => typeof x === "string") : DEFAULTS.runOnChange;
299
+ runOnChangeSet = new Set(runOnChange);
215
300
  return {
216
301
  enabled: r["enabled"] === true,
217
302
  command: typeof r["command"] === "string" ? r["command"] : DEFAULTS.command,
@@ -219,7 +304,7 @@ function readConfig(raw) {
219
304
  timeoutMs: typeof r["timeoutMs"] === "number" && r["timeoutMs"] > 0 ? r["timeoutMs"] : DEFAULTS.timeoutMs,
220
305
  failSeverity: r["failSeverity"] === "block" ? "block" : DEFAULTS.failSeverity,
221
306
  maxErrors: typeof r["maxErrors"] === "number" && r["maxErrors"] >= 1 && r["maxErrors"] <= 50 ? r["maxErrors"] : DEFAULTS.maxErrors,
222
- runOnChange: Array.isArray(r["runOnChange"]) ? r["runOnChange"].filter((x) => typeof x === "string") : DEFAULTS.runOnChange
307
+ runOnChange
223
308
  };
224
309
  }
225
310
  var TSC_RUNTIME = {
@@ -256,7 +341,9 @@ async function runTypeCheck(cfg) {
256
341
  if (!resolved) return null;
257
342
  argv = [resolved.cmd, ...resolved.args];
258
343
  } else {
259
- argv = ["npx", "tsc", "--noEmit", "--incremental"];
344
+ const tscFlags = ["--noEmit", "--incremental"];
345
+ const localTsc = resolveNodeBin("typescript", "tsc", process.cwd(), tscFlags);
346
+ argv = localTsc ? [localTsc.cmd, ...localTsc.args] : ["npx", "tsc", ...tscFlags];
260
347
  if (tsConfig && tsConfig !== "tsconfig.json") {
261
348
  argv = [...argv, "-p", tsConfig];
262
349
  }
@@ -362,7 +449,7 @@ var plugin = {
362
449
  if (!sourcePath || typeof sourcePath !== "string") return;
363
450
  if (!withinProject(sourcePath)) return;
364
451
  const ext = sourcePath.includes(".") ? sourcePath.slice(sourcePath.lastIndexOf(".")).toLowerCase() : "";
365
- if (!cfg.runOnChange.includes(ext)) {
452
+ if (!runOnChangeSet.has(ext)) {
366
453
  state.skippedCount += 1;
367
454
  return;
368
455
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wrongstack/plugins",
3
- "version": "0.293.0",
4
- "description": "Official WrongStack plugin collection 64 focused, single-purpose plugins for code quality, security, observability, planning, and agent coordination",
3
+ "version": "0.295.1",
4
+ "description": "Official WrongStack collection of focused plugins for code quality, security, observability, planning, and agent coordination",
5
5
  "license": "MIT",
6
6
  "author": "ECOSTACK TECHNOLOGY OÜ",
7
7
  "type": "module",
@@ -12,30 +12,42 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "import": "./dist/index.js"
14
14
  },
15
+ "./manifest": {
16
+ "types": "./dist/manifest.d.ts",
17
+ "import": "./dist/manifest.js"
18
+ },
19
+ "./factories": {
20
+ "types": "./dist/factories.d.ts",
21
+ "import": "./dist/factories.js"
22
+ },
23
+ "./audit": {
24
+ "types": "./dist/audit.d.ts",
25
+ "import": "./dist/audit.js"
26
+ },
15
27
  "./agent-handoff": {
16
28
  "types": "./dist/agent-handoff.d.ts",
17
29
  "import": "./dist/agent-handoff.js"
18
30
  },
19
- "./auto-doc": {
20
- "types": "./dist/auto-doc.d.ts",
21
- "import": "./dist/auto-doc.js"
31
+ "./cost-tracker": {
32
+ "types": "./dist/cost-tracker.d.ts",
33
+ "import": "./dist/cost-tracker.js"
34
+ },
35
+ "./file-watcher": {
36
+ "types": "./dist/file-watcher.d.ts",
37
+ "import": "./dist/file-watcher.js"
22
38
  },
23
39
  "./git-autocommit": {
24
40
  "types": "./dist/git-autocommit.d.ts",
25
41
  "import": "./dist/git-autocommit.js"
26
42
  },
43
+ "./auto-doc": {
44
+ "types": "./dist/auto-doc.d.ts",
45
+ "import": "./dist/auto-doc.js"
46
+ },
27
47
  "./shell-check": {
28
48
  "types": "./dist/shell-check.d.ts",
29
49
  "import": "./dist/shell-check.js"
30
50
  },
31
- "./cost-tracker": {
32
- "types": "./dist/cost-tracker.d.ts",
33
- "import": "./dist/cost-tracker.js"
34
- },
35
- "./file-watcher": {
36
- "types": "./dist/file-watcher.d.ts",
37
- "import": "./dist/file-watcher.js"
38
- },
39
51
  "./cron": {
40
52
  "types": "./dist/cron.d.ts",
41
53
  "import": "./dist/cron.js"
@@ -88,6 +100,10 @@
88
100
  "types": "./dist/import-organizer.d.ts",
89
101
  "import": "./dist/import-organizer.js"
90
102
  },
103
+ "./knowledge-graph": {
104
+ "types": "./dist/knowledge-graph.d.ts",
105
+ "import": "./dist/knowledge-graph.js"
106
+ },
91
107
  "./todo-listener": {
92
108
  "types": "./dist/todo-listener.d.ts",
93
109
  "import": "./dist/todo-listener.js"
@@ -144,10 +160,6 @@
144
160
  "types": "./dist/injection-shield.d.ts",
145
161
  "import": "./dist/injection-shield.js"
146
162
  },
147
- "./knowledge-graph": {
148
- "types": "./dist/knowledge-graph.d.ts",
149
- "import": "./dist/knowledge-graph.js"
150
- },
151
163
  "./llm-cache": {
152
164
  "types": "./dist/llm-cache.d.ts",
153
165
  "import": "./dist/llm-cache.js"
@@ -156,22 +168,18 @@
156
168
  "types": "./dist/model-router.d.ts",
157
169
  "import": "./dist/model-router.js"
158
170
  },
159
- "./prompt-firewall": {
160
- "types": "./dist/prompt-firewall.d.ts",
161
- "import": "./dist/prompt-firewall.js"
162
- },
163
171
  "./pr-drafter": {
164
172
  "types": "./dist/pr-drafter.d.ts",
165
173
  "import": "./dist/pr-drafter.js"
166
174
  },
175
+ "./prompt-firewall": {
176
+ "types": "./dist/prompt-firewall.d.ts",
177
+ "import": "./dist/prompt-firewall.js"
178
+ },
167
179
  "./auto-escalate": {
168
180
  "types": "./dist/auto-escalate.d.ts",
169
181
  "import": "./dist/auto-escalate.js"
170
182
  },
171
- "./token-throttle": {
172
- "types": "./dist/token-throttle.d.ts",
173
- "import": "./dist/token-throttle.js"
174
- },
175
183
  "./test-coverage-gate": {
176
184
  "types": "./dist/test-coverage-gate.d.ts",
177
185
  "import": "./dist/test-coverage-gate.js"
@@ -180,22 +188,14 @@
180
188
  "types": "./dist/type-gate.d.ts",
181
189
  "import": "./dist/type-gate.js"
182
190
  },
191
+ "./token-throttle": {
192
+ "types": "./dist/token-throttle.d.ts",
193
+ "import": "./dist/token-throttle.js"
194
+ },
183
195
  "./plugin-stack-observer": {
184
196
  "types": "./dist/plugin-stack-observer.d.ts",
185
197
  "import": "./dist/plugin-stack-observer.js"
186
198
  },
187
- "./accessibility-auditor": {
188
- "types": "./dist/accessibility-auditor.d.ts",
189
- "import": "./dist/accessibility-auditor.js"
190
- },
191
- "./api-compatibility-gate": {
192
- "types": "./dist/api-compatibility-gate.d.ts",
193
- "import": "./dist/api-compatibility-gate.js"
194
- },
195
- "./auto-i18n-extractor": {
196
- "types": "./dist/auto-i18n-extractor.d.ts",
197
- "import": "./dist/auto-i18n-extractor.js"
198
- },
199
199
  "./dead-code-detector": {
200
200
  "types": "./dist/dead-code-detector.d.ts",
201
201
  "import": "./dist/dead-code-detector.js"
@@ -204,58 +204,66 @@
204
204
  "types": "./dist/dependency-vulnerability-gate.d.ts",
205
205
  "import": "./dist/dependency-vulnerability-gate.js"
206
206
  },
207
+ "./migration-planner": {
208
+ "types": "./dist/migration-planner.d.ts",
209
+ "import": "./dist/migration-planner.js"
210
+ },
211
+ "./semantic-search-indexer": {
212
+ "types": "./dist/semantic-search-indexer.d.ts",
213
+ "import": "./dist/semantic-search-indexer.js"
214
+ },
215
+ "./auto-i18n-extractor": {
216
+ "types": "./dist/auto-i18n-extractor.d.ts",
217
+ "import": "./dist/auto-i18n-extractor.js"
218
+ },
207
219
  "./doc-sync-guard": {
208
220
  "types": "./dist/doc-sync-guard.d.ts",
209
221
  "import": "./dist/doc-sync-guard.js"
210
222
  },
211
- "./license-audit-gate": {
212
- "types": "./dist/license-audit-gate.d.ts",
213
- "import": "./dist/license-audit-gate.js"
214
- },
215
- "./migration-planner": {
216
- "types": "./dist/migration-planner.d.ts",
217
- "import": "./dist/migration-planner.js"
223
+ "./api-compatibility-gate": {
224
+ "types": "./dist/api-compatibility-gate.d.ts",
225
+ "import": "./dist/api-compatibility-gate.js"
218
226
  },
219
227
  "./performance-regression-gate": {
220
228
  "types": "./dist/performance-regression-gate.d.ts",
221
229
  "import": "./dist/performance-regression-gate.js"
222
230
  },
231
+ "./test-flake-detector": {
232
+ "types": "./dist/test-flake-detector.d.ts",
233
+ "import": "./dist/test-flake-detector.js"
234
+ },
223
235
  "./schema-evolution-guard": {
224
236
  "types": "./dist/schema-evolution-guard.d.ts",
225
237
  "import": "./dist/schema-evolution-guard.js"
226
238
  },
239
+ "./license-audit-gate": {
240
+ "types": "./dist/license-audit-gate.d.ts",
241
+ "import": "./dist/license-audit-gate.js"
242
+ },
243
+ "./accessibility-auditor": {
244
+ "types": "./dist/accessibility-auditor.d.ts",
245
+ "import": "./dist/accessibility-auditor.js"
246
+ },
227
247
  "./security-hotspot-scanner": {
228
248
  "types": "./dist/security-hotspot-scanner.d.ts",
229
249
  "import": "./dist/security-hotspot-scanner.js"
230
250
  },
231
- "./semantic-search-indexer": {
232
- "types": "./dist/semantic-search-indexer.d.ts",
233
- "import": "./dist/semantic-search-indexer.js"
234
- },
235
- "./test-flake-detector": {
236
- "types": "./dist/test-flake-detector.d.ts",
237
- "import": "./dist/test-flake-detector.js"
238
- },
239
- "./code-metrics": {
240
- "types": "./dist/code-metrics.d.ts",
241
- "import": "./dist/code-metrics.js"
242
- },
243
251
  "./duplicate-code-detector": {
244
252
  "types": "./dist/duplicate-code-detector.d.ts",
245
253
  "import": "./dist/duplicate-code-detector.js"
246
254
  },
247
- "./feature-flag-tracker": {
248
- "types": "./dist/feature-flag-tracker.d.ts",
249
- "import": "./dist/feature-flag-tracker.js"
250
- },
251
- "./interface-contract-guard": {
252
- "types": "./dist/interface-contract-guard.d.ts",
253
- "import": "./dist/interface-contract-guard.js"
255
+ "./code-metrics": {
256
+ "types": "./dist/code-metrics.d.ts",
257
+ "import": "./dist/code-metrics.js"
254
258
  },
255
259
  "./refactor-suggester": {
256
260
  "types": "./dist/refactor-suggester.d.ts",
257
261
  "import": "./dist/refactor-suggester.js"
258
262
  },
263
+ "./test-generator": {
264
+ "types": "./dist/test-generator.d.ts",
265
+ "import": "./dist/test-generator.js"
266
+ },
259
267
  "./release-notes-generator": {
260
268
  "types": "./dist/release-notes-generator.d.ts",
261
269
  "import": "./dist/release-notes-generator.js"
@@ -264,9 +272,13 @@
264
272
  "types": "./dist/smart-rename.d.ts",
265
273
  "import": "./dist/smart-rename.js"
266
274
  },
267
- "./test-generator": {
268
- "types": "./dist/test-generator.d.ts",
269
- "import": "./dist/test-generator.js"
275
+ "./feature-flag-tracker": {
276
+ "types": "./dist/feature-flag-tracker.d.ts",
277
+ "import": "./dist/feature-flag-tracker.js"
278
+ },
279
+ "./interface-contract-guard": {
280
+ "types": "./dist/interface-contract-guard.d.ts",
281
+ "import": "./dist/interface-contract-guard.js"
270
282
  },
271
283
  "./runtime": {
272
284
  "types": "./dist/runtime.d.ts",
@@ -282,8 +294,8 @@
282
294
  "vitest": "^4.1.10"
283
295
  },
284
296
  "dependencies": {
285
- "@wrongstack/core": "0.293.0",
286
- "@wrongstack/tools": "0.293.0"
297
+ "@wrongstack/core": "0.295.1",
298
+ "@wrongstack/tools": "0.295.1"
287
299
  },
288
300
  "scripts": {
289
301
  "build": "node ../../scripts/build-package.mjs",