@senpi/runtime 3.0.291 → 3.0.293

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 (53) hide show
  1. package/dist/actions/llm-decision/openclaw-llm-decision.d.ts.map +1 -1
  2. package/dist/actions/llm-decision/openclaw-llm-decision.js +9 -4
  3. package/dist/actions/llm-decision/openclaw-llm-decision.js.map +1 -1
  4. package/dist/approvals/live-code-approval.d.ts +42 -0
  5. package/dist/approvals/live-code-approval.d.ts.map +1 -0
  6. package/dist/approvals/live-code-approval.js +124 -0
  7. package/dist/approvals/live-code-approval.js.map +1 -0
  8. package/dist/cli/senpi-commands.d.ts.map +1 -1
  9. package/dist/cli/senpi-commands.js +3 -1
  10. package/dist/cli/senpi-commands.js.map +1 -1
  11. package/dist/daemon/errors.d.ts.map +1 -1
  12. package/dist/daemon/errors.js +1 -0
  13. package/dist/daemon/errors.js.map +1 -1
  14. package/dist/daemon/mcp-endpoint.d.ts.map +1 -1
  15. package/dist/daemon/mcp-endpoint.js +5 -2
  16. package/dist/daemon/mcp-endpoint.js.map +1 -1
  17. package/dist/deploy/packages/live-approval.d.ts +46 -0
  18. package/dist/deploy/packages/live-approval.d.ts.map +1 -0
  19. package/dist/deploy/packages/live-approval.js +110 -0
  20. package/dist/deploy/packages/live-approval.js.map +1 -0
  21. package/dist/deploy/packages/network.d.ts +12 -0
  22. package/dist/deploy/packages/network.d.ts.map +1 -0
  23. package/dist/deploy/packages/network.js +83 -0
  24. package/dist/deploy/packages/network.js.map +1 -0
  25. package/dist/deploy/packages/package-dir.d.ts +13 -0
  26. package/dist/deploy/packages/package-dir.d.ts.map +1 -0
  27. package/dist/deploy/packages/package-dir.js +50 -0
  28. package/dist/deploy/packages/package-dir.js.map +1 -0
  29. package/dist/deploy/packages/store.d.ts +6 -0
  30. package/dist/deploy/packages/store.d.ts.map +1 -1
  31. package/dist/deploy/packages/store.js +37 -44
  32. package/dist/deploy/packages/store.js.map +1 -1
  33. package/dist/deploy/register.d.ts.map +1 -1
  34. package/dist/deploy/register.js +58 -6
  35. package/dist/deploy/register.js.map +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +16 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/integrity-manifest.json +51 -31
  40. package/dist/runtime-api/intake/intake-mount.d.ts +2 -0
  41. package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
  42. package/dist/runtime-api/intake/intake-mount.js +5 -2
  43. package/dist/runtime-api/intake/intake-mount.js.map +1 -1
  44. package/dist/runtime-api/intake/scanner-launcher.d.ts +2 -0
  45. package/dist/runtime-api/intake/scanner-launcher.d.ts.map +1 -1
  46. package/dist/runtime-api/intake/scanner-launcher.js +23 -4
  47. package/dist/runtime-api/intake/scanner-launcher.js.map +1 -1
  48. package/dist/sandbox/host-proxy.d.ts +57 -0
  49. package/dist/sandbox/host-proxy.d.ts.map +1 -0
  50. package/dist/sandbox/host-proxy.js +194 -0
  51. package/dist/sandbox/host-proxy.js.map +1 -0
  52. package/openclaw.plugin.json +3 -2
  53. package/package.json +1 -1
