@radaros/transport 0.3.16 → 0.3.18

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/dist/index.d.ts CHANGED
@@ -87,6 +87,12 @@ declare class MCPManager {
87
87
  interface AdminRouterOptions {
88
88
  /** Shared MCPManager instance. If omitted, a new one is created. */
89
89
  mcpManager?: MCPManager;
90
+ /**
91
+ * Express middleware for authentication/authorization.
92
+ * **IMPORTANT**: These endpoints can add MCP servers and execute tools.
93
+ * Always add auth middleware in production.
94
+ */
95
+ middleware?: any[];
90
96
  }
91
97
  /**
92
98
  * Creates an Express sub-router with admin endpoints for managing
package/dist/index.js CHANGED
@@ -484,6 +484,14 @@ function createAdminRouter(opts) {
484
484
  }
485
485
  const router = express.Router();
486
486
  const mcpManager = opts?.mcpManager ?? new MCPManager();
487
+ if (opts?.middleware) {
488
+ for (const mw of opts.middleware) router.use(mw);
489
+ }
490
+ if (!opts?.middleware?.length && process.env.NODE_ENV === "production") {
491
+ console.warn(
492
+ "[admin-router] WARNING: Admin routes mounted without authentication middleware. These endpoints can add MCP servers, execute tools, and modify configurations. Pass middleware in AdminRouterOptions to secure them."
493
+ );
494
+ }
487
495
  router.get("/mcp", (_req, res) => {
488
496
  res.json(mcpManager.list());
489
497
  });
@@ -1904,6 +1912,9 @@ function createVoiceGateway(opts) {
1904
1912
  result: ev.result
1905
1913
  });
1906
1914
  });
1915
+ session.on("usage", (ev) => {
1916
+ socket.emit("voice.usage", ev);
1917
+ });
1907
1918
  session.on("interrupted", () => {
1908
1919
  socket.emit("voice.interrupted");
1909
1920
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radaros/transport",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "HTTP and WebSocket transport layer for RadarOS agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "typescript": "^5.6.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@radaros/core": "^0.3.16",
42
+ "@radaros/core": "^0.3.18",
43
43
  "@types/express": "^4.0.0 || ^5.0.0",
44
44
  "express": "^4.0.0 || ^5.0.0",
45
45
  "multer": ">=2.0.0",