# Conflicts: # docs/config-catalog.md # docs/config-catalog.zh.md # docs/event-producer-consumer.md # docs/event-producer-consumer.zh.md # docs/persistence-catalog.i18n.yaml # docs/persistence-catalog.md # docs/persistence-catalog.zh.md # docs/persistence-schema.json # packages/core/agent-loop/src/agent.ts # packages/core/agent-loop/src/tool-calls.ts # packages/core/agent-loop/tests/tool-updates.spec.ts # packages/core/system-prompt/README.i18n.yaml # packages/core/system-prompt/README.md # packages/core/system-prompt/README.zh.md # packages/core/tool-executor-ptc/src/ptc.ts # packages/core/tool-executor-ptc/tests/ptc.spec.ts # packages/core/tools/README.i18n.yaml # packages/core/tools/README.md # packages/core/tools/README.zh.md # packages/core/tools/src/index.ts # packages/extensions/tool-cordis/src/api-catalog.ts # packages/plan/plan-mode/tests/plan-mode.spec.ts # snapshots/session/cordis-inspect-jsdoc/session.v4.jsonl
description, kind
| description | kind |
|---|---|
| Define test tools and invoke tool pipelines or selected executors in repository tests and benchmarks. | package-library |
@deepseek-ai/dsh-tool-testkit
English | 中文
Summary
Use this package to define content-producing test tools and exercise tool execution without running an Agent turn. Tests and benchmarks import its helpers as a development dependency. Callers own the Cordis context, plugin composition, and teardown.
Table of Contents
- Use this package
- Understand the implementation
- Further Exploration
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
Add @deepseek-ai/dsh-tool-testkit to the consuming package's devDependencies. Define a fixture when the test needs rendered content without a domain-specific result value:
import { defineContentToolFixture } from '@deepseek-ai/dsh-tool-testkit'
const tool = defineContentToolFixture({
name: 'echo',
description: 'Return a test message.',
parameters: {},
execute: async () => [{ type: 'text', text: 'hello' }],
})
Register the returned definition through the caller's tool registry. Use executeToolFixture for an already-parsed invocation, or executeModelToolFixture to pass one JSON-encoded call through the selected executor. The latter requires the caller to mount that executor and rejects arguments that cannot be JSON-encoded or an executor response without a result. See src/index.ts for invocation fields.
Understand the implementation
Implementation internals — click to expand
src/index.ts adapts content blocks into a tool's canonical JSON value and delegates execution to the production pipeline or registry. It creates no context and owns no plugin registrations.
Further Exploration
- Tools package — tool definitions, registry, and execution policy.
- Testing policy — choosing verification for production behavior.
- Test-support group map — sibling test utilities.
Model Experience
None, as these test helpers do not assemble or send model requests.
KV Cache effect
None; the package itself sends no provider request.
Known Limitations and Deferred Work
- Content-array values are test fixtures; product tools declare domain-owned output schemas.
- Direct pipeline execution omits model-batch scheduling. Both execution helpers omit root Session logging; use an Agent turn when verifying the recorded conversation.
- Plugin composition and context disposal remain caller-owned.
Dev Note
Working context for maintainers — click to expand
None.