()
| 155 | // operator-set value must fit the shared grammar and avoid reserved root |
| 156 | // segments (api, mcp, login, …) — a colliding slug would shadow real routes. |
| 157 | const resolveOrgSlug = (): string => { |
| 158 | const slug = process.env.EXECUTOR_ORG_SLUG; |
| 159 | if (!slug) return "default"; |
| 160 | if (!isValidOrgSlug(slug) && slug !== "default") { |
| 161 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: a colliding org slug would shadow app routes; refuse to boot |
| 162 | throw new Error( |
| 163 | `EXECUTOR_ORG_SLUG ${JSON.stringify(slug)} is not usable as a URL slug (2-48 chars of [a-z0-9-], not a reserved path segment like "api" or "login")`, |
| 164 | ); |
| 165 | } |
| 166 | return slug; |
| 167 | }; |
no test coverage detected