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 { describe, expect, it } from 'vitest'; |
| 2 | import { _test } from 'src/effects/shell-completions'; |
| 3 | |
| 4 | describe('shell-completions', () => { |
| 5 | it('removes fish descriptions from completion commands', () => { |
| 6 | const line = |
| 7 | 'complete -c composio -n "__fish_seen_subcommand_from orgs; and __fish_seen_subcommand_from switch" -l limit -r -f -d \'Max orgs to fetch from API (default: 50)\''; |
| 8 | |
| 9 | expect(_test.sanitizeFishCompletionLine(line)).toBe( |
| 10 | 'complete -c composio -n "__fish_seen_subcommand_from orgs; and __fish_seen_subcommand_from switch" -l limit -r -f' |
| 11 | ); |
| 12 | }); |
| 13 | |
| 14 | it('preserves non-complete fish lines unchanged', () => { |
| 15 | const line = 'function __fish_composio_no_subcommand'; |
| 16 | |
| 17 | expect(_test.sanitizeFishCompletionLine(line)).toBe(line); |
| 18 | }); |
| 19 | |
| 20 | it('drops multiline descriptions before they can break fish parsing', () => { |
| 21 | const line = `complete -c composio -n "__fish_seen_subcommand_from dev" -l alias -r -f -d 'Line one |
| 22 | line two with "quotes" and apostrophe'"'"'s'`; |
| 23 | |
| 24 | expect(_test.sanitizeFishCompletionLine(line)).toBe( |
| 25 | 'complete -c composio -n "__fish_seen_subcommand_from dev" -l alias -r -f' |
| 26 | ); |
| 27 | }); |
| 28 | }); |