(request: Request)
| 106 | const toolkitPathPattern = /^\/mcp\/toolkits\/([^/?#]+)\/?$/; |
| 107 | |
| 108 | const resourceFromRequest = (request: Request): McpResource | null => { |
| 109 | const pathname = new URL(request.url).pathname; |
| 110 | if (pathname === "/mcp" || pathname === "/mcp/") return defaultMcpResource; |
| 111 | const match = toolkitPathPattern.exec(pathname); |
| 112 | if (!match) return null; |
| 113 | return { kind: "toolkit", slug: decodeURIComponent(match[1]) }; |
| 114 | }; |
| 115 | |
| 116 | const engineFromConfig = (config: ExecutorMcpServerConfig): AnyExecutionEngine | null => |
| 117 | "engine" in config ? config.engine : null; |
no test coverage detected