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.0.6
to
1.5.0
+1
-1
dist/index.cjs.map

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @eldrex/plugin-sdk\n * \n * Build DevDiff plugins without touching core.\n * Stable API, semantic versioning, TypeScript-first.\n */\n\nexport interface DiffLine {\n type: \"addition\" | \"deletion\" | \"normal\";\n content: string;\n ln1?: number;\n ln2?: number;\n}\n\nexport interface DiffHunk {\n header: string;\n oldStart: number;\n oldLines: number;\n newStart: number;\n newLines: number;\n lines: DiffLine[];\n}\n\nexport interface ParsedFileDiff {\n oldPath: string | null;\n newPath: string | null;\n isNew: boolean;\n isDeleted: boolean;\n isRename: boolean;\n hunks: DiffHunk[];\n path?: string;\n additions?: number;\n deletions?: number;\n isBinary?: boolean;\n content?: string;\n renamed?: boolean;\n}\n\nexport interface ParsedDiff {\n files: ParsedFileDiff[];\n changes: {\n type: \"addition\" | \"deletion\";\n line: number;\n content: string;\n }[];\n totalAdditions?: number;\n totalDeletions?: number;\n isEmpty?: boolean;\n hasConflicts?: boolean;\n}\n\nexport interface ProjectContext {\n files: string[];\n languages: string[];\n dependencies: Record<string, string>;\n structure: any;\n raw?: string;\n}\n\nexport interface ChangelogResult {\n summary: string;\n impact: \"none\" | \"minor\" | \"major\" | \"breaking\";\n breaking: boolean;\n files: {\n path: string;\n explanation: string;\n }[];\n relatedIssues: string[];\n formattedOutput: string;\n}\n\nexport interface DevDiffError {\n name: string;\n message: string;\n stack?: string;\n}\n\nexport interface ChangedFile {\n path: string;\n status: \"added\" | \"modified\" | \"deleted\" | \"renamed\";\n}\n\nexport interface GitCommit {\n sha: string;\n message: string;\n author: string;\n date: string;\n}\n\nexport interface AIResult {\n summary: string;\n provider: string;\n model: string;\n tokensUsed?: number;\n cost?: number;\n}\n\nexport interface DevDiffStatus {\n sessionActive: boolean;\n providerInfo: string;\n stagedCount: number;\n unstagedCount: number;\n workspacePath: string;\n}\n\nexport interface DevDiffPlugin {\n /** Unique plugin ID */\n id: string;\n \n /** Human-readable name */\n name: string;\n \n /** Semantic version */\n version: string;\n \n /** Brief description */\n description: string;\n \n /** Author info */\n author: {\n name: string;\n email?: string;\n url?: string;\n };\n \n /** Minimum DevDiff version required */\n devdiffVersion: string;\n \n /** Plugin initialization */\n activate?: (context: PluginContext) => Promise<void>;\n \n /** Plugin cleanup */\n deactivate?: () => Promise<void>;\n \n /** Hooks */\n hooks?: {\n /** Called before AI analysis */\n beforeAnalysis?: (diff: ParsedDiff, context: ProjectContext) => Promise<ParsedDiff | void>;\n \n /** Called after AI analysis */\n afterAnalysis?: (changelog: ChangelogResult) => Promise<ChangelogResult | void>;\n \n /** Called on any error */\n onError?: (error: DevDiffError) => Promise<void>;\n \n /** Called when files change */\n onFileChange?: (files: ChangedFile[]) => Promise<void>;\n \n /** Called when a commit is detected */\n onCommit?: (commit: GitCommit) => Promise<void>;\n \n /** Called when AI call completes */\n onAIComplete?: (result: AIResult) => Promise<void>;\n };\n \n /** Custom commands to register */\n commands?: PluginCommand[];\n \n /** Custom configuration schema */\n configSchema?: Record<string, any>;\n}\n\nexport interface PluginContext {\n /** DevDiff version */\n devdiffVersion: string;\n \n /** Workspace path */\n workspacePath: string;\n \n /** Logger instance */\n logger: PluginLogger;\n \n /** Configuration access */\n config: PluginConfig;\n \n /** Storage for plugin data */\n storage: PluginStorage;\n \n /** Notification service */\n notifications: PluginNotifications;\n \n /** Access to DevDiff engine (read-only) */\n engine: {\n getStatus: () => Promise<DevDiffStatus>;\n getProjectContext: () => Promise<ProjectContext>;\n getRecentChanges: (since: string) => Promise<ChangedFile[]>;\n };\n}\n\nexport interface PluginLogger {\n debug(message: string, data?: any): void;\n info(message: string, data?: any): void;\n warn(message: string, data?: any): void;\n error(message: string, error?: Error): void;\n}\n\nexport interface PluginConfig {\n get(key: string): any;\n set(key: string, value: any): Promise<void>;\n}\n\nexport interface PluginStorage {\n get(key: string): Promise<any>;\n set(key: string, value: any): Promise<void>;\n delete(key: string): Promise<void>;\n clear(): Promise<void>;\n}\n\nexport interface PluginNotifications {\n send(message: string, options?: NotificationOptions): Promise<void>;\n sendToChannel(channel: string, message: string): Promise<void>;\n}\n\nexport interface PluginCommand {\n name: string;\n description: string;\n handler: (args: string[]) => Promise<void>;\n}\n\nexport interface NotificationOptions {\n level?: 'info' | 'warning' | 'error';\n channels?: string[];\n title?: string;\n url?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\r\n * @eldrex/plugin-sdk\r\n *\r\n * Build DevDiff plugins without touching core.\r\n * Stable API, semantic versioning, TypeScript-first.\r\n */\r\n\r\nexport interface DiffLine {\r\n type: \"addition\" | \"deletion\" | \"normal\";\r\n content: string;\r\n ln1?: number;\r\n ln2?: number;\r\n}\r\n\r\nexport interface DiffHunk {\r\n header: string;\r\n oldStart: number;\r\n oldLines: number;\r\n newStart: number;\r\n newLines: number;\r\n lines: DiffLine[];\r\n}\r\n\r\nexport interface ParsedFileDiff {\r\n oldPath: string | null;\r\n newPath: string | null;\r\n isNew: boolean;\r\n isDeleted: boolean;\r\n isRename: boolean;\r\n hunks: DiffHunk[];\r\n path?: string;\r\n additions?: number;\r\n deletions?: number;\r\n isBinary?: boolean;\r\n content?: string;\r\n renamed?: boolean;\r\n}\r\n\r\nexport interface ParsedDiff {\r\n files: ParsedFileDiff[];\r\n changes: {\r\n type: \"addition\" | \"deletion\";\r\n line: number;\r\n content: string;\r\n }[];\r\n totalAdditions?: number;\r\n totalDeletions?: number;\r\n isEmpty?: boolean;\r\n hasConflicts?: boolean;\r\n}\r\n\r\nexport interface ProjectContext {\r\n files: string[];\r\n languages: string[];\r\n dependencies: Record<string, string>;\r\n structure: any;\r\n raw?: string;\r\n}\r\n\r\nexport interface ChangelogResult {\r\n summary: string;\r\n impact: \"none\" | \"minor\" | \"major\" | \"breaking\";\r\n breaking: boolean;\r\n files: {\r\n path: string;\r\n explanation: string;\r\n }[];\r\n relatedIssues: string[];\r\n formattedOutput: string;\r\n}\r\n\r\nexport interface DevDiffError {\r\n name: string;\r\n message: string;\r\n stack?: string;\r\n}\r\n\r\nexport interface ChangedFile {\r\n path: string;\r\n status: \"added\" | \"modified\" | \"deleted\" | \"renamed\";\r\n}\r\n\r\nexport interface GitCommit {\r\n sha: string;\r\n message: string;\r\n author: string;\r\n date: string;\r\n}\r\n\r\nexport interface AIResult {\r\n summary: string;\r\n provider: string;\r\n model: string;\r\n tokensUsed?: number;\r\n cost?: number;\r\n}\r\n\r\nexport interface DevDiffStatus {\r\n sessionActive: boolean;\r\n providerInfo: string;\r\n stagedCount: number;\r\n unstagedCount: number;\r\n workspacePath: string;\r\n}\r\n\r\nexport interface DevDiffPlugin {\r\n /** Unique plugin ID */\r\n id: string;\r\n\r\n /** Human-readable name */\r\n name: string;\r\n\r\n /** Semantic version */\r\n version: string;\r\n\r\n /** Brief description */\r\n description: string;\r\n\r\n /** Author info */\r\n author: {\r\n name: string;\r\n email?: string;\r\n url?: string;\r\n };\r\n\r\n /** Minimum DevDiff version required */\r\n devdiffVersion: string;\r\n\r\n /** Plugin initialization */\r\n activate?: (context: PluginContext) => Promise<void>;\r\n\r\n /** Plugin cleanup */\r\n deactivate?: () => Promise<void>;\r\n\r\n /** Hooks */\r\n hooks?: {\r\n /** Called before AI analysis */\r\n beforeAnalysis?: (\r\n diff: ParsedDiff,\r\n context: ProjectContext,\r\n ) => Promise<ParsedDiff | void>;\r\n\r\n /** Called after AI analysis */\r\n afterAnalysis?: (\r\n changelog: ChangelogResult,\r\n ) => Promise<ChangelogResult | void>;\r\n\r\n /** Called on any error */\r\n onError?: (error: DevDiffError) => Promise<void>;\r\n\r\n /** Called when files change */\r\n onFileChange?: (files: ChangedFile[]) => Promise<void>;\r\n\r\n /** Called when a commit is detected */\r\n onCommit?: (commit: GitCommit) => Promise<void>;\r\n\r\n /** Called when AI call completes */\r\n onAIComplete?: (result: AIResult) => Promise<void>;\r\n };\r\n\r\n /** Custom commands to register */\r\n commands?: PluginCommand[];\r\n\r\n /** Custom configuration schema */\r\n configSchema?: Record<string, any>;\r\n}\r\n\r\nexport interface PluginContext {\r\n /** DevDiff version */\r\n devdiffVersion: string;\r\n\r\n /** Workspace path */\r\n workspacePath: string;\r\n\r\n /** Logger instance */\r\n logger: PluginLogger;\r\n\r\n /** Configuration access */\r\n config: PluginConfig;\r\n\r\n /** Storage for plugin data */\r\n storage: PluginStorage;\r\n\r\n /** Notification service */\r\n notifications: PluginNotifications;\r\n\r\n /** Access to DevDiff engine (read-only) */\r\n engine: {\r\n getStatus: () => Promise<DevDiffStatus>;\r\n getProjectContext: () => Promise<ProjectContext>;\r\n getRecentChanges: (since: string) => Promise<ChangedFile[]>;\r\n };\r\n}\r\n\r\nexport interface PluginLogger {\r\n debug(message: string, data?: any): void;\r\n info(message: string, data?: any): void;\r\n warn(message: string, data?: any): void;\r\n error(message: string, error?: Error): void;\r\n}\r\n\r\nexport interface PluginConfig {\r\n get(key: string): any;\r\n set(key: string, value: any): Promise<void>;\r\n}\r\n\r\nexport interface PluginStorage {\r\n get(key: string): Promise<any>;\r\n set(key: string, value: any): Promise<void>;\r\n delete(key: string): Promise<void>;\r\n clear(): Promise<void>;\r\n}\r\n\r\nexport interface PluginNotifications {\r\n send(message: string, options?: NotificationOptions): Promise<void>;\r\n sendToChannel(channel: string, message: string): Promise<void>;\r\n}\r\n\r\nexport interface PluginCommand {\r\n name: string;\r\n description: string;\r\n handler: (args: string[]) => Promise<void>;\r\n}\r\n\r\nexport interface NotificationOptions {\r\n level?: \"info\" | \"warning\" | \"error\";\r\n channels?: string[];\r\n title?: string;\r\n url?: string;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}

@@ -181,3 +181,3 @@ /**

interface NotificationOptions {
level?: 'info' | 'warning' | 'error';
level?: "info" | "warning" | "error";
channels?: string[];

@@ -184,0 +184,0 @@ title?: string;

@@ -181,3 +181,3 @@ /**

interface NotificationOptions {
level?: 'info' | 'warning' | 'error';
level?: "info" | "warning" | "error";
channels?: string[];

@@ -184,0 +184,0 @@ title?: string;

{
"name": "@eldrex/plugin-sdk",
"version": "1.0.6",
"version": "1.5.0",
"description": "SDK for building DevDiff plugins",

@@ -5,0 +5,0 @@ "type": "module",