1import { GcpEnvironment } from "@/GCP/Environment";
2import * as Effect from "effect/Effect";
3import { MinimumLogLevel } from "effect/References";
4
5export const logLevel = Effect.provideService(
6 MinimumLogLevel,
7 process.env.DEBUG ? "Debug" : "Info",
8);
9
10export const currentProject = GcpEnvironment.current.pipe(
11 Effect.map((env) => env.project),
12);
13
14export const catalogParentOf = (project: string) =>
15 `projects/${project}/locations/global`;
16
17export const defaultCatalogOf = (project: string) =>
18 `${catalogParentOf(project)}/catalogs/default_catalog`;
19
20export 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.
25export const entitled = !!process.env.GCP_TEST_RECOMMENDATION_ENGINE;