Files

description, kind
description kind
Define test tools and invoke tool pipelines or selected root registries 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

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 and mount a root registry, such as the native root. Use executeToolFixture for an already-parsed invocation, resolved to the entry ctx.tools.get() returns for the calling scope and, with toolStep, only when that step declared it, executeDefinitionFixture for a definition ctx.tools.get() does not resolve, such as a program binding under a PTC root, or executeModelToolFixture to pass one JSON-encoded call through ctx.tools.execute(). The latter rejects arguments that cannot be JSON-encoded or a batch 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


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.