@agent-forge/plugin-test-runner
Test runner capability plugin for Agent Forge, extracted from the host's
src/plugins/test-runner (D-075 S3). It registers one full-control tool, test_run, which asks the host to run a
framework test target (vitest/jest/node-test/pytest) and returns bounded structured results; framework stdout/stderr
stays host-owned.
The plugin has no standalone command binding at load time. Without host-injected command resolver and runner seams the
tool reports an explicit unsupported result; hosts that want real execution bind the per-framework adapters
(createVitestRealTestRunnerAdapterV1, createJestRealTestRunnerAdapterV1, createPytestRealTestRunnerAdapterV1)
against a workspace directory. Readonly hosts get no tool registration at all.
Install
# from a local checkout
agent-forge plugin install ./plugins/test-runner
# from npm
agent-forge plugin install @ai-agent-forge/plugin-test-runner
The package ships two manifests: agent-forge.json (ecosystem manifest for the deterministic plugin resolver) and
plugin.json (host-load manifest consumed by loadCapabilityPluginFromManifest, entry ./dist/entry.js).
Library surface
import { createNodeTestRunnerAdapterV1, createTestRunnerCapabilityFactoryV1 } from "@agent-forge/plugin-test-runner";
createNodeTestRunnerAdapterV1(options?)— host-injection adapter; requirescommandResolver/runnerto produce results, otherwise returnsunsupported.createDeterministicTestRunnerAdapterV1(fixtures)— deterministic fixture adapter for tests.createVitestRealTestRunnerAdapterV1({ workspaceDirectory })/ Jest / pytest variants — real per-framework runners with JSON/JUnit report parsing.createTestRunnerCapabilityFactoryV1(adapter)— registerstest_runon a full-controlCapabilityAPI.- Default export of
dist/entry.js— the precomposed factory used by external plugin loading.
Development
npm install --ignore-scripts # repo root, creates the workspace symlink
npm run build # plugins/test-runner (tsgo)
npm test # vitest; the entry fidelity test requires `npm run build` first