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 { describe, expect, it } from 'vitest'; |
| 2 | import { BAKED_TOOLKIT_SLUGS, BAKED_TOOLKIT_SLUGS_REFRESHED_AT } from 'src/generated/toolkit-slugs'; |
| 3 | import { TOOLKIT_SLUG_PATTERN } from 'src/models/toolkits'; |
| 4 | |
| 5 | /** |
| 6 | * Guards the checked-in output of `scripts/generate-toolkit-slugs.ts`. The |
| 7 | * resolver reads this list on every tool execution, so a hand-edit or a bad |
| 8 | * regeneration is a correctness problem, not a cosmetic one. Nothing here |
| 9 | * touches the network — the point is that the CLI does not have to either. |
| 10 | */ |
| 11 | describe('BAKED_TOOLKIT_SLUGS', () => { |
| 12 | it('holds the whole catalog', () => { |
| 13 | expect(BAKED_TOOLKIT_SLUGS.length).toBeGreaterThanOrEqual(1000); |
| 14 | }); |
| 15 | |
| 16 | it('is sorted and free of duplicates', () => { |
| 17 | expect([...BAKED_TOOLKIT_SLUGS]).toEqual([...new Set(BAKED_TOOLKIT_SLUGS)].sort()); |
| 18 | }); |
| 19 | |
| 20 | it('holds only lowercase slugs', () => { |
| 21 | const malformed = BAKED_TOOLKIT_SLUGS.filter(slug => !TOOLKIT_SLUG_PATTERN.test(slug)); |
| 22 | expect(malformed).toEqual([]); |
| 23 | }); |
| 24 | |
| 25 | it('includes staple toolkits', () => { |
| 26 | expect(BAKED_TOOLKIT_SLUGS).toContain('github'); |
| 27 | expect(BAKED_TOOLKIT_SLUGS).toContain('gmail'); |
| 28 | // The multi-word slug behind https://github.com/ComposioHQ/composio/issues/4049. |
| 29 | expect(BAKED_TOOLKIT_SLUGS).toContain('google_analytics'); |
| 30 | }); |
| 31 | |
| 32 | it('records when it was generated', () => { |
| 33 | expect(new Date(BAKED_TOOLKIT_SLUGS_REFRESHED_AT).toISOString()).toBe( |
| 34 | BAKED_TOOLKIT_SLUGS_REFRESHED_AT |
| 35 | ); |
| 36 | }); |
| 37 | }); |