Download web/src/chat/speaker.test.ts from EnergyVenom/patchwise-agent-studio: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/web/src/chat/speaker.test.ts
- Command line
-
hf download hf://spaces/EnergyVenom/patchwise-agent-studio/web/src/chat/speaker.test.ts
-
curl -L -o speaker.test.ts https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/web/src/chat/speaker.test.ts
1.15 kB
| import { describe, expect, it } from 'vitest'; | |
| import { speakerFor } from './speaker'; | |
| describe('who answers in Ask', () => { | |
| it('names the coworker behind the tool', () => { | |
| expect(speakerFor({ tool: 'readiness' }).name).toBe('Scout'); | |
| expect(speakerFor({ tool: 'scenario' }).name).toBe('Test generator'); | |
| expect(speakerFor({ tool: 'run_status' }).name).toBe('Executor'); | |
| expect(speakerFor({ tool: 'failures' }).name).toBe('Triage'); | |
| }); | |
| it('falls back to the first card when the tool is unknown', () => { | |
| expect(speakerFor({ result: { cards: [{ type: 'changes', module: 'P2P', items: [] }], links: [], sources: [] } }).name).toBe('Scout'); | |
| }); | |
| it('actions, help and unknown answers come from the coordinator; Hermes answers as Hermes', () => { | |
| expect(speakerFor({ tool: 'start_run' })).toMatchObject({ kind: 'patchwise', name: 'Astra' }); | |
| expect(speakerFor({ tool: 'help' }).kind).toBe('patchwise'); | |
| expect(speakerFor({})).toMatchObject({ kind: 'patchwise' }); | |
| expect(speakerFor({ by: 'hermes', tool: 'readiness' })).toMatchObject({ kind: 'hermes', name: 'Hermes' }); | |
| }); | |
| }); | |