Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 04:45 UTC
| 1 | import { Effect } from 'effect'; |
| 2 | import { HOST_CONFIG } from 'src/config'; |
| 3 | |
| 4 | export type MasterKind = 'claude' | 'codex' | 'user'; |
| 5 | |
| 6 | export type MasterSignals = { |
| 7 | readonly codex: boolean; |
| 8 | readonly claude: boolean; |
| 9 | }; |
| 10 | |
| 11 | export const detectMaster = (signals: MasterSignals): MasterKind => { |
| 12 | if (signals.codex) { |
| 13 | return 'codex'; |
| 14 | } |
| 15 | if (signals.claude) { |
| 16 | return 'claude'; |
| 17 | } |
| 18 | return 'user'; |
| 19 | }; |
| 20 | |
| 21 | export const detectMasterFromHost: Effect.Effect<MasterKind> = HOST_CONFIG.MASTER_SIGNALS.pipe( |
| 22 | Effect.orDie, |
| 23 | Effect.map(detectMaster) |
| 24 | ); |