Docket Docs

Plugin Ecosystem

Create, publish, and onboard adapters as npm packages.

Plugin Ecosystem

Docket adapters are just npm packages. Anyone can create one, publish it, and let users install it with npm install and a config line.

The 30-second version

As a developer:

npm install docket-llm-groq

As a user:

adapters:
  llm:
    providers:
      groq:
        adapter: "docket-llm-groq"
        config:
          apiKey: "${GROQ_API_KEY}"

Naming convention

Community plugins should follow this pattern so users can find them and the registry can infer their category:

docket-{category}-{name}
CategoryExample
LLMdocket-llm-groq
Embedderdocket-embedder-cohere
Storedocket-store-qdrant
Blobdocket-blob-s3
Queuedocket-queue-redis

Scoped packages work too:

@myorg/docket-llm-groq

Creating a plugin

1. Scaffold

mkdir docket-llm-groq
cd docket-llm-groq
npm init -y

2. Implement the interface

const { LlmAdapter } = require('docket-core/interfaces/llm-adapter');
 
class GroqLlmAdapter extends LlmAdapter {
  constructor(config) {
    super(config);
    this.client = new Groq({ apiKey: config.apiKey });
  }
 
  async chat(messages, options = {}) {
    const response = await this.client.chat.completions.create({
      model: options.model || this.config.model,
      messages,
      temperature: options.temperature ?? 0.7,
      max_tokens: options.maxTokens
    });
 
    return {
      content: response.choices[0].message.content,
      usage: {
        prompt: response.usage.prompt_tokens,
        completion: response.usage.completion_tokens,
        total: response.usage.total_tokens
      },
      finishReason: response.choices[0].finish_reason,
      model: response.model
    };
  }
 
  async health() {
    // Return { ok, latency, error? }
    return { ok: true, latency: 0 };
  }
 
  static get metadata() {
    return {
      name: 'groq-llm',
      version: '0.1.0',
      description: 'Groq LLM adapter for Docket',
      category: 'llm',
      capabilities: ['chat'],
      docketCompatibility: '>=0.1.0 <0.3.0',
      author: '[email protected]',
      repository: 'https://github.com/you/docket-llm-groq',
      license: 'MIT'
    };
  }
}
 
module.exports = { GroqLlmAdapter };

3. Required metadata fields

FieldTypeRequiredDescription
namestringyesUnique plugin identifier (kebab-case)
versionstringyesSemver version
categoryenumyesllm, embedder, store, blob, or queue
capabilitiesstring[]yesWhat the adapter can do (e.g., ['chat'])
docketCompatibilitystringyesSemver range of supported Docket versions
descriptionstringnoShort human-readable description
authorstringnoAuthor name or email
repositorystringnoURL to source code
licensestringnoSPDX license identifier

4. Publish to npm

npm publish --access public

No special registry needed. Standard npm works.

User onboarding flow

Install the package

npm install docket-llm-groq

Add to config

# config/docket.yaml
adapters:
  llm:
    default: "groq"
    providers:
      groq:
        adapter: "docket-llm-groq"
        config:
          apiKey: "${GROQ_API_KEY}"
          model: "llama3-70b-8192"

Validate without restarting

curl -X POST http://localhost:3001/admin/plugins/validate \
  -H "Content-Type: application/json" \
  -d '{"packageName": "docket-llm-groq"}'

Register at runtime

curl -X POST http://localhost:3001/admin/plugins \
  -H "Content-Type: application/json" \
  -d '{
    "packageName": "docket-llm-groq",
    "config": { "apiKey": "gsk_...", "model": "llama3-70b-8192" }
  }'

Runtime plugin management

The control plane exposes endpoints to manage plugins without editing code:

MethodRoutePurpose
GET/admin/pluginsList registered plugins
POST/admin/plugins/validateValidate a package without registering
POST/admin/pluginsRegister and initialize a plugin
DELETE/admin/plugins/:category/:nameDeregister a plugin

For package authors: best practices

  1. Export a single class — The registry loads the first class-like export it finds.
  2. Implement health() — Return { ok, latency, error? } so the control plane can aggregate status.
  3. Handle missing config gracefully — Throw clear errors in initialize() if required config is missing.
  4. Document config options — Users should know what to put in the config: block.
  5. Pin docketCompatibility — Be honest about which Docket versions you support.
  6. Use semantic versioning — Breaking changes = major version bump.

Coming soon

  • Plugin marketplace — Curated list of community adapters
  • CLI onboardingdocket plugin install groq instead of npm install
  • Verified badge — Adapters that pass extended contract tests
  • Auto-discovery — Scan node_modules for docket-* packages and suggest them