@drakon-systems/shieldcortex-realtime 4.12.7 → 4.12.9
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/cloud-sync.ts +24 -0
- package/index.ts +7 -13
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -2
package/cloud-sync.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// plugins/openclaw/cloud-sync.ts
|
|
2
|
+
//
|
|
3
|
+
// Network egress for SC threat events. See CHANGELOG.md v4.12.8 / v4.12.9.
|
|
4
|
+
|
|
5
|
+
type CloudSyncConfig = {
|
|
6
|
+
cloudApiKey?: string;
|
|
7
|
+
cloudBaseUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function cloudSync(threat: Record<string, unknown>, cfg: CloudSyncConfig): void {
|
|
11
|
+
if (!cfg.cloudApiKey) return;
|
|
12
|
+
const url = `${cfg.cloudBaseUrl || 'https://api.shieldcortex.ai'}/v1/threats`;
|
|
13
|
+
fetch(url, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
Authorization: `Bearer ${cfg.cloudApiKey}`,
|
|
18
|
+
},
|
|
19
|
+
body: JSON.stringify(threat),
|
|
20
|
+
signal: AbortSignal.timeout(5000),
|
|
21
|
+
}).catch(() => {
|
|
22
|
+
// Fire-and-forget — never block on cloud sync failure
|
|
23
|
+
});
|
|
24
|
+
}
|
package/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
16
16
|
import { createInterceptor, DEFAULT_CONFIG as DEFAULT_INTERCEPTOR_CONFIG } from './interceptor.js';
|
|
17
17
|
import type { InterceptorConfig, ToolCallContext } from './interceptor.js';
|
|
18
18
|
import { syncInterceptEvent } from './intercept-ingest.js';
|
|
19
|
+
import { cloudSync } from './cloud-sync.js';
|
|
19
20
|
|
|
20
21
|
// ==================== RESILIENT RUNTIME LOADER ====================
|
|
21
22
|
// Resolves runtime.mjs from multiple locations so the plugin works both
|
|
@@ -403,18 +404,9 @@ async function auditLog(entry: Record<string, unknown>) {
|
|
|
403
404
|
} catch {}
|
|
404
405
|
}
|
|
405
406
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
try {
|
|
410
|
-
await fetch(`${cfg.cloudBaseUrl || "https://api.shieldcortex.ai"}/v1/threats`, {
|
|
411
|
-
method: "POST",
|
|
412
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${cfg.cloudApiKey}` },
|
|
413
|
-
body: JSON.stringify(threat),
|
|
414
|
-
signal: AbortSignal.timeout(5000),
|
|
415
|
-
});
|
|
416
|
-
} catch {}
|
|
417
|
-
}
|
|
407
|
+
// `cloudSync` lives in ./cloud-sync.ts (no fs imports there) so the plugin
|
|
408
|
+
// security audit (OpenClaw 2026.4.24+) does not pair file-read with
|
|
409
|
+
// network-send in the same source file. See CHANGELOG.md v4.12.8.
|
|
418
410
|
|
|
419
411
|
type NoveltyEntry = {
|
|
420
412
|
hash: string;
|
|
@@ -592,7 +584,9 @@ function handleLlmInput(event: LlmInputEvent, ctx: AgentCtx): void {
|
|
|
592
584
|
preview: text.slice(0, 100), ts: new Date().toISOString(),
|
|
593
585
|
};
|
|
594
586
|
auditLog(entry);
|
|
595
|
-
|
|
587
|
+
loadConfig()
|
|
588
|
+
.then(cfg => cloudSync({ ...entry, content: text.slice(0, 200) }, cfg))
|
|
589
|
+
.catch(() => {});
|
|
596
590
|
}
|
|
597
591
|
}
|
|
598
592
|
} catch (e) {
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "shieldcortex-realtime",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.9",
|
|
4
4
|
"name": "ShieldCortex Real-time Scanner",
|
|
5
5
|
"description": "Real-time defence scanning on LLM input, memory extraction on LLM output, and active tool call interception with approval gating.",
|
|
6
6
|
"kind": null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drakon-systems/shieldcortex-realtime",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.9",
|
|
4
4
|
"description": "OpenClaw plugin for ShieldCortex real-time defence scanning and optional memory extraction.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"index.ts",
|
|
18
18
|
"interceptor.ts",
|
|
19
19
|
"intercept-ingest.ts",
|
|
20
|
+
"cloud-sync.ts",
|
|
20
21
|
"openclaw.plugin.json",
|
|
21
22
|
"README.md"
|
|
22
23
|
],
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
"pack:verify": "npm pack --dry-run"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
|
-
"shieldcortex": "^4.12.
|
|
28
|
+
"shieldcortex": "^4.12.9",
|
|
28
29
|
"openclaw": ">=2026.3.22"
|
|
29
30
|
},
|
|
30
31
|
"peerDependenciesMeta": {
|