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

Function selfhostTarget

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

Source from the content-addressed store, hash-verified

100 };
101
102export const selfhostTarget = (): Target => ({
103 name: "selfhost",
104 baseUrl: SELFHOST_BASE_URL,
105 mcpUrl: `${SELFHOST_BASE_URL}/mcp`,
106 // No "billing" (no limits) and no setAccessTokenTtl yet (Better Auth is the
107 // authorization server; its token TTL isn't test-adjustable, so token-expiry
108 // scenarios skip here). Identity is the bootstrap admin for now —
109 // single-tenant; per-test invite-signup isolation is the next step here, so
110 // browser scenarios must prefix the resources they create.
111 capabilities: new Set(["api", "browser", "mcp-oauth"]),
112 newIdentity: () =>
113 Effect.promise(async (): Promise<Identity> => {
114 // Sign in once and carry the session in both shapes: `headers` for the
115 // API surface, `cookies` for an injectable logged-in browser context.
116 const { cookieHeader, cookies } = await signInSession(SELFHOST_BASE_URL, SELFHOST_ADMIN);
117 return {
118 label: SELFHOST_ADMIN.email,
119 credentials: SELFHOST_ADMIN,
120 headers: { cookie: cookieHeader },
121 cookies,
122 };
123 }),
124 mcpConsent: (identity: Identity) =>
125 forcedMcpConsent(SELFHOST_BASE_URL, {
126 email: identity.credentials?.email ?? SELFHOST_ADMIN.email,
127 password: identity.credentials?.password || SELFHOST_ADMIN.password,
128 }),
129});

Callers

nothing calls this directly

Calls 2

signInSessionFunction · 0.85
forcedMcpConsentFunction · 0.85

Tested by

no test coverage detected