Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import type { SessionExperimental } from '../types/toolRouter.types'; |
| 2 | |
| 3 | /** |
| 4 | * Reads the saved Session config most recently applied to a session from a |
| 5 | * create, retrieve, attach or patch response. Copies only `id`. |
| 6 | */ |
| 7 | export const getSourceSessionConfig = (response: { |
| 8 | experimental?: { source_session_config?: { id: string } }; |
| 9 | }): SessionExperimental['sourceSessionConfig'] => { |
| 10 | const source = response.experimental?.source_session_config; |
| 11 | return source ? { id: source.id } : undefined; |
| 12 | }; |