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 * as Schema from "effect/Schema"; |
| 2 | import { CustomerId } from "./Customer/Customer.id.ts"; |
| 3 | |
| 4 | /** |
| 5 | * Who is acting. `Session` provides it as the `CurrentActor` of each |
| 6 | * request; events that need an audit trail record it as `by`. |
| 7 | */ |
| 8 | export const Actor = Schema.Union([ |
| 9 | Schema.TaggedStruct("Customer", { customerId: CustomerId }), |
| 10 | Schema.TaggedStruct("Agent", { agentId: Schema.String }), |
| 11 | Schema.TaggedStruct("System", { name: Schema.String }), |
| 12 | ]); |
| 13 | export type Actor = typeof Actor.Type; |
| 14 | |
| 15 | export const customer = (customerId: string): Actor => ({ |
| 16 | _tag: "Customer", |
| 17 | customerId: CustomerId.make(customerId), |
| 18 | }); |
| 19 | export const agent = (agentId: string): Actor => ({ _tag: "Agent", agentId }); |
| 20 | export const system = (name: string): Actor => ({ _tag: "System", name }); |