@upx-us/shield 0.2.13-beta → 0.2.14-beta

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.

Potentially problematic release.


This version of @upx-us/shield might be problematic. Click here for more details.

package/dist/src/index.js CHANGED
@@ -134,6 +134,12 @@ async function poll() {
134
134
  }
135
135
  }
136
136
  else {
137
+ // No new entries this poll — but still commit cursors so that
138
+ // initCursorsForDir positions (set to current file sizes) are
139
+ // persisted. Without this, the next poll re-initialises cursors
140
+ // to the NEW current size and silently skips any events that
141
+ // arrived between polls.
142
+ (0, fetcher_1.commitCursors)(config, []);
137
143
  consecutiveFailures = 0;
138
144
  }
139
145
  }
@@ -49,6 +49,9 @@ const log = __importStar(require("./log"));
49
49
  const version_1 = require("./version");
50
50
  const BATCH_SIZE = 100;
51
51
  exports.REQUEST_TIMEOUT_MS = 30_000;
52
+ /** Minimum delay between consecutive batch POSTs (ms). Prevents Cloud Armor rate-limit
53
+ * from triggering during backfill bursts. 200ms ≈ 5 req/s = 300 req/min (well under 600/min limit). */
54
+ const INTER_BATCH_DELAY_MS = 200;
52
55
  function errMsg(err) {
53
56
  return err instanceof Error ? err.message : String(err);
54
57
  }
@@ -97,6 +100,9 @@ async function sendEvents(events, config) {
97
100
  }
98
101
  const results = [];
99
102
  for (let i = 0; i < events.length; i += BATCH_SIZE) {
103
+ // Throttle between batches to avoid Cloud Armor rate-limit during backfill
104
+ if (i > 0)
105
+ await new Promise(r => setTimeout(r, INTER_BATCH_DELAY_MS));
100
106
  const batch = events.slice(i, i + BATCH_SIZE);
101
107
  const batchNum = Math.floor(i / BATCH_SIZE) + 1;
102
108
  const payload = JSON.stringify({ entries: batch });
@@ -2,7 +2,7 @@
2
2
  "id": "shield",
3
3
  "name": "OpenClaw Shield",
4
4
  "description": "Real-time security monitoring — streams enriched, redacted security events to the Shield detection platform.",
5
- "version": "0.2.13-beta",
5
+ "version": "0.2.14-beta",
6
6
  "skills": [
7
7
  "./skills"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upx-us/shield",
3
- "version": "0.2.13-beta",
3
+ "version": "0.2.14-beta",
4
4
  "description": "Security monitoring plugin for OpenClaw agents — streams enriched security events to the Shield detection platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",