@agent-beam/beam 0.2.34 → 0.2.36

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 (46) hide show
  1. package/README.md +29 -4
  2. package/Skills/agentbeam-app-monitoring/SKILL.md +4 -1
  3. package/dist/auto-update.d.ts +6 -0
  4. package/dist/auto-update.js +1 -1
  5. package/dist/auto-update.js.map +1 -1
  6. package/dist/cli.js +44 -4
  7. package/dist/cli.js.map +1 -1
  8. package/dist/forward.js +2 -1
  9. package/dist/forward.js.map +1 -1
  10. package/dist/monitor-client.d.ts +47 -0
  11. package/dist/monitor-client.js +24 -0
  12. package/dist/monitor-client.js.map +1 -1
  13. package/dist/monitor-config.d.ts +4 -1
  14. package/dist/monitor-config.js +25 -3
  15. package/dist/monitor-config.js.map +1 -1
  16. package/dist/monitor-deny.d.ts +35 -0
  17. package/dist/monitor-deny.js +141 -0
  18. package/dist/monitor-deny.js.map +1 -0
  19. package/dist/monitor-pause.d.ts +171 -0
  20. package/dist/monitor-pause.js +510 -0
  21. package/dist/monitor-pause.js.map +1 -0
  22. package/dist/monitor-pipeline.d.ts +6 -0
  23. package/dist/monitor-pipeline.js +10 -0
  24. package/dist/monitor-pipeline.js.map +1 -1
  25. package/dist/monitor-rules.d.ts +11 -0
  26. package/dist/monitor-rules.js +29 -0
  27. package/dist/monitor-rules.js.map +1 -1
  28. package/dist/monitor.d.ts +28 -0
  29. package/dist/monitor.js +223 -12
  30. package/dist/monitor.js.map +1 -1
  31. package/dist/remote-update.d.ts +17 -0
  32. package/dist/remote-update.js +58 -0
  33. package/dist/remote-update.js.map +1 -0
  34. package/dist/sdk.d.ts +47 -2
  35. package/dist/sdk.js +194 -34
  36. package/dist/sdk.js.map +1 -1
  37. package/dist/serve.js +17 -1
  38. package/dist/serve.js.map +1 -1
  39. package/dist/skill-remote.d.ts +13 -0
  40. package/dist/skill-remote.js +145 -0
  41. package/dist/skill-remote.js.map +1 -0
  42. package/dist/version.d.ts +4 -0
  43. package/dist/version.js +17 -0
  44. package/dist/version.js.map +1 -0
  45. package/package.json +1 -1
  46. package/stress-report.json +48 -48
