@wrongstack/plugins 1.0.13 → 1.0.15
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 +2 -1
- package/dist/accessibility-auditor.js +1 -1
- package/dist/auto-doc.js +4 -0
- package/dist/auto-i18n-extractor.js +1 -1
- package/dist/code-metrics.js +1 -1
- package/dist/cron.js +10 -1
- package/dist/dead-code-detector.js +2 -2
- package/dist/duplicate-code-detector.js +2 -2
- package/dist/feature-flag-tracker.js +1 -1
- package/dist/git-autocommit.js +2 -1
- package/dist/index.js +204 -168
- package/dist/interface-contract-guard.js +1 -1
- package/dist/loop-breaker.js +163 -150
- package/dist/notify-hub.js +12 -3
- package/dist/refactor-suggester.js +2 -2
- package/dist/security-hotspot-scanner.js +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -699,7 +699,7 @@ once you're confident in the rewrite.
|
|
|
699
699
|
### 22 — `loop-breaker`
|
|
700
700
|
|
|
701
701
|
**Tools**: `loop_breaker_status`
|
|
702
|
-
**Hooks**: `PreToolUse`
|
|
702
|
+
**Hooks**: `PreToolUse`, `PostToolUse`, `UserPromptSubmit`
|
|
703
703
|
|
|
704
704
|
Detects repeated tool calls before they execute. It tracks exact-repeat
|
|
705
705
|
streaks and A-B-A-B oscillations, then either blocks the call or injects a
|
|
@@ -711,6 +711,7 @@ warning depending on `mode`.
|
|
|
711
711
|
"loop-breaker": {
|
|
712
712
|
"enabled": true,
|
|
713
713
|
"mode": "block", // "block" | "warn"
|
|
714
|
+
"maxSteps": 0, // unlimited; set a positive value to opt into a cap
|
|
714
715
|
"repeatThreshold": 3,
|
|
715
716
|
"oscillationThreshold": 2
|
|
716
717
|
}
|
package/dist/auto-doc.js
CHANGED
|
@@ -339,6 +339,10 @@ var plugin = {
|
|
|
339
339
|
},
|
|
340
340
|
permission: "auto",
|
|
341
341
|
mutating: true,
|
|
342
|
+
// It rewrites project source files, so it declares the same capability
|
|
343
|
+
// as the built-in writers: the agent-state write gate and capability
|
|
344
|
+
// allowlists key on `fs.write`, not on `mutating`.
|
|
345
|
+
capabilities: ["fs.write"],
|
|
342
346
|
category: "Project",
|
|
343
347
|
async execute(input) {
|
|
344
348
|
const inp = input;
|
package/dist/code-metrics.js
CHANGED
package/dist/cron.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ToolValidationError } from "@wrongstack/core/types";
|
|
3
3
|
var COORDINATION_CRON_CAPABILITY = "coordination.cron";
|
|
4
4
|
var API_VERSION = "^0.1.10";
|
|
5
|
+
var MAX_TIMER_DELAY_MS = 2147483647;
|
|
5
6
|
var state = {
|
|
6
7
|
jobs: /* @__PURE__ */ new Map(),
|
|
7
8
|
timers: /* @__PURE__ */ new Map(),
|
|
@@ -147,7 +148,9 @@ var plugin = {
|
|
|
147
148
|
name: { type: "string", description: "Unique name for this cron job" },
|
|
148
149
|
intervalMs: {
|
|
149
150
|
type: "number",
|
|
150
|
-
|
|
151
|
+
minimum: 1e3,
|
|
152
|
+
maximum: MAX_TIMER_DELAY_MS,
|
|
153
|
+
description: `Interval between runs in milliseconds (1000 to ${MAX_TIMER_DELAY_MS})`
|
|
151
154
|
},
|
|
152
155
|
action: {
|
|
153
156
|
type: "string",
|
|
@@ -179,6 +182,12 @@ var plugin = {
|
|
|
179
182
|
field: "intervalMs"
|
|
180
183
|
});
|
|
181
184
|
}
|
|
185
|
+
if (intervalMs > MAX_TIMER_DELAY_MS) {
|
|
186
|
+
throw new ToolValidationError({
|
|
187
|
+
message: `intervalMs must be <= ${MAX_TIMER_DELAY_MS} (about 24.8 days)`,
|
|
188
|
+
field: "intervalMs"
|
|
189
|
+
});
|
|
190
|
+
}
|
|
182
191
|
if (typeof action !== "string" || action.trim() === "") {
|
|
183
192
|
throw new ToolValidationError({
|
|
184
193
|
message: "action is required and must be a non-empty string",
|
|
@@ -34,7 +34,7 @@ var state = {
|
|
|
34
34
|
hookUnregister: null
|
|
35
35
|
};
|
|
36
36
|
var DEFAULTS = {
|
|
37
|
-
enabled:
|
|
37
|
+
enabled: true,
|
|
38
38
|
extensions: [".ts", ".tsx", ".js", ".jsx"],
|
|
39
39
|
defaultDepth: 3,
|
|
40
40
|
maxDepth: 10,
|
|
@@ -190,7 +190,7 @@ var plugin = {
|
|
|
190
190
|
properties: {
|
|
191
191
|
enabled: {
|
|
192
192
|
type: "boolean",
|
|
193
|
-
default:
|
|
193
|
+
default: true,
|
|
194
194
|
description: "Master switch."
|
|
195
195
|
},
|
|
196
196
|
extensions: {
|
|
@@ -53,7 +53,7 @@ var hookIndexBudgets = {
|
|
|
53
53
|
maxFileBytes: 2 * 1024 * 1024
|
|
54
54
|
};
|
|
55
55
|
var DEFAULTS = {
|
|
56
|
-
enabled:
|
|
56
|
+
enabled: true,
|
|
57
57
|
minLines: 8,
|
|
58
58
|
threshold: 0.8,
|
|
59
59
|
extensions: [".ts", ".tsx", ".js", ".jsx"],
|
|
@@ -269,7 +269,7 @@ var plugin = {
|
|
|
269
269
|
configSchema: {
|
|
270
270
|
type: "object",
|
|
271
271
|
properties: {
|
|
272
|
-
enabled: { type: "boolean", default:
|
|
272
|
+
enabled: { type: "boolean", default: true, description: "Master switch." },
|
|
273
273
|
minLines: {
|
|
274
274
|
type: "number",
|
|
275
275
|
minimum: 2,
|
package/dist/git-autocommit.js
CHANGED
|
@@ -452,8 +452,9 @@ var plugin = {
|
|
|
452
452
|
try {
|
|
453
453
|
commitScope = await stageFiles(files);
|
|
454
454
|
} catch (err) {
|
|
455
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
455
456
|
throw new Error(
|
|
456
|
-
|
|
457
|
+
detail.startsWith("Failed to stage files") ? detail : `Failed to stage files: ${detail}`,
|
|
457
458
|
{ cause: err }
|
|
458
459
|
);
|
|
459
460
|
}
|