agent-loop-testkit.spec.ts 767 B

1234567891011121314151617181920
  1. import { describe, expect, it } from 'vitest'
  2. import { Context } from 'cordis'
  3. import AgentLoop from '@deepseek-ai/dsh-agent-loop'
  4. import { renderPrompt } from '@deepseek-ai/dsh-system-prompt'
  5. import { mountAgentLoopTestDependencies } from '../src/index.ts'
  6. describe('dsh-agent-loop-testkit', () => {
  7. it('mounts a configurable prerequisite spine that can activate AgentLoop', async () => {
  8. const ctx = new Context()
  9. await mountAgentLoopTestDependencies(ctx, {
  10. systemPrompt: { persona: 'Test persona.' },
  11. tools: { mode: 'native' },
  12. })
  13. expect(renderPrompt(await ctx.systemPrompt.assemble())).toContain('Test persona.')
  14. await expect(ctx.plugin(AgentLoop, { agents: [] })).resolves.toBeDefined()
  15. await ctx.fiber.dispose()
  16. })
  17. })