@wrongstack/plugins 0.285.0 → 0.287.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 (67) hide show
  1. package/README.md +20 -11
  2. package/dist/accessibility-auditor/index.d.ts.map +1 -1
  3. package/dist/accessibility-auditor.js +30 -26
  4. package/dist/api-compatibility-gate.js +1 -1
  5. package/dist/auto-doc.js +1 -1
  6. package/dist/auto-i18n-extractor/index.d.ts.map +1 -1
  7. package/dist/auto-i18n-extractor.js +21 -14
  8. package/dist/changelog-writer.js +1 -1
  9. package/dist/code-metrics/index.d.ts.map +1 -1
  10. package/dist/code-metrics.js +34 -27
  11. package/dist/commit-validator.js +1 -1
  12. package/dist/config-validator.js +1 -1
  13. package/dist/cron/index.d.ts.map +1 -1
  14. package/dist/cron.js +29 -0
  15. package/dist/dead-code-detector/index.d.ts.map +1 -1
  16. package/dist/dead-code-detector.js +30 -22
  17. package/dist/dep-guard.js +1 -1
  18. package/dist/diff-summary/index.d.ts.map +1 -1
  19. package/dist/diff-summary.js +19 -11
  20. package/dist/doc-sync-guard/index.d.ts.map +1 -1
  21. package/dist/doc-sync-guard.js +24 -15
  22. package/dist/duplicate-code-detector/index.d.ts.map +1 -1
  23. package/dist/duplicate-code-detector.js +27 -18
  24. package/dist/error-lens.js +1 -1
  25. package/dist/feature-flag-tracker/index.d.ts.map +1 -1
  26. package/dist/feature-flag-tracker.js +27 -19
  27. package/dist/file-watcher/index.d.ts.map +1 -1
  28. package/dist/file-watcher.js +15 -2
  29. package/dist/format-on-save/index.d.ts.map +1 -1
  30. package/dist/format-on-save.js +19 -11
  31. package/dist/git-autocommit.js +1 -1
  32. package/dist/import-organizer/index.d.ts.map +1 -1
  33. package/dist/import-organizer.js +22 -13
  34. package/dist/index.d.ts +4 -4
  35. package/dist/index.js +1007 -759
  36. package/dist/interface-contract-guard/index.d.ts.map +1 -1
  37. package/dist/interface-contract-guard.js +27 -19
  38. package/dist/license-audit-gate/index.d.ts.map +1 -1
  39. package/dist/license-audit-gate.js +1 -2
  40. package/dist/migration-planner/index.d.ts +12 -2
  41. package/dist/migration-planner/index.d.ts.map +1 -1
  42. package/dist/migration-planner.js +210 -28
  43. package/dist/pr-drafter.js +1 -1
  44. package/dist/refactor-suggester/index.d.ts.map +1 -1
  45. package/dist/refactor-suggester.js +37 -29
  46. package/dist/release-notes-generator/index.d.ts +3 -1
  47. package/dist/release-notes-generator/index.d.ts.map +1 -1
  48. package/dist/release-notes-generator.js +152 -12
  49. package/dist/runtime/index.d.ts +12 -0
  50. package/dist/runtime/index.d.ts.map +1 -1
  51. package/dist/runtime/llm.d.ts +33 -0
  52. package/dist/runtime/llm.d.ts.map +1 -0
  53. package/dist/runtime.js +57 -2
  54. package/dist/schema-evolution-guard/index.d.ts.map +1 -1
  55. package/dist/schema-evolution-guard.js +21 -12
  56. package/dist/security-hotspot-scanner/index.d.ts.map +1 -1
  57. package/dist/security-hotspot-scanner.js +25 -16
  58. package/dist/session-recap.js +1 -1
  59. package/dist/spec-linker.js +1007 -759
  60. package/dist/test-generator/index.d.ts +5 -3
  61. package/dist/test-generator/index.d.ts.map +1 -1
  62. package/dist/test-generator.js +183 -41
  63. package/dist/test-runner-gate/index.d.ts.map +1 -1
  64. package/dist/test-runner-gate.js +65 -43
  65. package/dist/type-gate/index.d.ts.map +1 -1
  66. package/dist/type-gate.js +5 -13
  67. package/package.json +3 -3
@@ -1,6 +1,25 @@
1
1
  // src/security-hotspot-scanner/index.ts
2
2
  import { readdirSync, readFileSync, statSync } from "node:fs";
