@shomra/agent 0.3.10 → 0.3.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/discovery.mjs +11 -1
- package/package.json +1 -1
- package/shomra.mjs +6927 -6909
package/discovery.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import path from 'node:path';
|
|
|
21
21
|
import os from 'node:os';
|
|
22
22
|
import { execFileSync } from 'node:child_process';
|
|
23
23
|
import { scanAiUsage, rollupAiUsage, isAiUsageScannable, AI_USAGE_CATEGORY_LABEL } from './ai-usage.mjs';
|
|
24
|
+
import { clampAsset } from './wire-limits.mjs';
|
|
24
25
|
import { readVendorPosture, canonicalGrant } from './agent-posture.mjs';
|
|
25
26
|
|
|
26
27
|
const HOME = os.homedir();
|
|
@@ -953,11 +954,20 @@ export function discoverAll(roots = [process.cwd()], opts = {}) {
|
|
|
953
954
|
...discoverCodingAgents(scanRoots),
|
|
954
955
|
...discoverModelKeys(),
|
|
955
956
|
];
|
|
957
|
+
// ⚠ CLAMPED BEFORE DEDUP, and before anything leaves this function. A report is
|
|
958
|
+
// validated all-or-nothing, so ONE over-long field — an MCP server launched by
|
|
959
|
+
// an inline `node -e '<1675 chars>'` is the case that found this — rejects the
|
|
960
|
+
// whole payload and costs the machine its entire inventory. Clamping first also
|
|
961
|
+
// means the dedup key below is the key the backend will see, so a value that
|
|
962
|
+
// was abbreviated on the wire cannot dedup differently here than it does there.
|
|
963
|
+
// See wire-limits.mjs for why truncation carries a fingerprint.
|
|
964
|
+
const clamped = all.map(clampAsset);
|
|
965
|
+
|
|
956
966
|
// Final dedup by (type, identifier) — a runtime can be found by both dir and
|
|
957
967
|
// process; an env key can also appear in a .env file.
|
|
958
968
|
const seen = new Set();
|
|
959
969
|
const out = [];
|
|
960
|
-
for (const a of
|
|
970
|
+
for (const a of clamped) {
|
|
961
971
|
const key = `${a.type}::${a.identifier || a.name}`;
|
|
962
972
|
if (seen.has(key)) continue;
|
|
963
973
|
seen.add(key);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shomra/agent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "Shomra — adversarial assurance for AI agents, as a local-first CLI. Blocks dangerous tool-calls before they run, attacks your own guardrails to prove they hold, and gates AI artifacts in your editor and CI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|