@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.
- package/README.md +20 -11
- package/dist/accessibility-auditor/index.d.ts.map +1 -1
- package/dist/accessibility-auditor.js +30 -26
- package/dist/api-compatibility-gate.js +1 -1
- package/dist/auto-doc.js +1 -1
- package/dist/auto-i18n-extractor/index.d.ts.map +1 -1
- package/dist/auto-i18n-extractor.js +21 -14
- package/dist/changelog-writer.js +1 -1
- package/dist/code-metrics/index.d.ts.map +1 -1
- package/dist/code-metrics.js +34 -27
- package/dist/commit-validator.js +1 -1
- package/dist/config-validator.js +1 -1
- package/dist/cron/index.d.ts.map +1 -1
- package/dist/cron.js +29 -0
- package/dist/dead-code-detector/index.d.ts.map +1 -1
- package/dist/dead-code-detector.js +30 -22
- package/dist/dep-guard.js +1 -1
- package/dist/diff-summary/index.d.ts.map +1 -1
- package/dist/diff-summary.js +19 -11
- package/dist/doc-sync-guard/index.d.ts.map +1 -1
- package/dist/doc-sync-guard.js +24 -15
- package/dist/duplicate-code-detector/index.d.ts.map +1 -1
- package/dist/duplicate-code-detector.js +27 -18
- package/dist/error-lens.js +1 -1
- package/dist/feature-flag-tracker/index.d.ts.map +1 -1
- package/dist/feature-flag-tracker.js +27 -19
- package/dist/file-watcher/index.d.ts.map +1 -1
- package/dist/file-watcher.js +15 -2
- package/dist/format-on-save/index.d.ts.map +1 -1
- package/dist/format-on-save.js +19 -11
- package/dist/git-autocommit.js +1 -1
- package/dist/import-organizer/index.d.ts.map +1 -1
- package/dist/import-organizer.js +22 -13
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1007 -759
- package/dist/interface-contract-guard/index.d.ts.map +1 -1
- package/dist/interface-contract-guard.js +27 -19
- package/dist/license-audit-gate/index.d.ts.map +1 -1
- package/dist/license-audit-gate.js +1 -2
- package/dist/migration-planner/index.d.ts +12 -2
- package/dist/migration-planner/index.d.ts.map +1 -1
- package/dist/migration-planner.js +210 -28
- package/dist/pr-drafter.js +1 -1
- package/dist/refactor-suggester/index.d.ts.map +1 -1
- package/dist/refactor-suggester.js +37 -29
- package/dist/release-notes-generator/index.d.ts +3 -1
- package/dist/release-notes-generator/index.d.ts.map +1 -1
- package/dist/release-notes-generator.js +152 -12
- package/dist/runtime/index.d.ts +12 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/llm.d.ts +33 -0
- package/dist/runtime/llm.d.ts.map +1 -0
- package/dist/runtime.js +57 -2
- package/dist/schema-evolution-guard/index.d.ts.map +1 -1
- package/dist/schema-evolution-guard.js +21 -12
- package/dist/security-hotspot-scanner/index.d.ts.map +1 -1
- package/dist/security-hotspot-scanner.js +25 -16
- package/dist/session-recap.js +1 -1
- package/dist/spec-linker.js +1007 -759
- package/dist/test-generator/index.d.ts +5 -3
- package/dist/test-generator/index.d.ts.map +1 -1
- package/dist/test-generator.js +183 -41
- package/dist/test-runner-gate/index.d.ts.map +1 -1
- package/dist/test-runner-gate.js +65 -43
- package/dist/type-gate/index.d.ts.map +1 -1
- package/dist/type-gate.js +5 -13
- 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'"
|
|
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 =
|
|
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: `${
|
|
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 =
|
|
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).",
|
package/dist/session-recap.js
CHANGED
|
@@ -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",
|