| 1 | import { GcpEnvironment } from "@/GCP/Environment"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { MinimumLogLevel } from "effect/References"; |
| 4 | |
| 5 | export const logLevel = Effect.provideService( |
| 6 | MinimumLogLevel, |
| 7 | process.env.DEBUG ? "Debug" : "Info", |
| 8 | ); |
| 9 | |
| 10 | export const currentProject = GcpEnvironment.current.pipe( |
| 11 | Effect.map((env) => env.project), |
| 12 | ); |
| 13 | |
| 14 | export const catalogParentOf = (project: string) => |
| 15 | `projects/${project}/locations/global`; |
| 16 | |
| 17 | export const defaultCatalogOf = (project: string) => |
| 18 | `${catalogParentOf(project)}/catalogs/default_catalog`; |
| 19 | |
| 20 | export const missingNameOf = (project: string) => |
| 21 | `${defaultCatalogOf(project)}/catalogItems/alchemy-missing`; |
| 22 | |
| 23 | // Recommendations AI (Beta) is not enabled in the testing project. Set |
| 24 | // GCP_TEST_RECOMMENDATION_ENGINE=1 on a project where it is. |
| 25 | export const entitled = !!process.env.GCP_TEST_RECOMMENDATION_ENGINE; |