(request: Request)
| 118 | const toolkitPathPattern = /^\/mcp\/toolkits\/([^/?#]+)\/?$/; |
| 119 | |
| 120 | const resourceFromRequest = (request: Request): McpResource | null => { |
| 121 | const pathname = new URL(request.url).pathname; |
| 122 | if (pathname === "/mcp" || pathname === "/mcp/") return defaultMcpResource; |
| 123 | const match = toolkitPathPattern.exec(pathname); |
| 124 | if (!match) return null; |
| 125 | return { kind: "toolkit", slug: decodeURIComponent(match[1]) }; |
| 126 | }; |
| 127 | |
| 128 | const engineFromConfig = (config: ExecutorMcpToolConfig): AnyExecutionEngine | null => |
| 129 | "engine" in config ? config.engine : null; |
no test coverage detected