3
- import { isAbsolute, relative, resolve } from "node:path";
3
+ import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve2 } from "node:path";
4
+
5
+ // src/runtime/index.ts
6
+ import { basename, isAbsolute, relative, resolve } from "node:path";
7
+ var MAX_BUFFER_BYTES = 16 * 1024 * 1024;
8
+ function hasLeadingDash(arg) {
9
+ return arg.length > 0 && arg.startsWith("-");
10
+ }
11
+ function withinProjectPath(projectRoot, candidate) {
12
+ if (candidate.length === 0 || candidate.length > 4096) return false;
13
+ if (hasLeadingDash(candidate)) return false;
14
+ const resolved = isAbsolute(candidate) ? resolve(candidate) : resolve(projectRoot, candidate);
15
+ const rel = relative(projectRoot, resolved);
16
+ return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
17
+ }
18
+ function withinProject(p) {
19
+ return withinProjectPath(process.cwd(), p) || relative(process.cwd(), p) === ".";
20
+ }
21
+
22
+ // src/security-hotspot-scanner/index.ts
4
23
  var API_VERSION = "^0.1.10";
5
24
  var state = {
6
25
  scanCount: 0,
@@ -45,7 +64,7 @@ var PATTERNS = [
45
64
  {
46
65
  type: "hardcoded_http",
47
66
  severity: "medium",
48
- regex: /http:\/\/[a-zA-Z0-9][^\s'"\)\\]*/i
67
+ regex: /http:\/\/[a-zA-Z0-9][^\s'")\\]*/i
49
68
  },
50
69
  {
51
70
  type: "console_log_credentials",
@@ -82,20 +101,10 @@ function isSourceFile(filePath, extensions) {
82
101
  const lower = filePath.toLowerCase();
83
102
  return extensions.some((ext) => lower.endsWith(ext));
84
103
  }
85
- function withinProject(p) {
86
- if (typeof p !== "string" || p.length === 0 || p.length > 4096) return false;
87
- const root = process.cwd();
88
- const resolved = isAbsolute(p) ? resolve(p) : resolve(root, p);
89
- const rel = relative(root, resolved);
90
- if (rel === "" || rel === ".") return true;
91
- if (rel.startsWith("..")) return false;
92
- if (isAbsolute(rel)) return false;
93
- return true;
94
- }
95
104
  function scanPath(inputPath, cfg) {
96
105
  const start = Date.now();
97
106
  const root = process.cwd();
98
- const resolved = isAbsolute(inputPath) ? resolve(inputPath) : resolve(root, inputPath);
107
+ const resolved = isAbsolute2(inputPath) ? resolve2(inputPath) : resolve2(root, inputPath);
99
108
  if (!withinProject(inputPath)) {
100
109
  return {
101
110
  path: inputPath,
@@ -116,7 +125,7 @@ function scanPath(inputPath, cfg) {
116
125
  filesScanned += 1;
117
126
  const findings = scanSource(content, maxPerFile);
118
127
  for (const f of findings) {
119
- allFindings.push({ ...f, snippet: `${relative(root, filePath)}:${f.line}: ${f.snippet}` });
128
+ allFindings.push({ ...f, snippet: `${relative2(root, filePath)}:${f.line}: ${f.snippet}` });
120
129
  if (allFindings.length >= cfg.maxFindings) return;
121
130
  }
122
131
  } catch {
@@ -131,7 +140,7 @@ function scanPath(inputPath, cfg) {
131
140
  }
132
141
  for (const entry of entries) {
133
142
  if (allFindings.length >= cfg.maxFindings) return;
134
- const full = resolve(dir, entry);
143
+ const full = resolve2(dir, entry);
135
144
  try {
136
145
  const st = statSync(full);
137
146
  if (st.isDirectory()) {
@@ -279,7 +288,7 @@ Review or remove the risky pattern(s).`;
279
288
  }
280
289
  return { additionalContext: message };
281
290
  };
282
- state.hookUnregister = api.registerHook("PostToolUse", "write|edit", hook);
291
+ state.hookUnregister = api.registerHook("PostToolUse", "write|edit", hook, { background: true });
283
292
  api.tools.register({
284
293
  name: "security_hotspot_scan",
285
294
  description: "Scan a file or directory for security anti-patterns (eval, Function constructor, innerHTML, SQL concatenation, http URLs, credential logging, variable exec commands).",
@@ -106,7 +106,7 @@ var plugin = {
106
106
  version: "0.1.0",
107
107
  description: "Stop hook that posts a one-page session summary (tokens, tools, commits, last activity) to the project mailbox",
108
108
  apiVersion: "^0.1.10",
109
- capabilities: { tools: true, hooks: true },
109
+ capabilities: { tools: true, hooks: true, llm: true },
110
110
  defaultConfig: { ...DEFAULTS },
111
111
  configSchema: {
112
112
  type: "object",