@shomra/agent 0.3.3 → 0.3.4

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.
Files changed (2) hide show
  1. package/discovery.mjs +35 -1
  2. package/package.json +1 -1
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 { readVendorPosture, canonicalGrant } from './agent-posture.mjs';
24
25
 
25
26
  const HOME = os.homedir();
26
27
  const APPDATA = process.env.APPDATA || path.join(HOME, 'AppData', 'Roaming');
@@ -860,12 +861,45 @@ export function discoverCodingAgents(roots = [process.cwd()]) {
860
861
  const t = readText(f, 20_000);
861
862
  return t != null && /shomra/i.test(t);
862
863
  });
864
+ // PERMISSION POSTURE — what this agent may do without asking. The user-scope
865
+ // settings read here govern every project on the machine and live in no
866
+ // repository, so this is the one surface a repo scan structurally cannot
867
+ // reach. `content` carries ONLY the canonical grant document (see
868
+ // agent-posture.mjs); the settings files themselves never leave the machine.
869
+ const posture = readVendorPosture(a.vendor, cwd);
870
+ const grant = canonicalGrant(posture);
863
871
  assets.push({
864
872
  type: 'AI_AGENT',
865
873
  name: a.name,
866
874
  identifier: `agent:${a.vendor}`,
867
875
  vendor: a.vendor,
868
- metadata: { detectedAt: installedAt, guarded: !!guardFile, guardFile: guardFile || null },
876
+ ...(grant ? { content: grant } : {}),
877
+ metadata: {
878
+ detectedAt: installedAt,
879
+ guarded: !!guardFile,
880
+ guardFile: guardFile || null,
881
+ posture: posture
882
+ ? {
883
+ tier: posture.tier,
884
+ readable: posture.readable,
885
+ claim: posture.claim,
886
+ mode: posture.mode,
887
+ allowCount: posture.allow.length,
888
+ denyCount: posture.deny.length,
889
+ askCount: posture.ask.length,
890
+ allow: posture.allow.slice(0, 25),
891
+ enableAllProjectMcpServers: posture.enableAllProjectMcpServers,
892
+ switches: posture.switches,
893
+ mcpServerCount: posture.mcpServers.length,
894
+ autoApprovedMcp: posture.autoApprovedMcp,
895
+ unreadableCount: posture.unreadableCount,
896
+ // Paths only — which files were consulted and whether each parsed.
897
+ // Needed so an operator can tell "configured safely" from "we could
898
+ // not open the file that decides it".
899
+ sources: posture.sources.map((s) => ({ path: s.path, scope: s.scope, state: s.state, reason: s.reason })),
900
+ }
901
+ : null,
902
+ },
869
903
  });
870
904
  }
871
905
  return assets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shomra/agent",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
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": {