@wrongstack/plugins 1.0.14 → 1.0.16

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.
@@ -33,7 +33,7 @@ var state = {
33
33
  hookUnregister: null
34
34
  };
35
35
  var DEFAULTS = {
36
- enabled: false,
36
+ enabled: true,
37
37
  includeExtensions: [".tsx", ".jsx", ".html", ".vue"],
38
38
  maxFindings: 50,
39
39
  severity: "warn",
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;
@@ -33,7 +33,7 @@ var state = {
33
33
  lastResult: null
34
34
  };
35
35
  var DEFAULTS = {
36
- enabled: false,
36
+ enabled: true,
37
37
  fileExtensions: [".tsx", ".jsx", ".vue"],
38
38
  minLength: 2,
39
39
  maxContextStrings: 10,
@@ -32,7 +32,7 @@ var state = {
32
32
  hookUnregister: null
33
33
  };
34
34
  var DEFAULTS = {
35
- enabled: false,
35
+ enabled: true,
36
36
  extensions: [".ts", ".tsx", ".js", ".jsx"],
37
37
  maxFiles: 50
38
38
  };
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
- description: "Interval between runs in milliseconds (minimum 1000)"
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: false,
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: false,
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: false,
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: false, description: "Master switch." },
272
+ enabled: { type: "boolean", default: true, description: "Master switch." },
273
273
  minLines: {
274
274
  type: "number",
275
275
  minimum: 2,
@@ -39,7 +39,7 @@ var DEFAULT_PATTERNS = [
39
39
  String.raw`flags(?:\.|\?\.)([A-Za-z_$][A-Za-z0-9_$]*)`
40
40
  ];
41
41
  var DEFAULTS = {
42
- enabled: false,
42
+ enabled: true,
43
43
  extensions: [".ts", ".tsx", ".js", ".jsx"],
44
44
  patterns: [],
45
45
  maxFindings: 50
@@ -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
- `Failed to stage files: ${err instanceof Error ? err.message : String(err)}`,
457
+ detail.startsWith("Failed to stage files") ? detail : `Failed to stage files: ${detail}`,
457
458
  { cause: err }
458
459
  );
459
460
  }
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var state = {
33
33
  hookUnregister: null
34
34
  };
35
35
  var DEFAULTS = {
36
- enabled: false,
36
+ enabled: true,
37
37
  includeExtensions: [".tsx", ".jsx", ".html", ".vue"],
38
38
  maxFindings: 50,
39
39
  severity: "warn",
@@ -1522,6 +1522,10 @@ var plugin4 = {
1522
1522
  },
1523
1523
  permission: "auto",
1524
1524
  mutating: true,
1525
+ // It rewrites project source files, so it declares the same capability
1526
+ // as the built-in writers: the agent-state write gate and capability
1527
+ // allowlists key on `fs.write`, not on `mutating`.
1528
+ capabilities: ["fs.write"],
1525
1529
  category: "Project",
1526
1530
  async execute(input) {
1527
1531
  const inp = input;
@@ -1773,7 +1777,7 @@ var state6 = {
1773
1777
  lastResult: null
1774
1778
  };
1775
1779
  var DEFAULTS5 = {
1776
- enabled: false,
1780
+ enabled: true,
1777
1781
  fileExtensions: [".tsx", ".jsx", ".vue"],
1778
1782
  minLength: 2,
1779
1783
  maxContextStrings: 10,
@@ -3317,7 +3321,7 @@ var state10 = {
3317
3321
  hookUnregister: null
3318
3322
  };
3319
3323
  var DEFAULTS9 = {
3320
- enabled: false,
3324
+ enabled: true,
3321
3325
  extensions: [".ts", ".tsx", ".js", ".jsx"],
3322
3326
  maxFiles: 50
3323
3327
  };
@@ -5088,6 +5092,7 @@ var cost_tracker_default = plugin14;
5088
5092
  import { ToolValidationError as ToolValidationError8 } from "@wrongstack/core/types";
5089
5093
  var COORDINATION_CRON_CAPABILITY = "coordination.cron";
5090
5094
  var API_VERSION9 = "^0.1.10";
5095
+ var MAX_TIMER_DELAY_MS = 2147483647;
5091
5096
  var state14 = {
5092
5097
  jobs: /* @__PURE__ */ new Map(),
5093
5098
  timers: /* @__PURE__ */ new Map(),
@@ -5233,7 +5238,9 @@ var plugin15 = {
5233
5238
  name: { type: "string", description: "Unique name for this cron job" },
5234
5239
  intervalMs: {
5235
5240
  type: "number",
5236
- description: "Interval between runs in milliseconds (minimum 1000)"
5241
+ minimum: 1e3,
5242
+ maximum: MAX_TIMER_DELAY_MS,
5243
+ description: `Interval between runs in milliseconds (1000 to ${MAX_TIMER_DELAY_MS})`
5237
5244
  },
5238
5245
  action: {
5239
5246
  type: "string",
@@ -5265,6 +5272,12 @@ var plugin15 = {
5265
5272
  field: "intervalMs"
5266
5273
  });
5267
5274
  }
5275
+ if (intervalMs > MAX_TIMER_DELAY_MS) {
5276
+ throw new ToolValidationError8({
5277
+ message: `intervalMs must be <= ${MAX_TIMER_DELAY_MS} (about 24.8 days)`,
5278
+ field: "intervalMs"
5279
+ });
5280
+ }
5268
5281
  if (typeof action !== "string" || action.trim() === "") {
5269
5282
  throw new ToolValidationError8({
5270
5283
  message: "action is required and must be a non-empty string",
@@ -5390,7 +5403,7 @@ var state15 = {
5390
5403
  hookUnregister: null
5391
5404
  };
5392
5405
  var DEFAULTS13 = {
5393
- enabled: false,
5406
+ enabled: true,
5394
5407
  extensions: [".ts", ".tsx", ".js", ".jsx"],
5395
5408
  defaultDepth: 3,
5396
5409
  maxDepth: 10,
@@ -5546,7 +5559,7 @@ var plugin16 = {
5546
5559
  properties: {
5547
5560
  enabled: {
5548
5561
  type: "boolean",
5549
- default: false,
5562
+ default: true,
5550
5563
  description: "Master switch."
5551
5564
  },
5552
5565
  extensions: {
@@ -7103,7 +7116,7 @@ var hookIndexBudgets = {
7103
7116
  maxFileBytes: 2 * 1024 * 1024
7104
7117
  };
7105
7118
  var DEFAULTS18 = {
7106
- enabled: false,
7119
+ enabled: true,
7107
7120
  minLines: 8,
7108
7121
  threshold: 0.8,
7109
7122
  extensions: [".ts", ".tsx", ".js", ".jsx"],
@@ -7319,7 +7332,7 @@ var plugin21 = {
7319
7332
  configSchema: {
7320
7333
  type: "object",
7321
7334
  properties: {
7322
- enabled: { type: "boolean", default: false, description: "Master switch." },
7335
+ enabled: { type: "boolean", default: true, description: "Master switch." },
7323
7336
  minLines: {
7324
7337
  type: "number",
7325
7338
  minimum: 2,
@@ -7915,7 +7928,7 @@ var DEFAULT_PATTERNS2 = [
7915
7928
  String.raw`flags(?:\.|\?\.)([A-Za-z_$][A-Za-z0-9_$]*)`
7916
7929
  ];
7917
7930
  var DEFAULTS20 = {
7918
- enabled: false,
7931
+ enabled: true,
7919
7932
  extensions: [".ts", ".tsx", ".js", ".jsx"],
7920
7933
  patterns: [],
7921
7934
  maxFindings: 50
@@ -9430,8 +9443,9 @@ var plugin26 = {
9430
9443
  try {
9431
9444
  commitScope = await stageFiles(files);
9432
9445
  } catch (err) {
9446
+ const detail = err instanceof Error ? err.message : String(err);
9433
9447
  throw new Error(
9434
- `Failed to stage files: ${err instanceof Error ? err.message : String(err)}`,
9448
+ detail.startsWith("Failed to stage files") ? detail : `Failed to stage files: ${detail}`,
9435
9449
  { cause: err }
9436
9450
  );
9437
9451
  }
@@ -10747,7 +10761,7 @@ var state27 = {
10747
10761
  hookUnregister: null
10748
10762
  };
10749
10763
  var DEFAULTS25 = {
10750
- enabled: false,
10764
+ enabled: true,
10751
10765
  extensions: [".ts", ".tsx"],
10752
10766
  maxFindings: 50,
10753
10767
  maxFiles: 2e3
@@ -13892,7 +13906,8 @@ var state35 = {
13892
13906
  lastDelivery: null,
13893
13907
  stopHookUnregister: null,
13894
13908
  eventUnsubscribers: [],
13895
- circuitWarned: false
13909
+ circuitWarned: false,
13910
+ disabledReason: null
13896
13911
  };
13897
13912
  var KNOWN_EVENTS = ["session.stop", "tool.error", "budget.threshold"];
13898
13913
  var DEFAULTS33 = {
@@ -14075,13 +14090,21 @@ var plugin38 = {
14075
14090
  }
14076
14091
  }
14077
14092
  state35.eventUnsubscribers = [];
14078
- const cfg = readConfig33(api.config.extensions?.["notify-hub"]);
14093
+ state35.disabledReason = null;
14094
+ const rawCfg = api.config.extensions?.["notify-hub"];
14095
+ const cfg = readConfig33(rawCfg);
14079
14096
  let active = cfg.enabled && cfg.webhookUrl.length > 0;
14097
+ const rawUrl = rawCfg?.["webhookUrl"] ?? rawCfg?.["webhook_url"] ?? rawCfg?.["url"];
14098
+ if (cfg.enabled && typeof rawUrl === "string" && rawUrl.trim() && !cfg.webhookUrl) {
14099
+ state35.disabledReason = "webhookUrl was refused: it must be an http(s) URL without credentials that does not target localhost or a private address";
14100
+ api.log.warn(`notify-hub: ${state35.disabledReason}`);
14101
+ }
14080
14102
  if (active) {
14081
14103
  try {
14082
14104
  const url = new URL(cfg.webhookUrl);
14083
14105
  const hostnameBlocked = await hasPrivateResolvedIP(url.hostname);
14084
14106
  if (hostnameBlocked) {
14107
+ state35.disabledReason = `webhookUrl was refused: ${url.hostname} resolves to a private/local IP`;
14085
14108
  api.log.warn(
14086
14109
  `notify-hub: webhook URL resolves to a private/local IP (${url.hostname}) \u2014 disabling plugin`
14087
14110
  );
@@ -14154,7 +14177,7 @@ var plugin38 = {
14154
14177
  const ch = state35.channel;
14155
14178
  if (!ch) {
14156
14179
  throw new Error(
14157
- 'no webhookUrl configured \u2014 set config.extensions["notify-hub"].webhookUrl to enable deliveries'
14180
+ state35.disabledReason ?? 'no webhookUrl configured \u2014 set config.extensions["notify-hub"].webhookUrl to enable deliveries'
14158
14181
  );
14159
14182
  }
14160
14183
  const inp = input ?? {};
@@ -17414,7 +17437,7 @@ var state41 = {
17414
17437
  lastHookWarning: new runtime_exports.BoundedMap({ max: 512, ttlMs: HOOK_WARNING_COOLDOWN_MS2 })
17415
17438
  };
17416
17439
  var DEFAULTS38 = {
17417
- enabled: false,
17440
+ enabled: true,
17418
17441
  extensions: [".ts", ".tsx", ".js", ".jsx"],
17419
17442
  maxSuggestions: 5,
17420
17443
  rules: { longFunctionLines: 50, maxParams: 5, maxNesting: 3 }
@@ -17605,7 +17628,7 @@ var plugin44 = {
17605
17628
  configSchema: {
17606
17629
  type: "object",
17607
17630
  properties: {
17608
- enabled: { type: "boolean", default: false, description: "Master switch." },
17631
+ enabled: { type: "boolean", default: true, description: "Master switch." },
17609
17632
  extensions: {
17610
17633
  type: "array",
17611
17634
  items: { type: "string" },
@@ -19020,7 +19043,7 @@ var state44 = {
19020
19043
  hookUnregister: null
19021
19044
  };
19022
19045
  var DEFAULTS42 = {
19023
- enabled: false,
19046
+ enabled: true,
19024
19047
  severity: "warn",
19025
19048
  maxFindings: 10,
19026
19049
  scanOnChange: [
@@ -19211,7 +19234,7 @@ var plugin48 = {
19211
19234
  configSchema: {
19212
19235
  type: "object",
19213
19236
  properties: {
19214
- enabled: { type: "boolean", default: false, description: "Master switch." },
19237
+ enabled: { type: "boolean", default: true, description: "Master switch." },
19215
19238
  severity: {
19216
19239
  type: "string",
19217
19240
  enum: ["warn", "block"],
@@ -33,7 +33,7 @@ var state = {
33
33
  hookUnregister: null
34
34
  };
35
35
  var DEFAULTS = {
36
- enabled: false,
36
+ enabled: true,
37
37
  extensions: [".ts", ".tsx"],
38
38
  maxFindings: 50,
39
39
  maxFiles: 2e3
@@ -170,7 +170,8 @@ var state = {
170
170
  lastDelivery: null,
171
171
  stopHookUnregister: null,
172
172
  eventUnsubscribers: [],
173
- circuitWarned: false
173
+ circuitWarned: false,
174
+ disabledReason: null
174
175
  };
175
176
  var KNOWN_EVENTS = ["session.stop", "tool.error", "budget.threshold"];
176
177
  var DEFAULTS = {
@@ -353,13 +354,21 @@ var plugin = {
353
354
  }
354
355
  }
355
356
  state.eventUnsubscribers = [];
356
- const cfg = readConfig(api.config.extensions?.["notify-hub"]);
357
+ state.disabledReason = null;
358
+ const rawCfg = api.config.extensions?.["notify-hub"];
359
+ const cfg = readConfig(rawCfg);
357
360
  let active = cfg.enabled && cfg.webhookUrl.length > 0;
361
+ const rawUrl = rawCfg?.["webhookUrl"] ?? rawCfg?.["webhook_url"] ?? rawCfg?.["url"];
362
+ if (cfg.enabled && typeof rawUrl === "string" && rawUrl.trim() && !cfg.webhookUrl) {
363
+ state.disabledReason = "webhookUrl was refused: it must be an http(s) URL without credentials that does not target localhost or a private address";
364
+ api.log.warn(`notify-hub: ${state.disabledReason}`);
365
+ }
358
366
  if (active) {
359
367
  try {
360
368
  const url = new URL(cfg.webhookUrl);
361
369
  const hostnameBlocked = await hasPrivateResolvedIP(url.hostname);
362
370
  if (hostnameBlocked) {
371
+ state.disabledReason = `webhookUrl was refused: ${url.hostname} resolves to a private/local IP`;
363
372
  api.log.warn(
364
373
  `notify-hub: webhook URL resolves to a private/local IP (${url.hostname}) \u2014 disabling plugin`
365
374
  );
@@ -432,7 +441,7 @@ var plugin = {
432
441
  const ch = state.channel;
433
442
  if (!ch) {
434
443
  throw new Error(
435
- 'no webhookUrl configured \u2014 set config.extensions["notify-hub"].webhookUrl to enable deliveries'
444
+ state.disabledReason ?? 'no webhookUrl configured \u2014 set config.extensions["notify-hub"].webhookUrl to enable deliveries'
436
445
  );
437
446
  }
438
447
  const inp = input ?? {};
@@ -35,7 +35,7 @@ var state = {
35
35
  lastHookWarning: new runtime_exports.BoundedMap({ max: 512, ttlMs: HOOK_WARNING_COOLDOWN_MS })
36
36
  };
37
37
  var DEFAULTS = {
38
- enabled: false,
38
+ enabled: true,
39
39
  extensions: [".ts", ".tsx", ".js", ".jsx"],
40
40
  maxSuggestions: 5,
41
41
  rules: { longFunctionLines: 50, maxParams: 5, maxNesting: 3 }
@@ -226,7 +226,7 @@ var plugin = {
226
226
  configSchema: {
227
227
  type: "object",
228
228
  properties: {
229
- enabled: { type: "boolean", default: false, description: "Master switch." },
229
+ enabled: { type: "boolean", default: true, description: "Master switch." },
230
230
  extensions: {
231
231
  type: "array",
232
232
  items: { type: "string" },
@@ -36,7 +36,7 @@ var state = {
36
36
  hookUnregister: null
37
37
  };
38
38
  var DEFAULTS = {
39
- enabled: false,
39
+ enabled: true,
40
40
  severity: "warn",
41
41
  maxFindings: 10,
42
42
  scanOnChange: [
@@ -227,7 +227,7 @@ var plugin = {
227
227
  configSchema: {
228
228
  type: "object",
229
229
  properties: {
230
- enabled: { type: "boolean", default: false, description: "Master switch." },
230
+ enabled: { type: "boolean", default: true, description: "Master switch." },
231
231
  severity: {
232
232
  type: "string",
233
233
  enum: ["warn", "block"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/plugins",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
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.14",
307
- "@wrongstack/plugin-sdk": "1.0.14",
308
- "@wrongstack/primitives": "1.0.14",
309
- "@wrongstack/tools": "1.0.14"
306
+ "@wrongstack/core": "1.0.16",
307
+ "@wrongstack/plugin-sdk": "1.0.16",
308
+ "@wrongstack/primitives": "1.0.16",
309
+ "@wrongstack/tools": "1.0.16"
310
310
  },
311
311
  "scripts": {
312
312
  "build": "node ../../scripts/build-package.mjs",