From fb4cdc84cefeb8c4e4504faee213d9cefbb4732d Mon Sep 17 00:00:00 2001 From: rUv Date: Sun, 4 Jan 2026 23:51:38 +0000 Subject: [PATCH] checkpoint: File edit: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🚀 Generated with [Claude Code](https://claude.com/claude-code) 📊 V3 Development Progress Checkpoint Co-Authored-By: Claude Sonnet 4 --- v3/@claude-flow/shared/src/index.ts | 1 + v3/@claude-flow/shared/src/plugins/index.ts | 34 ++++++ v3/@claude-flow/shared/src/plugins/types.ts | 108 ++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 v3/@claude-flow/shared/src/plugins/index.ts create mode 100644 v3/@claude-flow/shared/src/plugins/types.ts diff --git a/v3/@claude-flow/shared/src/index.ts b/v3/@claude-flow/shared/src/index.ts index 5e2fedb041..44d739412a 100644 --- a/v3/@claude-flow/shared/src/index.ts +++ b/v3/@claude-flow/shared/src/index.ts @@ -18,6 +18,7 @@ export * from './events/index.js'; export * from './plugin-interface.js'; export * from './plugin-loader.js'; export * from './plugin-registry.js'; +export * from './plugins/index.js'; // Re-export from submodules for convenience export * from './types/index.js'; diff --git a/v3/@claude-flow/shared/src/plugins/index.ts b/v3/@claude-flow/shared/src/plugins/index.ts new file mode 100644 index 0000000000..9ae916f851 --- /dev/null +++ b/v3/@claude-flow/shared/src/plugins/index.ts @@ -0,0 +1,34 @@ +/** + * Plugins System - ADR-004 Implementation + * + * Plugin architecture for extending Claude Flow functionality. + * + * @module v3/shared/plugins + */ + +// Types +export type { + PluginConfig, + PluginContext, + PluginEvent, + PluginEventHandler, + ClaudeFlowPlugin, + PluginMetadata, + IPluginRegistry, + IPluginLoader, +} from './types.js'; + +// Official Plugins +export { + HiveMindPlugin, + createHiveMindPlugin, + type HiveMindConfig, + type CollectiveDecision, + type EmergentPattern, + MaestroPlugin, + createMaestroPlugin, + type MaestroConfig, + type WorkflowStep, + type Workflow, + type OrchestrationResult, +} from './official/index.js'; diff --git a/v3/@claude-flow/shared/src/plugins/types.ts b/v3/@claude-flow/shared/src/plugins/types.ts new file mode 100644 index 0000000000..e7ed9aa35e --- /dev/null +++ b/v3/@claude-flow/shared/src/plugins/types.ts @@ -0,0 +1,108 @@ +/** + * Plugin Types - ADR-004 Implementation + * + * Type definitions for the plugin system. + * + * @module v3/shared/plugins/types + */ + +import type { HookRegistry } from '../hooks/index.js'; + +/** + * Plugin configuration base + */ +export interface PluginConfig { + enabled: boolean; + [key: string]: unknown; +} + +/** + * Plugin context provided during initialization + */ +export interface PluginContext { + hooks?: HookRegistry; + services?: Record; + config?: Record; +} + +/** + * Plugin lifecycle events + */ +export type PluginEvent = 'initialized' | 'shutdown' | 'error'; + +/** + * Plugin event handler + */ +export type PluginEventHandler = (event: PluginEvent, data?: unknown) => void; + +/** + * Claude Flow Plugin Interface + * + * All plugins must implement this interface. + */ +export interface ClaudeFlowPlugin { + /** Unique plugin identifier */ + readonly id: string; + + /** Human-readable name */ + readonly name: string; + + /** Plugin version */ + readonly version: string; + + /** Plugin description */ + readonly description: string; + + /** Dependencies on other plugins */ + readonly dependencies?: string[]; + + /** + * Initialize the plugin + * @param context Plugin context with hooks and services + */ + initialize(context: PluginContext): Promise; + + /** + * Shutdown the plugin + */ + shutdown(): Promise; + + /** + * Optional event handler + */ + onEvent?: PluginEventHandler; +} + +/** + * Plugin metadata + */ +export interface PluginMetadata { + id: string; + name: string; + version: string; + description: string; + author?: string; + license?: string; + homepage?: string; + dependencies?: string[]; +} + +/** + * Plugin registry + */ +export interface IPluginRegistry { + register(plugin: ClaudeFlowPlugin): void; + unregister(pluginId: string): void; + get(pluginId: string): ClaudeFlowPlugin | undefined; + getAll(): ClaudeFlowPlugin[]; + isRegistered(pluginId: string): boolean; +} + +/** + * Plugin loader interface + */ +export interface IPluginLoader { + loadFromPath(path: string): Promise; + loadFromPackage(packageName: string): Promise; + loadBuiltin(pluginId: string): Promise; +}