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