The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Context from "effect/Context"; |
| 2 | |
| 3 | /** |
| 4 | * Identity of the resource whose provider lifecycle operation (`diff`, `read`, |
| 5 | * `precreate`, `reconcile`, `delete`, …) is running. The engine provides it for |
| 6 | * the duration of each call, so helpers several calls below a reconciler |
| 7 | * (e.g. `Bundle.build`) can key per-resource state without the provider |
| 8 | * threading its identity through. Absent outside a lifecycle operation. |
| 9 | */ |
| 10 | export class ResourceContext extends Context.Service< |
| 11 | ResourceContext, |
| 12 | { |
| 13 | /** Logical ID of the resource within its namespace, e.g. `Api`. */ |
| 14 | readonly logicalId: string; |
| 15 | /** |
| 16 | * Fully-qualified name (namespace path + logical ID, see `./FQN.ts`), |
| 17 | * unique within the stack, e.g. `Backend/Api`. |
| 18 | */ |
| 19 | readonly fqn: string; |
| 20 | /** Instance ID of the physical resource; changes on replacement. */ |
| 21 | readonly instanceId: string; |
| 22 | /** Resource type, e.g. `Cloudflare.Worker`. */ |
| 23 | readonly type: string; |
| 24 | } |
| 25 | >()("ResourceContext") {} |