MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveOrgSlug

Function resolveOrgSlug

apps/host-selfhost/src/config.ts:267–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265// operator-set value must fit the shared grammar and avoid reserved root
266// segments (api, mcp, login, …) — a colliding slug would shadow real routes.
267const resolveOrgSlug = (): string => {
268 const slug = process.env.EXECUTOR_ORG_SLUG;
269 if (!slug) return "default";
270 if (!isValidOrgSlug(slug) && slug !== "default") {
271 // 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
272 throw new Error(
273 `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")`,
274 );
275 }
276 return slug;
277};
278
279// EXECUTOR_TOOLS_SYNC_TTL_MS — how long a remote tool catalog (an MCP server's
280// tool set, which changes server-side with no executor-visible signal) stays

Callers 1

loadConfigFunction · 0.70

Calls 1

isValidOrgSlugFunction · 0.90

Tested by

no test coverage detected