Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

checkpoint: File edit:

rUvfb4cdc84cefe
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<string, unknown>;
+ config?: Record<string, unknown>;
+}
+
+/**
+ * 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<void>;
+
+ /**
+ * Shutdown the plugin
+ */
+ shutdown(): Promise<void>;
+
+ /**
+ * 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<ClaudeFlowPlugin>;
+ loadFromPackage(packageName: string): Promise<ClaudeFlowPlugin>;
+ loadBuiltin(pluginId: string): Promise<ClaudeFlowPlugin>;
+}