@@ -0,0 +1,145 @@
1
+ import { lstat, open, readdir, realpath, rm, unlink } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join, sep } from "node:path";
4
+ import { redact } from "./core.js";
5
+ import { readIdentity } from "./enroll.js";
6
+ import { agentSkillRoots, indexSkills, readInventory } from "./skill-inventory.js";
7
+ import { syncSkillInventory } from "./skill-sync.js";
8
+ import { versionHeaders } from "./version.js";
9
+ // What an administrator can ask this device to do with a skill from the dashboard: delete it, or
10
+ // send its SKILL.md once. Both are polled from the workspace (GET /v1/skills/actions), named by the
11
+ // skill's id from this machine's own inventory -- the workspace never supplies a path, so a request
12
+ // can only reach a skill beam already found here. Turn it off with BEAM_SKILL_REMOTE_ACTIONS=0.
13
+ export const MAX_FILE_BYTES = 64 * 1024;
14
+ export const remoteActionsEnabled = (env = process.env) => !["0", "false", "off", "no"].includes(String(env.BEAM_SKILL_REMOTE_ACTIONS ?? "").trim().toLowerCase());
15
+ async function skillFile(dir) {
16
+ try {
17
+ const name = (await readdir(dir)).find(entry => entry.toLowerCase() === "skill.md");
18
+ return name ? join(dir, name) : null;
19
+ }
20
+ catch {
21
+ return null;
22
+ }
23
+ }
24
+ // A skill folder is only deleted when it is clearly one: it holds a SKILL.md, sits inside the home
25
+ // folder or a place beam searched, and is not one of those places itself. A symlinked skill (a
26
+ // linked package) loses the link, never the folder it points to.
27
+ async function removeSkillDir(skill, roots, home) {
28
+ const dir = skill.dir;
29
+ const inside = [home, ...roots].some(root => dir.startsWith(root + sep));
30
+ if (!inside || [home, ...roots].includes(dir))
31
+ return "outside the places beam searched";
32
+ let info;
33
+ try {
34
+ info = await lstat(dir);
35
+ }
36
+ catch {
37
+ return null;
38
+ } // already gone
39
+ if (!await skillFile(dir))
40
+ return "no SKILL.md in that folder";
41
+ if (info.isSymbolicLink()) {
42
+ await unlink(dir);
43
+ return null;
44
+ }
45
+ // Compare real paths on both sides (macOS temp and home folders are reached through symlinks).
46
+ const real = await realpath(dir);
47
+ const realRoots = await Promise.all([home, ...roots].map(root => realpath(root).catch(() => root)));
48
+ if (!realRoots.some(root => real.startsWith(root + sep)))
49
+ return "resolves outside the places beam searched";
50
+ await rm(dir, { recursive: true, force: true });
51
+ return null;
52
+ }
53
+ async function readSkillText(dir) {
54
+ const file = await skillFile(dir);
55
+ if (!file)
56
+ return null;
57
+ const handle = await open(file, "r");
58
+ try {
59
+ const buffer = Buffer.alloc(MAX_FILE_BYTES + 1);
60
+ const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
61
+ const truncated = bytesRead > MAX_FILE_BYTES;
62
+ return { content: redact(buffer.subarray(0, Math.min(bytesRead, MAX_FILE_BYTES)).toString("utf8")), truncated };
63
+ }
64
+ finally {
65
+ await handle.close();
66
+ }
67
+ }
68
+ export async function runSkillActions(options = {}) {
69
+ if (!remoteActionsEnabled())
70
+ return null;
71
+ const identity = await readIdentity();
72
+ if (!identity)
73
+ return null;
74
+ const headers = { "Content-Type": "application/json", Authorization: `Bearer ${identity.deviceSecret}`, ...versionHeaders() };
75
+ let actions;
76
+ try {
77
+ const response = await fetch(`${identity.apiBase}/v1/skills/actions`, { headers, signal: AbortSignal.timeout(8000) });
78
+ if (!response.ok)
79
+ return null; // an older collector has no such route
80
+ actions = await response.json();
81
+ }
82
+ catch {
83
+ return null;
84
+ }
85
+ const remove = actions.remove ?? [];
86
+ const read = actions.read ?? [];
87
+ if (!remove.length && !read.length)
88
+ return null;
89
+ const home = options.home ?? homedir();
90
+ const inventory = await readInventory();
91
+ const byId = new Map((inventory?.skills ?? []).map(s => [s.id, s]));
92
+ const result = { removed: [], sent: [], skipped: [] };
93
+ for (const { id } of read) {
94
+ const skill = byId.get(id);
95
+ if (!skill) {
96
+ result.skipped.push({ id, reason: "not in this device's inventory" });
97
+ continue;
98
+ }
99
+ try {
100
+ const text = await readSkillText(skill.dir);
101
+ if (!text) {
102
+ result.skipped.push({ id, reason: "SKILL.md not found" });
103
+ continue;
104
+ }
105
+ const response = await fetch(`${identity.apiBase}/v1/skills/content`, { method: "POST", headers, body: JSON.stringify({ id, hash: skill.hash, ...text }), signal: AbortSignal.timeout(15_000) });
106
+ if (response.ok)
107
+ result.sent.push(id);
108
+ else
109
+ result.skipped.push({ id, reason: `workspace responded with HTTP ${response.status}` });
110
+ }
111
+ catch (error) {
112
+ result.skipped.push({ id, reason: error instanceof Error ? error.message : String(error) });
113
+ }
114
+ }
115
+ if (remove.length) {
116
+ const roots = [...(inventory?.roots ?? []), ...await agentSkillRoots(home)];
117
+ const parents = new Set();
118
+ for (const { id } of remove) {
119
+ const skill = byId.get(id);
120
+ if (!skill) {
121
+ result.skipped.push({ id, reason: "not in this device's inventory" });
122
+ continue;
123
+ }
124
+ try {
125
+ const refused = await removeSkillDir(skill, roots, home);
126
+ if (refused)
127
+ result.skipped.push({ id, reason: refused });
128
+ else {
129
+ result.removed.push(skill.dir);
130
+ parents.add(dirname(skill.dir));
131
+ }
132
+ }
133
+ catch (error) {
134
+ result.skipped.push({ id, reason: error instanceof Error ? error.message : String(error) });
135
+ }
136
+ }
137
+ if (result.removed.length) {
138
+ // Re-index where the skills were, then report: the workspace drops them from its list.
139
+ await indexSkills({ roots: [...parents] }, home).catch(() => { });
140
+ await syncSkillInventory({ force: true, home }).catch(() => { });
141
+ }
142
+ }
143
+ return result;
144
+ }
145
+ //# sourceMappingURL=skill-remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-remote.js","sourceRoot":"","sources":["../src/skill-remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,E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,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** This install's version, from its own package.json. */
2
+ export declare function beamVersion(): string;
3
+ /** Header the workspace reads to show which beam version each device runs. */
4
+ export declare const versionHeaders: () => Record<string, string>;
@@ -0,0 +1,17 @@
1
+ import { readFileSync } from "node:fs";
2
+ let cached;
3
+ /** This install's version, from its own package.json. */
4
+ export function beamVersion() {
5
+ if (cached)
6
+ return cached;
7
+ try {
8
+ cached = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
9
+ }
10
+ catch {
11
+ cached = "0.0.0";
12
+ }
13
+ return cached;
14
+ }
15
+ /** Header the workspace reads to show which beam version each device runs. */
16
+ export const versionHeaders = () => ({ "X-Beam-Version": beamVersion() });
17
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,IAAI,MAA0B,CAAC;AAC/B,yDAAyD;AACzD,MAAM,UAAU,WAAW;IACzB,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,IAAI,CAAC;QAAC,MAAM,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,MAAM,GAAG,OAAO,CAAC;IAAC,CAAC;IAC5J,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,GAA2B,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-beam/beam",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "Local-first observation and heuristic risk scanning for AI coding agents (Claude Code, Codex, Cursor, Copilot CLI, Gemini). Redacts secrets, flags risky tool calls, scans skills and MCP configs offline.",
5
5
  "keywords": [
6
6
  "ai agent security",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "package": "@agent-beam/beam",
4
- "version": "0.2.34",
5
- "generatedAt": "2026-10-25T05:18:04.565Z",
4
+ "version": "0.2.36",
5
+ "generatedAt": "2026-10-26T07:30:03.864Z",
6
6
  "passed": true,
7
7
  "environment": {
8
8
  "node": "v25.5.0",
@@ -16,30 +16,30 @@
16
16
  "id": "hostile-input",
17
17
  "title": "Hostile input",
18
18
  "passed": true,
19
- "summary": "41 attack shapes at 16 KB; the slowest took 9 ms (curl|)",
19
+ "summary": "41 attack shapes at 16 KB; the slowest took 6.13 ms (unicode tags)",
20
20
  "measured": {
21
- "worstMs": 9,
21
+ "worstMs": 6.13,
22
22
  "cases": 41,
23
23
  "slowest": [
24
24
  {
25
- "input": "curl|",
26
- "ms": 9
25
+ "input": "unicode tags",
26
+ "ms": 6.13
27
27
  },
28
28
  {
29
- "input": "unicode tags",
30
- "ms": 8.59
29
+ "input": "curl|",
30
+ "ms": 5.9
31
31
  },
32
32
  {
33
33
  "input": "![a](https://e/?",
34
- "ms": 4.27
34
+ "ms": 2.91
35
35
  },
36
36
  {
37
37
  "input": "nc ",
38
- "ms": 3.99
38
+ "ms": 2.87
39
39
  },
40
40
  {
41
41
  "input": "<img ",
42
- "ms": 3.09
42
+ "ms": 2.11
43
43
  }
44
44
  ]
45
45
  },
@@ -49,30 +49,30 @@
49
49
  "id": "package-scan",
50
50
  "title": "Package scanning, hostile files",
51
51
  "passed": true,
52
- "summary": "17 attack shapes at 3 MB; the slowest took 255.3 ms (ngrok)",
52
+ "summary": "17 attack shapes at 3 MB; the slowest took 135.7 ms (curl )",
53
53
  "measured": {
54
- "worstMs": 255.3,
54
+ "worstMs": 135.7,
55
55
  "cases": 17,
56
56
  "slowest": [
57
57
  {
58
- "input": "ngrok",
59
- "ms": 255.3
58
+ "input": "curl ",
59
+ "ms": 135.7
60
60
  },
61
61
  {
62
- "input": "webhook",
63
- "ms": 231.6
62
+ "input": "short lines",
63
+ "ms": 108.2
64
64
  },
65
65
  {
66
- "input": "telegram",
67
- "ms": 230
66
+ "input": "ngrok",
67
+ "ms": 76.2
68
68
  },
69
69
  {
70
- "input": "curl ",
71
- "ms": 202.5
70
+ "input": "webhook",
71
+ "ms": 60.2
72
72
  },
73
73
  {
74
- "input": "short lines",
75
- "ms": 162.1
74
+ "input": "one long line",
75
+ "ms": 55
76
76
  }
77
77
  ]
78
78
  },
@@ -82,9 +82,9 @@
82
82
  "id": "throughput",
83
83
  "title": "Log throughput",
84
84
  "passed": true,
85
- "summary": "37,401 log lines per second on one core, attacks included",
85
+ "summary": "51,631 log lines per second on one core, attacks included",
86
86
  "measured": {
87
- "linesPerSecond": 37401,
87
+ "linesPerSecond": 51631,
88
88
  "lines": 300000
89
89
  },
90
90
  "limit": "over 10,000 lines per second"
@@ -93,11 +93,11 @@
93
93
  "id": "per-call",
94
94
  "title": "Cost per call in your app",
95
95
  "passed": true,
96
- "summary": "request() 26 µs (33.1 µs with full headers and Cloudflare's bot fields), prompt() 12.9 µs on a short message",
96
+ "summary": "request() 19.9 µs (27.3 µs with full headers and Cloudflare's bot fields), prompt() 10 µs on a short message",
97
97
  "measured": {
98
- "requestMicros": 26,
99
- "requestWithHeadersMicros": 33.1,
100
- "promptMicros": 12.9
98
+ "requestMicros": 19.9,
99
+ "requestWithHeadersMicros": 27.3,
100
+ "promptMicros": 10
101
101
  },
102
102
  "limit": "request() under 100 µs and prompt() under 200 µs"
103
103
  },
@@ -105,17 +105,17 @@
105
105
  "id": "memory-cli",
106
106
  "title": "Memory under load (beam monitor)",
107
107
  "passed": true,
108
- "summary": "9.8 MB at start; 13, 13.2, 13.1, 12.2, 12.2, 11.7 MB after each 500,000 lines; -1.5 MB from 1M to 3M lines",
108
+ "summary": "9.9 MB at start; 13.2, 13.4, 13.3, 12.3, 11.9, 11.9 MB after each 500,000 lines; -1.5 MB from 1M to 3M lines",
109
109
  "measured": {
110
110
  "heapMb": [
111
- 13,
112
111
  13.2,
113
- 13.1,
114
- 12.2,
115
- 12.2,
116
- 11.7
112
+ 13.4,
113
+ 13.3,
114
+ 12.3,
115
+ 11.9,
116
+ 11.9
117
117
  ],
118
- "startMb": 9.8,
118
+ "startMb": 9.9,
119
119
  "growthMb": -1.5,
120
120
  "footprint": {
121
121
  "seen": 200,
@@ -138,13 +138,13 @@
138
138
  "id": "memory-sdk",
139
139
  "title": "Memory in your app while AgentBeam is down",
140
140
  "passed": true,
141
- "summary": "8.4, 8.4, 8.4, 8.4 MB after each 250,000 requests and prompts",
141
+ "summary": "8.6, 8.6, 8.6, 8.6 MB after each 250,000 requests and prompts",
142
142
  "measured": {
143
143
  "heapMb": [
144
- 8.4,
145
- 8.4,
146
- 8.4,
147
- 8.4
144
+ 8.6,
145
+ 8.6,
146
+ 8.6,
147
+ 8.6
148
148
  ],
149
149
  "growthMb": 0
150
150
  },
@@ -154,12 +154,12 @@
154
154
  "id": "outage",
155
155
  "title": "AgentBeam down or slow",
156
156
  "passed": true,
157
- "summary": "request() stayed at 52.2 µs; 1 send attempt, then none while backing off; a hung connection was dropped after 5.0 s, off the request path",
157
+ "summary": "request() stayed at 25.7 µs; 1 send attempt, then none while backing off; a hung connection was dropped after 5.0 s, off the request path",
158
158
  "measured": {
159
- "requestMicros": 52.2,
159
+ "requestMicros": 25.7,
160
160
  "attemptsBeforeBackoff": 1,
161
161
  "attemptsDuringBackoff": 0,
162
- "hungFlushMs": 4999
162
+ "hungFlushMs": 5001
163
163
  },
164
164
  "limit": "no slowdown, no retries during backoff, hung sends dropped within 7 s"
165
165
  },
@@ -167,13 +167,13 @@
167
167
  "id": "cpu-budget",
168
168
  "title": "CPU cap",
169
169
  "passed": true,
170
- "summary": "with a 1% cap (600 ms a minute), a flood of 200 KB documents got 650 ms of checking (44 documents); the rest were skipped, flagged as skipped, at 0.12 µs each",
170
+ "summary": "with a 1% cap (600 ms a minute), a flood of 200 KB documents got 674 ms of checking (66 documents); the rest were skipped, flagged as skipped, at 0.28 µs each",
171
171
  "measured": {
172
172
  "capMs": 600,
173
- "spentMs": 650,
174
- "checked": 44,
173
+ "spentMs": 674,
174
+ "checked": 66,
175
175
  "skipped": 100000,
176
- "skippedCallMicros": 0.12
176
+ "skippedCallMicros": 0.28
177
177
  },
178
178
  "limit": "under twice the cap (one check can finish after the cap is reached)"
179
179
  }