The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import type * as tpu from "@distilled.cloud/gcp/tpu_v2"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type { RuntimeContext } from "alchemy/RuntimeContext"; |
| 4 | import type * as Effect from "effect/Effect"; |
| 5 | import type { Node } from "./Node.ts"; |
| 6 | |
| 7 | export interface GetNodeRequest extends Omit<tpu.GetProjectsLocationsNodesRequest, "name"> {} |
| 8 | |
| 9 | /** |
| 10 | * Runtime binding for Cloud TPU `nodes.get`. |
| 11 | * |
| 12 | * Bind this operation to a {@link Node} in a Function/Action init phase. |
| 13 | * Provide {@link GetNodeHttp}. |
| 14 | * |
| 15 | * Grants `roles/tpu.viewer` on the project because Cloud TPU has no |
| 16 | * resource-level IAM. |
| 17 | * |
| 18 | * ### Observing Nodes |
| 19 | * **Example:** Read the bound node |
| 20 | * ```typescript |
| 21 | * const getNode = yield* GCP.TPU.GetNode(node); |
| 22 | * const live = yield* getNode(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @category TPU |
| 27 | */ |
| 28 | export interface GetNode extends Binding.Service< |
| 29 | GetNode, |
| 30 | "GCP.TPU.GetNode", |
| 31 | ( |
| 32 | node: Node, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetNodeRequest, |
| 36 | ) => Effect.Effect<tpu.Node, tpu.GetProjectsLocationsNodesError, RuntimeContext> |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const GetNode = Binding.Service<GetNode>("GCP.TPU.GetNode"); |