@@ -0,0 +1,194 @@
1
+ /**
2
+ * The host proxy of one sandboxed run: an HTTP CONNECT proxy on a Unix socket.
3
+ *
4
+ * Uploaded code declares the hosts it needs in its package's `network.hosts`. The proxy tunnels
5
+ * `CONNECT <host>:443` for those hosts only. It resolves the name itself, refuses every address in
6
+ * Senpi's own reach (private, loopback, link-local, CGNAT, multicast, cloud metadata), and connects
7
+ * to the address it checked, so a name cannot resolve to one address for the check and another for
8
+ * the connection.
9
+ *
10
+ * Every sandboxed run is the same user, so the socket file alone (open to that user only) does not
11
+ * keep one run off another run's proxy. Each proxy therefore takes a token minted for its run, which
12
+ * the run gets in its environment beside the socket's path.
13
+ */
14
+ import { randomBytes, timingSafeEqual } from "node:crypto";
15
+ import { chmodSync, chownSync, mkdtempSync, rmSync } from "node:fs";
16
+ import { lookup as dnsLookup } from "node:dns/promises";
17
+ import { createServer } from "node:http";
18
+ import { BlockList, connect as netConnect, isIP } from "node:net";
19
+ import { tmpdir } from "node:os";
20
+ import { join } from "node:path";
21
+ const ALLOWED_PORT = 443;
22
+ const LOGGED_HOST_MAX = 253;
23
+ const RANGES = [
24
+ ["metadata", [["169.254.169.254", 32, "ipv4"], ["fd00:ec2::254", 128, "ipv6"]]],
25
+ ["loopback", [["127.0.0.0", 8, "ipv4"], ["0.0.0.0", 8, "ipv4"], ["::1", 128, "ipv6"], ["::", 128, "ipv6"]]],
26
+ ["private", [["10.0.0.0", 8, "ipv4"], ["172.16.0.0", 12, "ipv4"], ["192.168.0.0", 16, "ipv4"], ["fc00::", 7, "ipv6"], ["fec0::", 10, "ipv6"]]],
27
+ ["link-local", [["169.254.0.0", 16, "ipv4"], ["fe80::", 10, "ipv6"]]],
28
+ ["CGNAT", [["100.64.0.0", 10, "ipv4"]]],
29
+ ["multicast", [["224.0.0.0", 4, "ipv4"], ["ff00::", 8, "ipv6"]]],
30
+ ];
31
+ const LISTS = RANGES.map(([reason, subnets]) => {
32
+ const list = new BlockList();
33
+ for (const [net, prefix, family] of subnets)
34
+ list.addSubnet(net, prefix, family);
35
+ return [reason, list];
36
+ });
37
+ /** The IPv4 address an IPv6 one carries: IPv4-mapped (::ffff:0:0/96) or well-known NAT64 (64:ff9b::/96). */
38
+ function embeddedV4(address) {
39
+ const lower = address.toLowerCase();
40
+ const prefix = ["::ffff:", "64:ff9b::"].find((p) => lower.startsWith(p));
41
+ if (prefix === undefined)
42
+ return undefined;
43
+ const rest = lower.slice(prefix.length);
44
+ if (isIP(rest) === 4)
45
+ return rest;
46
+ const words = rest.split(":");
47
+ if (words.length !== 2 || !words.every((w) => /^[0-9a-f]{1,4}$/.test(w)))
48
+ return undefined;
49
+ const n = (parseInt(words[0], 16) << 16) | parseInt(words[1], 16);
50
+ return [24, 16, 8, 0].map((s) => (n >>> s) & 255).join(".");
51
+ }
52
+ /** Why the proxy will not connect to `address`, or undefined when it may. */
53
+ export function addressRefusal(address) {
54
+ const family = isIP(address);
55
+ if (family === 0)
56
+ return "private";
57
+ const v4 = family === 6 ? embeddedV4(address) : address;
58
+ const [checked, type] = v4 !== undefined ? [v4, "ipv4"] : [address, "ipv6"];
59
+ return LISTS.find(([, list]) => list.check(checked, type))?.[0];
60
+ }
61
+ const STATUS_TEXT = {
62
+ 400: "Bad Request",
63
+ 403: "Forbidden",
64
+ 405: "Method Not Allowed",
65
+ 407: "Proxy Authentication Required",
66
+ 502: "Bad Gateway",
67
+ };
68
+ function answer(socket, status, reason) {
69
+ const body = `${reason}\n`;
70
+ socket.end(`HTTP/1.1 ${status} ${STATUS_TEXT[status]}\r\nContent-Type: text/plain\r\nContent-Length: ${Buffer.byteLength(body)}\r\nConnection: close\r\n\r\n${body}`);
71
+ }
72
+ function tokenMatches(header, token) {
73
+ const [scheme, given] = (header ?? "").split(" ");
74
+ if (scheme !== "Bearer" || !given)
75
+ return undefined;
76
+ const a = Buffer.from(given);
77
+ const b = Buffer.from(token);
78
+ return a.length === b.length && timingSafeEqual(a, b);
79
+ }
80
+ const defaultLookup = async (host) => dnsLookup(host, { all: true, verbatim: true });
81
+ const defaultConnect = (address, port) => netConnect({ host: address, port });
82
+ /**
83
+ * Start the proxy of one run. The socket is bound when this returns; the dir it sits in is the
84
+ * proxy's own and goes with {@link HostProxy.close}.
85
+ */
86
+ export function startHostProxy(opts) {
87
+ const { runId, logger } = opts;
88
+ const declared = new Set(opts.hosts.map((h) => h.toLowerCase()));
89
+ const lookup = opts.lookup ?? defaultLookup;
90
+ const connectTo = opts.connect ?? defaultConnect;
91
+ const token = `hp_${randomBytes(32).toString("hex")}`;
92
+ const dir = mkdtempSync(join(opts.parentDir ?? tmpdir(), "senpi-hp-"));
93
+ chmodSync(dir, 0o711);
94
+ const socketPath = join(dir, "proxy.sock");
95
+ const open = new Set();
96
+ const refuse = (socket, status, host, reason) => {
97
+ logger.warn("host proxy refused", undefined, { runId, host: host.slice(0, LOGGED_HOST_MAX), reason, status });
98
+ answer(socket, status, reason);
99
+ };
100
+ const tunnel = async (req, client, head) => {
101
+ const target = req.url ?? "";
102
+ const auth = tokenMatches(req.headers["proxy-authorization"], token);
103
+ if (auth !== true) {
104
+ refuse(client, 407, target, auth === undefined ? "no run token" : "not this run's token");
105
+ return;
106
+ }
107
+ const colon = target.lastIndexOf(":");
108
+ const portText = colon === -1 ? "" : target.slice(colon + 1);
109
+ if (colon <= 0 || !/^[0-9]{1,5}$/.test(portText)) {
110
+ refuse(client, 400, target, "the target is not host:port");
111
+ return;
112
+ }
113
+ const host = target.slice(0, colon).toLowerCase();
114
+ const port = Number(portText);
115
+ if (port !== ALLOWED_PORT) {
116
+ refuse(client, 403, host, `port ${port} is not 443`);
117
+ return;
118
+ }
119
+ if (!declared.has(host)) {
120
+ refuse(client, 403, host, "host is not declared in network.hosts");
121
+ return;
122
+ }
123
+ let addresses;
124
+ try {
125
+ addresses = await lookup(host);
126
+ }
127
+ catch (err) {
128
+ refuse(client, 502, host, `${host} did not resolve (${err.code ?? "lookup failed"})`);
129
+ return;
130
+ }
131
+ const allowed = addresses.find((a) => addressRefusal(a.address) === undefined);
132
+ if (allowed === undefined) {
133
+ const why = addresses.map((a) => `${a.address} is ${addressRefusal(a.address)}`).join(", ");
134
+ refuse(client, 403, host, `${host} resolves only to refused addresses (${why || "none"})`);
135
+ return;
136
+ }
137
+ if (client.destroyed)
138
+ return;
139
+ const upstream = connectTo(allowed.address, ALLOWED_PORT);
140
+ open.add(upstream);
141
+ upstream.once("close", () => open.delete(upstream));
142
+ const fail = (err) => {
143
+ if (client.destroyed || client.writableEnded)
144
+ return;
145
+ refuse(client, 502, host, `connect to ${allowed.address} failed (${err.code ?? "error"})`);
146
+ };
147
+ upstream.once("error", fail);
148
+ upstream.once("connect", () => {
149
+ upstream.off("error", fail);
150
+ logger.info("host proxy allowed", { runId, host, port, address: allowed.address });
151
+ upstream.on("error", () => client.destroy());
152
+ client.on("error", () => upstream.destroy());
153
+ client.write("HTTP/1.1 200 Connection Established\r\n\r\n");
154
+ if (head.length > 0)
155
+ upstream.write(head);
156
+ upstream.pipe(client);
157
+ client.pipe(upstream);
158
+ });
159
+ };
160
+ const server = createServer((req, res) => {
161
+ const reason = "only CONNECT is accepted";
162
+ logger.warn("host proxy refused", undefined, { runId, host: String(req.headers.host ?? "").slice(0, LOGGED_HOST_MAX), reason, status: 405 });
163
+ res.writeHead(405, { "content-type": "text/plain", connection: "close" }).end(`${reason}\n`);
164
+ });
165
+ server.on("connection", (s) => {
166
+ open.add(s);
167
+ s.once("close", () => open.delete(s));
168
+ });
169
+ server.on("connect", (req, client, head) => {
170
+ client.on("error", () => client.destroy());
171
+ void tunnel(req, client, head).catch(() => client.destroy());
172
+ });
173
+ server.on("error", (err) => logger.warn("host proxy socket failed", err, { runId }));
174
+ server.listen(socketPath);
175
+ chmodSync(socketPath, 0o600);
176
+ if (opts.owner !== undefined)
177
+ chownSync(socketPath, opts.owner.uid, opts.owner.gid);
178
+ logger.info("host proxy listening", { runId, socketPath, hosts: [...declared] });
179
+ let closing;
180
+ return {
181
+ socketPath,
182
+ token,
183
+ env: { SENPI_HOST_PROXY_SOCKET: socketPath, SENPI_HOST_PROXY_TOKEN: token },
184
+ close: () => (closing ??= new Promise((resolve) => {
185
+ for (const s of open)
186
+ s.destroy();
187
+ server.close(() => {
188
+ rmSync(dir, { recursive: true, force: true });
189
+ resolve();
190
+ });
191
+ })),
192
+ };
193
+ }
194
+ //# sourceMappingURL=host-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-proxy.js","sourceRoot":"","sources":["../../src/sandbox/host-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mBAAmB,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AC,IAAI,IAAI;gBAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChB,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC9C,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACN,CAAC;AACJ,CAAC"}
@@ -2,7 +2,7 @@
2
2
  "id": "runtime",
3
3
  "name": "Senpi Runtime",
4
4
  "description": "Senpi runtime plugin for OpenClaw. Orchestrates scanners, LLM-based trade decisions, and a DSL trailing stop-loss exit engine.",
5
- "version": "3.0.291",
5
+ "version": "3.0.293",
6
6
  "commandAliases": [
7
7
  {
8
8
  "name": "senpi"
@@ -17,7 +17,8 @@
17
17
  "contracts": {
18
18
  "tools": [
19
19
  "show_widget",
20
- "ask_user_question"
20
+ "ask_user_question",
21
+ "senpi_approve_live_code"
21
22
  ]
22
23
  },
23
24
  "configSchema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senpi/runtime",
3
- "version": "3.0.291",
3
+ "version": "3.0.293",
4
4
  "description": "Senpi runtime plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",