Testdriver:Events logo

Testdriver:Events

Organization
testdriverai
testdriver:events

Listen to SDK lifecycle events with wildcard support

Overview

Publishertestdriverai
Repositorytestdriverai
Skill nametestdriver:events
Stars
465
Forks
39
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by testdriverai on GitHub. Read the source before you install it.

Installation

Install the Testdriver:Events AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-events
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/testdriverai/testdriverai.git /tmp/testdriverai
mkdir -p .claude/skills
cp -r /tmp/testdriverai/ai/skills/testdriver-events .claude/skills/testdriverai-testdriver-events
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Testdriver:Events in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Testdriver:Events on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Testdriver:Events is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Overview

TestDriver uses EventEmitter2 for its event system. Events use a namespace pattern with colons. They permit wildcard listeners.

Use the emitter through testdriver.emitter:

javascript
testdriver.emitter.on('command:start', (data) => {
  console.log(`Running: ${data.command}`);
});

Configuration

The internal emitter is created with:

javascript
new EventEmitter2({
  wildcard: true,
  delimiter: ':',
  maxListeners: 20,
  verboseMemoryLeak: false,
  ignoreErrors: false,
});

Wildcard Listeners

Use * to match one level. Use ** to match many levels:

javascript
// Match all log events
testdriver.emitter.on('log:*', (message) => {
  console.log(message);
});

// Match all events in any namespace
testdriver.emitter.on('**', (...args) => {
  console.log('Event:', this.event, args);
});

Event Reference

Command Events

Emitted during the execution of SDK commands (click, type, find, etc.).

EventPayload
command:start{ command, depth, data, timestamp, sourcePosition }
command:success{ command, depth, data, duration, response, timestamp, sourcePosition }
command:error{ command, depth, data, error, duration, timestamp, sourcePosition }
command:status{ command, status: "executing", data, depth, timestamp }
command:progress{ command, status: "completed", timing, data, depth, timestamp }
javascript
testdriver.emitter.on('command:start', ({ command, data }) => {
  console.log(`Starting ${command}`, data);
});

testdriver.emitter.on('command:error', ({ command, error, duration }) => {
  console.error(`${command} failed after ${duration}ms: ${error}`);
});

Step Events

Emitted for each AI reasoning step within a command.

EventPayload
step:start{ stepIndex, prompt, commandCount, timestamp, sourcePosition }
step:success{ stepIndex, prompt, commandCount, duration, timestamp, sourcePosition }
step:error{ stepIndex, prompt, error, duration?, timestamp, sourcePosition? }
javascript
testdriver.emitter.on('step:start', ({ stepIndex, prompt }) => {
  console.log(`Step ${stepIndex}: ${prompt}`);
});

Test Events

Emitted when a test file execution starts.

EventPayload
test:start{ filePath, timestamp }
test:successEmitted on test completion
test:errorEmitted on test failure

Log Events

Emitted for all log output from the SDK.

EventPayload
log:log(message: string) — general log message
log:warn(message: string) — warning message
log:debug(message: string) — debug output (only when VERBOSE/DEBUG/TD_DEBUG env set)
log:info(message: string) — informational message
log:error(message: string) — error message
log:narration(message: string, overwrite?: boolean) — in-place status line
log:markdown(markdown: string) — full static markdown content
log:markdown:start(streamId: string) — begin streaming markdown
log:markdown:chunk(streamId: string, chunk: string) — incremental chunk
log:markdown:end(streamId: string) — end streaming markdown
javascript
// Capture all logs
testdriver.emitter.on('log:*', function (message) {
  console.log(`[${this.event}]`, message);
});

Screen Capture Events

Emitted during screenshot capture.

EventPayload
screen-capture:start{ scale, silent, display }
screen-capture:end{ scale, silent, display }
screen-capture:error{ error, scale, silent, display }

Sandbox Events

Emitted for sandbox WebSocket lifecycle and communication.

EventPayload
sandbox:connectedNo payload — WebSocket connection established
sandbox:authenticated{ traceId } — authentication successful
sandbox:error(err: Error | string) — connection or sandbox error
sandbox:sent(message: object) — WebSocket message sent
sandbox:receivedNo payload — successful message reply received
sandbox:progress{ step, message } — sandbox setup progress
javascript
testdriver.emitter.on('sandbox:connected', () => {
  console.log('Connected to sandbox');
});

testdriver.emitter.on('sandbox:progress', ({ step, message }) => {
  console.log(`Sandbox: [${step}] ${message}`);
});

Redraw Events

Emitted during screen stability detection. See Redraw for more details.

