@suveren/gateway 0.19.1 → 0.19.3

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.
@@ -1610,6 +1610,10 @@ Environment:
1610
1610
  SUVEREN_DATA_DIR Data directory (default ~/.suveren) — overrides a saved \`config set data-dir\`
1611
1611
  SUVEREN_AS_URL Authority Server URL — overrides the saved as-url
1612
1612
  SUVEREN_SIMULATION 1 to force simulation mode for this run — overrides the saved setting
1613
+ SUVEREN_BIND_HOST Listen address (default 127.0.0.1 — this machine only). Anything
1614
+ else lets other machines connect as your agent, so it needs:
1615
+ SUVEREN_MCP_TOKEN Token an AI assistant must send to open a session
1616
+ (Authorization: Bearer <token>, or ?token=<token>)
1613
1617
  HTTP_PROXY / HTTPS_PROXY / NO_PROXY (upper or lower case)
1614
1618
  Corporate proxy — honoured for every outbound call to the Authority
1615
1619
  Server, the update checker, and a remote AI assistant endpoint. A
@@ -9,7 +9,8 @@
9
9
  "npmVersion": "0.4.0",
10
10
  "mcp": {
11
11
  "command": "erp-mcp",
12
- "args": []
12
+ "args": [],
13
+ "passEnv": ["ERP_COMPANY_FILE"]
13
14
  },
14
15
  "credentials": {
15
16
  "fields": [
@@ -599,6 +599,13 @@ async function exportReport(gatewayVersion) {
599
599
  const filename = /filename="([^"]+)"/.exec(res.headers.get("content-disposition") ?? "")?.[1] ?? "suveren-report.html";
600
600
  return { html, filename };
601
601
  }
602
+ async function getAgentContact() {
603
+ const res = await fetch(`${MCP_BASE}/internal/agent-contact`, {
604
+ headers: internalHeaders()
605
+ });
606
+ if (!res.ok) throw new Error("Failed to fetch agent contact");
607
+ return res.json();
608
+ }
602
609
  async function getMcpHealth() {
603
610
  const res = await fetch(`${MCP_BASE}/health`);
604
611
  if (!res.ok) throw new Error("MCP server unreachable");
@@ -2870,6 +2877,13 @@ function createMCPRouter() {
2870
2877
  res.status(502).json({ error: "MCP server unreachable" });
2871
2878
  }
2872
2879
  });
2880
+ router.get("/agent-contact", async (_req, res) => {
2881
+ try {
2882
+ res.json(await getAgentContact());
2883
+ } catch {
2884
+ res.status(502).json({ error: "MCP server unreachable" });
2885
+ }
2886
+ });
2873
2887
  router.get("/integrations", async (_req, res) => {
2874
2888
  try {
2875
2889
  const data = await getIntegrations();
@@ -5045,8 +5059,9 @@ if (existsSync11(UI_DIST)) {
5045
5059
  });
5046
5060
  });
5047
5061
  }
5048
- app.listen(port, "0.0.0.0", () => {
5049
- console.error(`[Control Plane] Listening on http://0.0.0.0:${port}`);
5062
+ var bindHost = process.env.SUVEREN_BIND_HOST?.trim() || "127.0.0.1";
5063
+ app.listen(port, bindHost, () => {
5064
+ console.error(`[Control Plane] Listening on http://${bindHost}:${port}`);
5050
5065
  if (process.env.SUVEREN_AUTOSTART === "1" && !vault.isUnlocked()) {
5051
5066
  const { title, message, url } = lockedNotification(port);
5052
5067
  notify(title, message, process.platform, url);