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

Function selfhostTarget

e2e/targets/selfhost.ts:151–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149};
150
151export const selfhostTarget = (): Target => ({
152 name: "selfhost",
153 baseUrl: SELFHOST_BASE_URL,
154 mcpUrl: `${SELFHOST_BASE_URL}/mcp`,
155 // No "billing" (no limits) and no setAccessTokenTtl yet (Better Auth is the
156 // authorization server; its token TTL isn't test-adjustable, so token-expiry
157 // scenarios skip here). Identity is the bootstrap admin for now —
158 // single-tenant; per-test invite-signup isolation is the next step here, so
159 // browser scenarios must prefix the resources they create.
160 capabilities: new Set(["api", "browser", "mcp-oauth"]),
161 newIdentity: () =>
162 Effect.promise(async (): Promise<Identity> => {
163 // Sign in once and carry the session in both shapes: `headers` for the
164 // API surface, `cookies` for an injectable logged-in browser context.
165 const { cookieHeader, cookies } = await signInSession(SELFHOST_BASE_URL, SELFHOST_ADMIN);
166 return {
167 label: SELFHOST_ADMIN.email,
168 credentials: SELFHOST_ADMIN,
169 headers: { cookie: cookieHeader },
170 cookies,
171 };
172 }),
173 mcpConsent: (identity: Identity) =>
174 forcedMcpConsent(SELFHOST_BASE_URL, {
175 email: identity.credentials?.email ?? SELFHOST_ADMIN.email,
176 password: identity.credentials?.password || SELFHOST_ADMIN.password,
177 }),
178});

Callers

nothing calls this directly

Calls 2

signInSessionFunction · 0.85
forcedMcpConsentFunction · 0.85

Tested by

no test coverage detected