open-index/open-npm huggingface dataset:
npm package: @lumen-ops/plugin-sdk
Description: Type definitions for Lumen plugins
Latest version: 0.2.0

# @lumen-ops/plugin-sdk

Type definitions for [Lumen](https://github.com/zaidhaan/lumen) plugins.

This package contains only types — no runtime code. Import it in your plugin for a typed `LumenPlugin` contract.

## Install

```bash
npm install --save-dev @lumen-ops/plugin-sdk
# or
bun add -d @lumen-ops/plugin-sdk
```

Declare it as a peer dependency in published plugins:

```json
"peerDependencies": {
  "@lumen-ops/plugin-sdk": "^1.0.0"
}
```

## Usage

```typescript
import type { LumenPlugin } from "@lumen-ops/plugin-sdk"

const plugin: LumenPlugin = {
    name: "my-plugin",
    description: "Does something useful",
    configSchema: [
        { key: "webhookUrl", label: "Webhook URL", type: "secret", required: true },
    ],
    hooks: {
        "task:completed": async (ctx, { task, prUrl }) => {
            const url = ctx.config.webhookUrl as string
            if (!url) return
            await ctx.http(url, {
                method: "POST",
                body: JSON.stringify({ text: `${task.issueKey} done — ${prUrl}` }),
            })
        },
    },
}

export default plugin
```

## Versioning

`@lumen-ops/plugin-sdk` is versioned independently of Lumen. Minor versions (`1.x`) add new hook types or context properties and are backwards-compatible. Major versions change existing interfaces and are rare.

See [docs/plugins.md](../../docs/plugins.md) for the full guide including self-hosting, Docker setup, and all hook/interceptor types.