The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as GCP from "@alchemy.run/gcp"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { serveProbes } from "../../bindingHost.ts"; |
| 4 | |
| 5 | export const TITLE = "Cotton tee"; |
| 6 | |
| 7 | export const Shirt = GCP.RecommendationEngine.CatalogsCatalogItem("Shirt", { |
| 8 | title: TITLE, |
| 9 | categoryHierarchies: [{ categories: ["Apparel", "T-Shirts"] }], |
| 10 | }); |
| 11 | |
| 12 | /** |
| 13 | * Effect-native Cloud Run service exercising every Recommendations AI |
| 14 | * binding as its own runtime service account. Deployed from |
| 15 | * {@link ../Bindings.test.ts}. |
| 16 | */ |
| 17 | export default class RecommendationEngineBindingsHost extends GCP.Function<RecommendationEngineBindingsHost>()( |
| 18 | "RecommendationEngineBindingsHost", |
| 19 | { main: import.meta.url, invokerIamDisabled: true }, |
| 20 | Effect.gen(function* () { |
| 21 | const getCatalogItem = yield* GCP.RecommendationEngine.GetCatalogItem(Shirt); |
| 22 | |
| 23 | return { |
| 24 | fetch: serveProbes({ |
| 25 | getCatalogItem: getCatalogItem(), |
| 26 | }), |
| 27 | }; |
| 28 | }).pipe(Effect.provide(GCP.RecommendationEngine.GetCatalogItemHttp)), |
| 29 | ) {} |