@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.
- package/README.md +7 -71
- package/dist/accessibility-auditor/index.d.ts +1 -1
- package/dist/accessibility-auditor/index.d.ts.map +1 -1
- package/dist/accessibility-auditor.js +50 -33
- package/dist/agent-handoff/index.d.ts +1 -1
- package/dist/agent-handoff/index.d.ts.map +1 -1
- package/dist/agent-handoff.js +30 -1
- package/dist/api-compatibility-gate/index.d.ts +1 -1
- package/dist/api-compatibility-gate/index.d.ts.map +1 -1
- package/dist/api-compatibility-gate.js +21 -16
- package/dist/audit/index.d.ts +386 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit.d.ts +1 -0
- package/dist/audit.js +454 -0
- package/dist/auto-doc/index.d.ts +1 -1
- package/dist/auto-doc/index.d.ts.map +1 -1
- package/dist/auto-doc.js +3 -1
- package/dist/auto-escalate/index.d.ts +1 -1
- package/dist/auto-escalate/index.d.ts.map +1 -1
- package/dist/auto-i18n-extractor/index.d.ts +1 -1
- package/dist/auto-i18n-extractor/index.d.ts.map +1 -1
- package/dist/auto-i18n-extractor.js +7 -1
- package/dist/branch-guard/index.d.ts +1 -1
- package/dist/branch-guard/index.d.ts.map +1 -1
- package/dist/branch-guard.js +111 -1
- package/dist/catalog.d.ts +5 -30
- package/dist/catalog.d.ts.map +1 -1
- package/dist/changelog-writer/index.d.ts +1 -1
- package/dist/changelog-writer/index.d.ts.map +1 -1
- package/dist/changelog-writer.js +137 -3
- package/dist/checkpoint/index.d.ts +3 -1
- package/dist/checkpoint/index.d.ts.map +1 -1
- package/dist/checkpoint.js +41 -16
- package/dist/code-metrics/index.d.ts +1 -1
- package/dist/code-metrics/index.d.ts.map +1 -1
- package/dist/code-metrics.js +34 -29
- package/dist/commit-validator/index.d.ts +1 -1
- package/dist/commit-validator/index.d.ts.map +1 -1
- package/dist/commit-validator.js +17 -7
- package/dist/config-validator/index.d.ts +1 -1
- package/dist/config-validator/index.d.ts.map +1 -1
- package/dist/context-pins/index.d.ts +1 -1
- package/dist/context-pins/index.d.ts.map +1 -1
- package/dist/context-pins.js +6 -5
- package/dist/cost-tracker/index.d.ts +1 -1
- package/dist/cost-tracker/index.d.ts.map +1 -1
- package/dist/cost-tracker.js +109 -2
- package/dist/cron/index.d.ts +1 -1
- package/dist/cron/index.d.ts.map +1 -1
- package/dist/cron.js +1 -0
- package/dist/dead-code-detector/index.d.ts +1 -1
- package/dist/dead-code-detector/index.d.ts.map +1 -1
- package/dist/dead-code-detector.js +31 -18
- package/dist/dep-guard/index.d.ts +1 -1
- package/dist/dep-guard/index.d.ts.map +1 -1
- package/dist/dependency-vulnerability-gate/index.d.ts +1 -1
- package/dist/dependency-vulnerability-gate/index.d.ts.map +1 -1
- package/dist/dependency-vulnerability-gate.js +67 -20
- package/dist/diff-summary/index.d.ts +1 -1
- package/dist/diff-summary/index.d.ts.map +1 -1
- package/dist/diff-summary.js +128 -30
- package/dist/doc-sync-guard/index.d.ts +1 -1
- package/dist/doc-sync-guard/index.d.ts.map +1 -1
- package/dist/doc-sync-guard.js +7 -1
- package/dist/duplicate-code-detector/index.d.ts +26 -1
- package/dist/duplicate-code-detector/index.d.ts.map +1 -1
- package/dist/duplicate-code-detector.js +280 -69
- package/dist/error-lens/index.d.ts +1 -1
- package/dist/error-lens/index.d.ts.map +1 -1
- package/dist/factories/index.d.ts +4 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories.d.ts +1 -0
- package/dist/factories.js +74 -0
- package/dist/feature-flag-tracker/index.d.ts +1 -1
- package/dist/feature-flag-tracker/index.d.ts.map +1 -1
- package/dist/feature-flag-tracker.js +59 -33
- package/dist/file-watcher/index.d.ts +1 -1
- package/dist/file-watcher/index.d.ts.map +1 -1
- package/dist/file-watcher.js +6 -7
- package/dist/format-on-save/index.d.ts +3 -1
- package/dist/format-on-save/index.d.ts.map +1 -1
- package/dist/format-on-save.js +289 -59
- package/dist/generated-plugin-exports.d.ts +65 -0
- package/dist/generated-plugin-exports.d.ts.map +1 -0
- package/dist/git-autocommit/index.d.ts +1 -1
- package/dist/git-autocommit/index.d.ts.map +1 -1
- package/dist/import-organizer/index.d.ts +1 -1
- package/dist/import-organizer/index.d.ts.map +1 -1
- package/dist/import-organizer.js +141 -20
- package/dist/index.d.ts +4 -183
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18298 -17279
- package/dist/injection-shield/index.d.ts +1 -1
- package/dist/injection-shield/index.d.ts.map +1 -1
- package/dist/interface-contract-guard/index.d.ts +1 -1
- package/dist/interface-contract-guard/index.d.ts.map +1 -1
- package/dist/interface-contract-guard.js +87 -53
- package/dist/knowledge-graph/index.d.ts +1 -1
- package/dist/knowledge-graph/index.d.ts.map +1 -1
- package/dist/knowledge-graph.js +7 -6
- package/dist/license-audit-gate/index.d.ts +1 -1
- package/dist/license-audit-gate/index.d.ts.map +1 -1
- package/dist/lint-gate/index.d.ts +1 -1
- package/dist/lint-gate/index.d.ts.map +1 -1
- package/dist/lint-gate.js +112 -1
- package/dist/llm-cache/index.d.ts +5 -1
- package/dist/llm-cache/index.d.ts.map +1 -1
- package/dist/llm-cache.js +16 -8
- package/dist/loop-breaker/index.d.ts +1 -1
- package/dist/loop-breaker/index.d.ts.map +1 -1
- package/dist/loop-breaker.js +25 -9
- package/dist/manifest/index.d.ts +16 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest.d.ts +1 -0
- package/dist/manifest.js +152 -0
- package/dist/migration-planner/index.d.ts +1 -1
- package/dist/migration-planner/index.d.ts.map +1 -1
- package/dist/migration-planner.js +5 -1
- package/dist/model-router/index.d.ts +1 -1
- package/dist/model-router/index.d.ts.map +1 -1
- package/dist/notify-hub/index.d.ts +1 -1
- package/dist/notify-hub/index.d.ts.map +1 -1
- package/dist/notify-hub/webhook-channel.d.ts +1 -1
- package/dist/notify-hub/webhook-channel.d.ts.map +1 -1
- package/dist/notify-hub.js +41 -4
- package/dist/path-guard/index.d.ts +1 -1
- package/dist/path-guard/index.d.ts.map +1 -1
- package/dist/performance-regression-gate/index.d.ts +1 -1
- package/dist/performance-regression-gate/index.d.ts.map +1 -1
- package/dist/plugin-stack-observer/index.d.ts +1 -1
- package/dist/plugin-stack-observer/index.d.ts.map +1 -1
- package/dist/pr-drafter/index.d.ts +1 -1
- package/dist/pr-drafter/index.d.ts.map +1 -1
- package/dist/pr-drafter.js +28 -29
- package/dist/process-guard/index.d.ts +1 -1
- package/dist/process-guard/index.d.ts.map +1 -1
- package/dist/prompt-firewall/index.d.ts +1 -1
- package/dist/prompt-firewall/index.d.ts.map +1 -1
- package/dist/prompt-firewall.js +140 -11
- package/dist/refactor-suggester/index.d.ts +1 -1
- package/dist/refactor-suggester/index.d.ts.map +1 -1
- package/dist/refactor-suggester.js +148 -33
- package/dist/release-notes-generator/index.d.ts +1 -1
- package/dist/release-notes-generator/index.d.ts.map +1 -1
- package/dist/release-notes-generator.js +29 -22
- package/dist/runtime/bounded-map.d.ts +86 -0
- package/dist/runtime/bounded-map.d.ts.map +1 -0
- package/dist/runtime/credential-patterns.d.ts +42 -0
- package/dist/runtime/credential-patterns.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +18 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/llm.d.ts +1 -1
- package/dist/runtime/llm.d.ts.map +1 -1
- package/dist/runtime/local-bin.d.ts +120 -0
- package/dist/runtime/local-bin.d.ts.map +1 -0
- package/dist/runtime/safe-json.d.ts +25 -0
- package/dist/runtime/safe-json.d.ts.map +1 -0
- package/dist/runtime.js +332 -22
- package/dist/schema-evolution-guard/index.d.ts +1 -1
- package/dist/schema-evolution-guard/index.d.ts.map +1 -1
- package/dist/schema-evolution-guard.js +7 -1
- package/dist/secret-scanner/index.d.ts +1 -1
- package/dist/secret-scanner/index.d.ts.map +1 -1
- package/dist/secret-scanner.js +181 -48
- package/dist/security-hotspot-scanner/index.d.ts +1 -1
- package/dist/security-hotspot-scanner/index.d.ts.map +1 -1
- package/dist/security-hotspot-scanner.js +158 -20
- package/dist/semantic-search-indexer/index.d.ts +1 -1
- package/dist/semantic-search-indexer/index.d.ts.map +1 -1
- package/dist/semantic-search-indexer.js +7 -1
- package/dist/semver-bump/index.d.ts +1 -1
- package/dist/semver-bump/index.d.ts.map +1 -1
- package/dist/semver-bump.js +97 -43
- package/dist/session-recap/index.d.ts +1 -1
- package/dist/session-recap/index.d.ts.map +1 -1
- package/dist/shell-check/index.d.ts +1 -1
- package/dist/shell-check/index.d.ts.map +1 -1
- package/dist/smart-rename/index.d.ts +1 -1
- package/dist/smart-rename/index.d.ts.map +1 -1
- package/dist/spec-linker/index.d.ts +1 -1
- package/dist/spec-linker/index.d.ts.map +1 -1
- package/dist/spec-linker.js +222 -20772
- package/dist/template-engine/index.d.ts +1 -1
- package/dist/template-engine/index.d.ts.map +1 -1
- package/dist/template-engine.js +34 -8
- package/dist/test-coverage-gate/index.d.ts +1 -1
- package/dist/test-coverage-gate/index.d.ts.map +1 -1
- package/dist/test-coverage-gate.js +34 -14
- package/dist/test-flake-detector/index.d.ts +1 -1
- package/dist/test-flake-detector/index.d.ts.map +1 -1
- package/dist/test-flake-detector.js +31 -20
- package/dist/test-generator/index.d.ts +1 -1
- package/dist/test-generator/index.d.ts.map +1 -1
- package/dist/test-runner-gate/index.d.ts +1 -1
- package/dist/test-runner-gate/index.d.ts.map +1 -1
- package/dist/test-runner-gate.js +132 -9
- package/dist/todo-listener/index.d.ts +1 -32
- package/dist/todo-listener/index.d.ts.map +1 -1
- package/dist/todo-listener.js +30 -1
- package/dist/todo-tracker/index.d.ts +1 -1
- package/dist/todo-tracker/index.d.ts.map +1 -1
- package/dist/todo-tracker.js +3 -4
- package/dist/token-budget/index.d.ts +1 -1
- package/dist/token-budget/index.d.ts.map +1 -1
- package/dist/token-throttle/index.d.ts +1 -1
- package/dist/token-throttle/index.d.ts.map +1 -1
- package/dist/token-throttle.js +17 -2
- package/dist/type-gate/index.d.ts +1 -1
- package/dist/type-gate/index.d.ts.map +1 -1
- package/dist/type-gate.js +106 -19
- package/package.json +80 -68
package/dist/token-throttle.js
CHANGED
|
@@ -60,7 +60,21 @@ function estimateRequestTokens(request, charsPerToken) {
|
|
|
60
60
|
walk(request["messages"]);
|
|
61
61
|
return Math.ceil(chars / charsPerToken);
|
|
62
62
|
}
|
|
63
|
-
|
|
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;
|
|
@@ -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,
|
|
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 =
|
|
21
|
-
const rel =
|
|
22
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
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 =
|
|
96
|
+
const projectRoot = resolve2(options.projectRoot ?? process.cwd());
|
|
35
97
|
if (!withinProjectPath(projectRoot, value)) return null;
|
|
36
|
-
return
|
|
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 =
|
|
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 (
|
|
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 =
|
|
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
|
-
|
|
173
|
+
const onAbort = () => {
|
|
112
174
|
timedOut = true;
|
|
113
|
-
}
|
|
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
|
-
|
|
116
|
-
|
|
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
|
-
|
|
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")
|
|
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
|
|
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
|
-
|
|
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 (!
|
|
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.
|
|
4
|
-
"description": "Official WrongStack
|
|
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
|
-
"./
|
|
20
|
-
"types": "./dist/
|
|
21
|
-
"import": "./dist/
|
|
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
|
-
"./
|
|
212
|
-
"types": "./dist/
|
|
213
|
-
"import": "./dist/
|
|
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
|
-
"./
|
|
248
|
-
"types": "./dist/
|
|
249
|
-
"import": "./dist/
|
|
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
|
-
"./
|
|
268
|
-
"types": "./dist/
|
|
269
|
-
"import": "./dist/
|
|
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.
|
|
286
|
-
"@wrongstack/tools": "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",
|