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 ComposioClient from '@composio/client'; |
| 2 | import type { ComposioRequestOptions } from '../types/requestOptions.types'; |
| 3 | import type { ToolRouterSessionDeleteResponse } from '../types/toolRouter.types'; |
| 4 | import { ToolRouterSessionDeleteResponseSchema } from '../types/toolRouter.types'; |
| 5 | import { withCancellation } from '../utils/cancellation'; |
| 6 | |
| 7 | export async function deleteToolRouterSession( |
| 8 | client: ComposioClient, |
| 9 | sessionId: string, |
| 10 | requestOptions?: ComposioRequestOptions |
| 11 | ): Promise<ToolRouterSessionDeleteResponse> { |
| 12 | const response = await withCancellation( |
| 13 | () => client.toolRouter.session.delete(sessionId, requestOptions), |
| 14 | requestOptions?.signal |
| 15 | ); |
| 16 | |
| 17 | return ToolRouterSessionDeleteResponseSchema.parse({ |
| 18 | sessionId: response.session_id, |
| 19 | deleted: response.deleted, |
| 20 | }); |
| 21 | } |