Sign In

@eldrex/plugin-sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eldrex/plugin-sdk - npm Package Compare versions

Comparing version
1.6.1
to
1.8.0
+69
README.md
# @eldrex/plugin-sdk
## Official Plugin Development SDK for DevDiff
> Build DevDiff plugins without touching core. Stable API, semantic versioning, TypeScript-first.
[![npm version](https://img.shields.io/npm/v/@eldrex/plugin-sdk)](https://npmjs.com/package/@eldrex/plugin-sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
## Installation
```bash
npm install @eldrex/plugin-sdk
```
## Quick Start — Building a Plugin
```typescript
import {
DevDiffPlugin,
PluginContext,
ParsedDiff,
ProjectContext,
ChangelogResult,
} from "@eldrex/plugin-sdk";
export const myPlugin: DevDiffPlugin = {
id: "my-custom-plugin",
name: "My Custom Plugin",
version: "1.0.0",
description: "Extends DevDiff with custom notifications",
author: {
name: "Developer",
url: "https://github.com/example/my-custom-plugin",
},
devdiffVersion: ">=1.0.0",
async activate(context: PluginContext) {
context.logger.info("Plugin activated!");
},
hooks: {
async afterAnalysis(changelog: ChangelogResult) {
console.log(`Changelog generated: ${changelog.summary}`);
return changelog;
},
},
};
export default myPlugin;
```
---
## 🔒 Permissions & Security
Plugins declare permissions in their manifest:
- `network`: Array of allowed domain endpoints.
- `filesystem`: Paths allowed for reading/writing.
- `shell`: Allowed binary operations.
Users can audit declared vs actual plugin behavior via `devdiff plugin audit <plugin-name>`.
---
## License
MIT © DevDiff Contributors
+54
-1
{
"name": "@eldrex/plugin-sdk",
"version": "1.6.1",
"version": "1.8.0",
"description": "SDK for building DevDiff plugins",

@@ -34,2 +34,55 @@ "type": "module",

"license": "MIT",
"devdiff": {
"packageType": "plugin-sdk",
"capabilities": [
"plugin-lifecycle",
"hook-system",
"custom-commands",
"permission-management"
],
"exports": {
"main": "./src/index.ts",
"classes": [
"PluginBase",
"PluginContext",
"PluginStorage",
"PluginLogger"
],
"functions": [
"definePlugin",
"createPlugin",
"registerHook"
],
"types": [
"DevDiffPlugin",
"PluginConfig",
"HookHandler",
"CommandDefinition"
]
},
"dependencies": {
"required": [],
"optional": []
},
"agentContext": {
"purpose": "SDK for building DevDiff plugins. Provides lifecycle hooks, storage APIs, and permission management for extending DevDiff.",
"whenToUse": "When building a plugin that adds new AI providers, output formats, notification channels, or CLI commands to DevDiff.",
"keyConcepts": [
"Plugins extend DevDiff without modifying core",
"Lifecycle hooks for every stage",
"Permission system for security",
"Publishable to npm"
],
"commonPatterns": [
"Define plugin → implement hooks → register commands → publish",
"Hook into beforeAnalysis → modify diff → return enhanced diff",
"Hook into afterAnalysis → send notification → log to external service"
],
"quickStart": {
"install": "npm install @eldrex/plugin-sdk",
"import": "import { definePlugin } from '@eldrex/plugin-sdk';",
"basicUsage": "export default definePlugin({ name: 'my-plugin', version: '1.0.0' });"
}
}
},
"scripts": {

@@ -36,0 +89,0 @@ "build": "tsup",