node-plugin.client.spec.ts 854 B

123456789101112131415161718192021222324252627
  1. import { Context } from '@deepseek-ai/cordis'
  2. import { afterEach, describe, expect, it } from 'vitest'
  3. import ToolRuntime from '@deepseek-ai/dsh-tools'
  4. import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
  5. import UserQuestionService from '@deepseek-ai/dsh-user-questions'
  6. import { apply } from '../src/index.ts'
  7. let ctx: Context | undefined
  8. afterEach(async () => {
  9. await ctx?.fiber.dispose()
  10. ctx = undefined
  11. })
  12. describe('ui-user-questions node plugin', () => {
  13. it('mounts no model-facing tool', async () => {
  14. ctx = new Context()
  15. await ctx.plugin(SystemPrompt)
  16. await ctx.plugin(ToolRuntime)
  17. await ctx.plugin(UserQuestionService)
  18. await ctx.plugin({ apply }).await()
  19. // Host UI registration must leave each preset's model-facing tool list intact.
  20. expect(ctx.tools.get('ask_user_question')).toBeUndefined()
  21. })
  22. })