| 1 | import * as Layer from "effect/Layer"; |
| 2 | |
| 3 | import * as ClaudeAdapterV2 from "../orchestration-v2/Adapters/ClaudeAdapterV2.ts"; |
| 4 | import * as CodexAdapterV2 from "../orchestration-v2/Adapters/CodexAdapterV2.ts"; |
| 5 | import * as CursorAgentSdk from "@t3tools/provider-cursor/server/CursorAgentSdk"; |
| 6 | import * as CursorSdk from "@t3tools/provider-cursor/server/CursorSdk"; |
| 7 | import * as CursorKeychain from "@t3tools/provider-cursor/server/CursorKeychain"; |
| 8 | import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; |
| 9 | import * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests"; |
| 10 | |
| 11 | export type ProviderOrchestrationAdapterInfrastructure = |
| 12 | | ClaudeAdapterV2.ClaudeAgentSdkQueryRunner |
| 13 | | CodexAdapterV2.CodexAppServerClientFactory |
| 14 | | CursorAgentSdk.CursorAgentSdkRunner |
| 15 | | CursorSdk.CursorSdk |
| 16 | | CursorKeychain.CursorKeychain |
| 17 | | IdAllocator.IdAllocatorV2; |
| 18 | |
| 19 | /** |
| 20 | * Infrastructure shared by the V2 adapters materialized inside provider |
| 21 | * instances. `providerContinuationRequestsLayer` must be the same layer |
| 22 | * reference the orchestration runtime provides to its continuation worker so |
| 23 | * Effect layer memoization yields one shared queue. |
| 24 | */ |
| 25 | export const layer = Layer.mergeAll( |
| 26 | ClaudeAdapterV2.layerQueryRunner, |
| 27 | CodexAdapterV2.layerAppServerClientFactory, |
| 28 | CursorAgentSdk.layer.pipe(Layer.provideMerge(CursorSdk.layer)), |
| 29 | CursorKeychain.layer, |
| 30 | IdAllocator.layer, |
| 31 | ProviderContinuationRequests.layer, |
| 32 | ); |