(target: TargetShape, dir: string)
| 85 | * into the skip. |
| 86 | */ |
| 87 | const contextFor = (target: TargetShape, dir: string): Context.Context<AllServices> => { |
| 88 | let context = Context.empty().pipe( |
| 89 | Context.add(Target, target), |
| 90 | Context.add(RunDir, dir), |
| 91 | Context.add(Cli, makeCliSurface()), |
| 92 | ) as Context.Context<AllServices>; |
| 93 | const has = target.capabilities.has.bind(target.capabilities); |
| 94 | if (has("api")) context = Context.add(context, Api, makeApiSurface(target)); |
| 95 | if (has("browser")) context = Context.add(context, Browser, makeBrowserSurface(dir, target)); |
| 96 | if (has("mcp-oauth")) context = Context.add(context, Mcp, makeMcpSurface(target, dir)); |
| 97 | if (has("billing")) context = Context.add(context, Billing, true); |
| 98 | if (hasOpenCode()) { |
| 99 | context = Context.add(context, OpenCode, { |
| 100 | makeHome: makeOpenCodeHome, |
| 101 | warmUp, |
| 102 | completeOAuthConsent, |
| 103 | }); |
| 104 | } |
| 105 | if (target.setAccessTokenTtl) { |
| 106 | context = Context.add(context, TtlControl, target.setAccessTokenTtl); |
| 107 | } |
| 108 | if (target.restart) { |
| 109 | context = Context.add(context, Restart, target.restart); |
| 110 | } |
| 111 | if (process.env.E2E_MOTEL_URL) { |
| 112 | context = Context.add(context, Telemetry, makeTelemetrySurface(process.env.E2E_MOTEL_URL)); |
| 113 | } |
| 114 | if (process.env.E2E_AUTUMN_URL) { |
| 115 | context = Context.add(context, Autumn, makeAutumnSurface(process.env.E2E_AUTUMN_URL)); |
| 116 | } |
| 117 | return context; |
| 118 | }; |
| 119 | |
| 120 | export const scenario = ( |
| 121 | name: string, |
no test coverage detected