| 1 | import type { ThreadId } from "@t3tools/contracts"; |
| 2 | import * as KeyedLock from "@t3tools/shared/KeyedLock"; |
| 3 | import * as Context from "effect/Context"; |
| 4 | import * as Layer from "effect/Layer"; |
| 5 | |
| 6 | /** Shared by thread commands and project deletion so both plan against current thread state. */ |
| 7 | export class ThreadCommandExecutor extends Context.Service< |
| 8 | ThreadCommandExecutor, |
| 9 | KeyedLock.KeyedLock<ThreadId> |
| 10 | >()("t3/orchestration-v2/ThreadCommandExecutor") {} |
| 11 | |
| 12 | export const layer = Layer.effect(ThreadCommandExecutor, KeyedLock.make<ThreadId>()); |