EventPayload
redraw:status{ redraw: { enabled, settled, hasChangedFromInitial, consecutiveFramesStable, diffFromInitial, diffFromLast, text }, network: { enabled, settled, rxBytes, txBytes, text }, timeout: { isTimeout, elapsed, max, text } }
redraw:complete{ screenSettled, hasChangedFromInitial, consecutiveFramesStable, networkSettled, isTimeout, timeElapsed }
javascript
testdriver.emitter.on('redraw:complete', (result) => {
  if (result.isTimeout) {
    console.warn('Redraw timed out after', result.timeElapsed, 'ms');
  }
});

File Events

Emitted during file load/save operations in the agent.

EventPayload
file:start{ operation: "load" | "save" | "run", filePath, timestamp }
file:stop{ operation, filePath, duration, success, sourceMap?, reason?, timestamp }
file:load{ filePath, size, timestamp }
file:save{ filePath, size, timestamp }
file:diff{ filePath, diff: { patches, sourceMaps, summary: { additions, deletions, modifications } }, timestamp }
file:error{ operation, filePath, error, duration?, timestamp }

Error Events

Emitted for errors at various severity levels.

EventPayload
error:fatal(error: string | Error) — terminates the process
error:general(message: string) — non-fatal error
error:sandbox(err: Error | string) — sandbox/WebSocket error
javascript
testdriver.emitter.on('error:*', function (err) {
  console.error(`[${this.event}]`, err);
});

SDK Events

Emitted for API request lifecycle.

EventPayload
sdk:request{ path } — outgoing API request
sdk:response{ path } — API response received
sdk:retry{ path, attempt, error, delayMs } — request retry

Other Events

EventPayload
exit(exitCode: number) — 0 for success, 1 for failure
status(message: string) — general status updates
mouse-click{ x, y, button, click, double } — mouse click performed
terminal:stdoutTerminal stdout output
terminal:stderrTerminal stderr output

Practical Examples

Custom Test Reporter

javascript
const results = [];

testdriver.emitter.on('command:success', ({ command, duration }) => {
  results.push({ command, duration, status: 'pass' });
});

testdriver.emitter.on('command:error', ({ command, duration, error }) => {
  results.push({ command, duration, status: 'fail', error });
});

// After test completes
afterAll(() => {
  console.table(results);
});

Progress Monitoring

javascript
testdriver.emitter.on('step:start', ({ stepIndex, prompt }) => {
  process.stdout.write(`\r  Step ${stepIndex}: ${prompt}`);
});

testdriver.emitter.on('command:progress', ({ command, timing }) => {
  process.stdout.write(`\r  ${command} completed in ${timing}ms`);
});

Debug Logging

javascript
// Log every event (verbose)
testdriver.emitter.on('**', function (...args) {
  console.debug(`[EVENT] ${this.event}`, ...args);
});

Types

typescript
interface CommandStartEvent {
  command: string;
  depth: number;
  data: Record<string, any>;
  timestamp: number;
  sourcePosition: SourcePosition;
}

interface CommandSuccessEvent {
  command: string;
  depth: number;
  data: Record<string, any>;
  duration: number;
  response: any;
  timestamp: number;
  sourcePosition: SourcePosition;
}

interface CommandErrorEvent {
  command: string;
  depth: number;
  data: Record<string, any>;
  error: string;
  duration: number;
  timestamp: number;
  sourcePosition: SourcePosition;
}

interface StepStartEvent {
  stepIndex: number;
  prompt: string;
  commandCount: number;
  timestamp: number;
  sourcePosition: SourcePosition;
}

interface StepSuccessEvent {
  stepIndex: number;
  prompt: string;
  commandCount: number;
  duration: number;
  timestamp: number;
  sourcePosition: SourcePosition;
}

interface RedrawStatusEvent {
  redraw: {
    enabled: boolean;
    settled: boolean;
    hasChangedFromInitial: boolean;
    consecutiveFramesStable: number;
    diffFromInitial: number;
    diffFromLast: number;
    text: string;
  };
  network: {
    enabled: boolean;
    settled: boolean;
    rxBytes: number;
    txBytes: number;
    text: string;
  };
  timeout: {
    isTimeout: boolean;
    elapsed: number;
    max: number;
    text: string;
  };
}

interface RedrawCompleteEvent {
  screenSettled: boolean;
  hasChangedFromInitial: boolean;
  consecutiveFramesStable: number;
  networkSettled: boolean;
  isTimeout: boolean;
  timeElapsed: number;
}

interface SandboxProgressEvent {
  step: string;
  message: string;
}

interface SourcePosition {
  file: string;
  line: number;
  column: number;
}

Frequently asked questions

What does the Testdriver:Events AI skill do?

Listen to SDK lifecycle events with wildcard support

Why use Testdriver:Events on TypingMind?

Because you install it once and use it with any model. Testdriver:Events is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Testdriver:Events in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-events. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Testdriver:Events?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Testdriver:Events?

As many as you like. As long as a model supports skills, you can use Testdriver:Events with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Testdriver:Events AI skill free?

It is published on GitHub by testdriverai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