Files

32 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

import { Context } from '@deepseek-ai/cordis'
2026-07-22 23:39:50 +08:00
import { afterEach, describe, expect, it } from 'vitest'
2026-08-13 00:36:22 +08:00
import ToolRuntime from '@deepseek-ai/dsh-tools'
2026-07-22 23:39:50 +08:00
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
2026-08-13 00:36:22 +08:00
import UserQuestionService from '@deepseek-ai/dsh-user-questions'
import { apply } from '../src/index.ts'
2026-07-22 23:39:50 +08:00
let ctx: Context | undefined
afterEach(async () => {
await ctx?.fiber.dispose()
ctx = undefined
})
2026-08-13 00:36:22 +08:00
describe('ui-user-questions node plugin', () => {
it('mounts no model-facing tool', async () => {
2026-07-22 23:39:50 +08:00
ctx = new Context()
await ctx.plugin(SystemPrompt)
2026-08-13 00:36:22 +08:00
await ctx.plugin(ToolRuntime)
await ctx.plugin(UserQuestionService)
2026-07-22 23:39:50 +08:00
await ctx.plugin({ apply }).await()
// Selecting the Web question FEATURE must not hand every agent the tool.
// `ctx.tools.register` on an unscoped host context files into the global
// layer, which merges into every agent's view regardless of the preset
// that composed it — so a two-tool benchmark preset would really present
// three. The `tool-ask-user` row belongs to the presets that want it.
2026-07-22 23:39:50 +08:00
expect(ctx.tools.get('ask_user_question')).toBeUndefined()
})
})