@wrongstack/plugins 1.0.10 → 1.0.12
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/dist/index.js +18 -5
- package/dist/loop-breaker.js +11 -4
- package/dist/notify-hub.js +7 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -12488,7 +12488,10 @@ var state32 = {
|
|
|
12488
12488
|
};
|
|
12489
12489
|
var DEFAULTS30 = {
|
|
12490
12490
|
enabled: true,
|
|
12491
|
-
|
|
12491
|
+
// Documented contract (feature matrix, plugin description): warn, then
|
|
12492
|
+
// block. A warn-only default meant an agent stuck re-issuing the same call
|
|
12493
|
+
// was never actually stopped unless the user happened to set any option.
|
|
12494
|
+
mode: "block",
|
|
12492
12495
|
warnAfter: 3,
|
|
12493
12496
|
blockAfter: 5,
|
|
12494
12497
|
oscillationWindow: 8,
|
|
@@ -12514,7 +12517,7 @@ function readConfig30(raw) {
|
|
|
12514
12517
|
const ignoreTools = Array.isArray(rawIgnore) ? rawIgnore.filter((t) => typeof t === "string") : [];
|
|
12515
12518
|
ignoreToolsSet = new Set(ignoreTools);
|
|
12516
12519
|
const rawMode = typeof (r["mode"] ?? r["action"] ?? r["behavior"]) === "string" ? String(r["mode"] ?? r["action"] ?? r["behavior"]).trim().toLowerCase() : void 0;
|
|
12517
|
-
const mode = rawMode === "warn"
|
|
12520
|
+
const mode = rawMode === "warn" || rawMode === "block" ? rawMode : DEFAULTS30.mode;
|
|
12518
12521
|
const rawOsc = r["oscillationWindow"] ?? r["oscillation_window"] ?? r["window"];
|
|
12519
12522
|
const rawMaxSteps = r["maxSteps"] ?? r["max_steps"] ?? r["stepLimit"] ?? r["step_limit"];
|
|
12520
12523
|
return {
|
|
@@ -12543,7 +12546,11 @@ function sortKeys(value, depth = 0, seen = /* @__PURE__ */ new Set()) {
|
|
|
12543
12546
|
if (value === null || typeof value !== "object") return value;
|
|
12544
12547
|
if (seen.has(value)) return "[circular]";
|
|
12545
12548
|
if (depth >= CANONICALIZE_MAX_DEPTH) {
|
|
12546
|
-
|
|
12549
|
+
try {
|
|
12550
|
+
return `[deep:${JSON.stringify(value)}]`;
|
|
12551
|
+
} catch {
|
|
12552
|
+
return Array.isArray(value) ? `[array:${value.length}]` : "[deep-object]";
|
|
12553
|
+
}
|
|
12547
12554
|
}
|
|
12548
12555
|
seen.add(value);
|
|
12549
12556
|
try {
|
|
@@ -12631,7 +12638,7 @@ var plugin35 = {
|
|
|
12631
12638
|
mode: {
|
|
12632
12639
|
type: "string",
|
|
12633
12640
|
enum: ["warn", "block"],
|
|
12634
|
-
default: "
|
|
12641
|
+
default: "block",
|
|
12635
12642
|
description: "block = refuse the repeated call; warn = only inject context."
|
|
12636
12643
|
},
|
|
12637
12644
|
warnAfter: {
|
|
@@ -13884,7 +13891,13 @@ var DEFAULTS33 = {
|
|
|
13884
13891
|
maxConsecutiveFailures: 5
|
|
13885
13892
|
};
|
|
13886
13893
|
function isPrivateIPv4(hostname) {
|
|
13887
|
-
const
|
|
13894
|
+
const hexMapped = /^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i.exec(hostname);
|
|
13895
|
+
const normalised = hexMapped ? [
|
|
13896
|
+
Number.parseInt(hexMapped[1], 16) >> 8,
|
|
13897
|
+
Number.parseInt(hexMapped[1], 16) & 255,
|
|
13898
|
+
Number.parseInt(hexMapped[2], 16) >> 8,
|
|
13899
|
+
Number.parseInt(hexMapped[2], 16) & 255
|
|
13900
|
+
].join(".") : hostname.replace(/^::ffff:/i, "");
|
|
13888
13901
|
const parts = normalised.split(".").map((p) => Number(p));
|
|
13889
13902
|
if (parts.length !== 4 || parts.some((p) => !Number.isInteger(p) || p < 0 || p > 255)) {
|
|
13890
13903
|
return false;
|
package/dist/loop-breaker.js
CHANGED
|
@@ -24,7 +24,10 @@ var state = {
|
|
|
24
24
|
};
|
|
25
25
|
var DEFAULTS = {
|
|
26
26
|
enabled: true,
|
|
27
|
-
|
|
27
|
+
// Documented contract (feature matrix, plugin description): warn, then
|
|
28
|
+
// block. A warn-only default meant an agent stuck re-issuing the same call
|
|
29
|
+
// was never actually stopped unless the user happened to set any option.
|
|
30
|
+
mode: "block",
|
|
28
31
|
warnAfter: 3,
|
|
29
32
|
blockAfter: 5,
|
|
30
33
|
oscillationWindow: 8,
|
|
@@ -50,7 +53,7 @@ function readConfig(raw) {
|
|
|
50
53
|
const ignoreTools = Array.isArray(rawIgnore) ? rawIgnore.filter((t) => typeof t === "string") : [];
|
|
51
54
|
ignoreToolsSet = new Set(ignoreTools);
|
|
52
55
|
const rawMode = typeof (r["mode"] ?? r["action"] ?? r["behavior"]) === "string" ? String(r["mode"] ?? r["action"] ?? r["behavior"]).trim().toLowerCase() : void 0;
|
|
53
|
-
const mode = rawMode === "warn"
|
|
56
|
+
const mode = rawMode === "warn" || rawMode === "block" ? rawMode : DEFAULTS.mode;
|
|
54
57
|
const rawOsc = r["oscillationWindow"] ?? r["oscillation_window"] ?? r["window"];
|
|
55
58
|
const rawMaxSteps = r["maxSteps"] ?? r["max_steps"] ?? r["stepLimit"] ?? r["step_limit"];
|
|
56
59
|
return {
|
|
@@ -79,7 +82,11 @@ function sortKeys(value, depth = 0, seen = /* @__PURE__ */ new Set()) {
|
|
|
79
82
|
if (value === null || typeof value !== "object") return value;
|
|
80
83
|
if (seen.has(value)) return "[circular]";
|
|
81
84
|
if (depth >= CANONICALIZE_MAX_DEPTH) {
|
|
82
|
-
|
|
85
|
+
try {
|
|
86
|
+
return `[deep:${JSON.stringify(value)}]`;
|
|
87
|
+
} catch {
|
|
88
|
+
return Array.isArray(value) ? `[array:${value.length}]` : "[deep-object]";
|
|
89
|
+
}
|
|
83
90
|
}
|
|
84
91
|
seen.add(value);
|
|
85
92
|
try {
|
|
@@ -167,7 +174,7 @@ var plugin = {
|
|
|
167
174
|
mode: {
|
|
168
175
|
type: "string",
|
|
169
176
|
enum: ["warn", "block"],
|
|
170
|
-
default: "
|
|
177
|
+
default: "block",
|
|
171
178
|
description: "block = refuse the repeated call; warn = only inject context."
|
|
172
179
|
},
|
|
173
180
|
warnAfter: {
|
package/dist/notify-hub.js
CHANGED
|
@@ -182,7 +182,13 @@ var DEFAULTS = {
|
|
|
182
182
|
maxConsecutiveFailures: 5
|
|
183
183
|
};
|
|
184
184
|
function isPrivateIPv4(hostname) {
|
|
185
|
-
const
|
|
185
|
+
const hexMapped = /^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i.exec(hostname);
|
|
186
|
+
const normalised = hexMapped ? [
|
|
187
|
+
Number.parseInt(hexMapped[1], 16) >> 8,
|
|
188
|
+
Number.parseInt(hexMapped[1], 16) & 255,
|
|
189
|
+
Number.parseInt(hexMapped[2], 16) >> 8,
|
|
190
|
+
Number.parseInt(hexMapped[2], 16) & 255
|
|
191
|
+
].join(".") : hostname.replace(/^::ffff:/i, "");
|
|
186
192
|
const parts = normalised.split(".").map((p) => Number(p));
|
|
187
193
|
if (parts.length !== 4 || parts.some((p) => !Number.isInteger(p) || p < 0 || p > 255)) {
|
|
188
194
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/plugins",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
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Ü",
|
|
@@ -303,10 +303,10 @@
|
|
|
303
303
|
"vitest": "^5.0.0"
|
|
304
304
|
},
|
|
305
305
|
"dependencies": {
|
|
306
|
-
"@wrongstack/core": "1.0.
|
|
307
|
-
"@wrongstack/plugin-sdk": "1.0.
|
|
308
|
-
"@wrongstack/primitives": "1.0.
|
|
309
|
-
"@wrongstack/tools": "1.0.
|
|
306
|
+
"@wrongstack/core": "1.0.12",
|
|
307
|
+
"@wrongstack/plugin-sdk": "1.0.12",
|
|
308
|
+
"@wrongstack/primitives": "1.0.12",
|
|
309
|
+
"@wrongstack/tools": "1.0.12"
|
|
310
310
|
},
|
|
311
311
|
"scripts": {
|
|
312
312
|
"build": "node ../../scripts/build-package.mjs",
|