(pathname: string)
| 1 | import { defaultMcpResource, type McpResource } from "@executor-js/host-mcp"; |
| 2 | |
| 3 | export const mcpResourceFromPath = (pathname: string): McpResource | null => { |
| 4 | if (pathname === "/mcp") return defaultMcpResource; |
| 5 | |
| 6 | const toolkitMatch = /^\/mcp\/toolkits\/([^/]+)$/.exec(pathname); |
| 7 | return toolkitMatch?.[1] ? { kind: "toolkit", slug: toolkitMatch[1] } : null; |
| 8 | }; |
no test coverage detected