The best way to control Claude Code, Codex and more from any computer or phone

main
ts 25 lines 1.14 KB
Raw
1 import { GcpEnvironment } from "@alchemy.run/gcp/Environment";
2 import * as Effect from "effect/Effect";
3 import { MinimumLogLevel } from "effect/References";
4
5 // Repositories live in a Secure Source Manager instance (billed, ~30
6 // minutes to provision) and the API is disabled on the testing project:
7 // creates fail with Forbidden "Secure Source Manager API has not been used in
8 // project ... before or it is disabled". Set GCP_TEST_SECURE_SOURCE_MANAGER=1
9 // plus GCP_TEST_SECURE_SOURCE_MANAGER_REPO on a project with an instance.
10 export const runLifecycle = !process.env.FAST && !!process.env.GCP_TEST_SECURE_SOURCE_MANAGER;
11
12 export const currentProject = GcpEnvironment.current.pipe(Effect.map((env) => env.project));
13
14 export const missingRepoOf = (project: string) =>
15 `projects/${project}/locations/us-central1/repositories/alchemy-missing-ssm-repo`;
16
17 export const missingIssueOf = (project: string) => `${missingRepoOf(project)}/issues/12345`;
18
19 export const missingPullRequestOf = (project: string) =>
20 `${missingRepoOf(project)}/pullRequests/12345`;
21
22 export const logLevel = Effect.provideService(
23 MinimumLogLevel,
24 process.env.DEBUG ? "Debug" : "Info",
25 );