Commit Graph

2 Commits

  • fix: resolve smoke test failures
    - Fixed memory backend API: getAll() now includes all memory types (lesson, gotcha, pattern, preference, discovery, context, ephemeral)
    - Fixed memory test assertions: use MEMORY_TYPES.LESSON instead of undefined FACT, await retrieve() calls
    - Added getAll() method to JSONBackend for grouped memory access
    - Fixed InMemoryBackend to support all memory types in getAll()
    - Fixed smoke test to properly await async methods and check correct properties
  • feat: massive Ruflo-inspired upgrade — plugin system, multi-agent swarm, hooks, enhanced memory
    New systems (src/plugins/):
      - Plugin.js: lifecycle hooks (onLoad, onUnload, onConfigChange) + BasePlugin
      - PluginManager.js: fault-isolated extension point dispatch with metrics
      - PluginLoader.js: dependency-resolving batch loader with health checks
      - ExtensionPoints.js: 16 standard extension point names
    
    New systems (src/bot/):
      - hooks.js: HookManager with pre/post tool, pre/post AI, session lifecycle
      - memory-backend.js: JSONBackend (typed entries + LRU) + InMemoryBackend (ephemeral with TTL)
    
    New systems (src/agents/):
      - Agent.js: typed agents with capabilities, status tracking
      - Task.js: DAG-compatible tasks with priorities, dependencies, rollback
      - SwarmCoordinator.js: multi-agent orchestration (simple/hierarchical/swarm topologies)
      - agents/index.js: 9 agent roles + AgentOrchestrator
    
    Bot integration (src/bot/index.js):
      - 6 new Ruflo-inspired tools: swarm_spawn, swarm_execute, swarm_distribute, swarm_state, swarm_terminate
      - Plugin system, hook system, swarm initialized in initBot
      - Pre/post tool hooks wired into tool execution
      - Ephemeral + persistent memory backends
      - Agent orchestrator with 9 specialized agent types
      - Graceful shutdown: all systems cleanup, conversation flush, pidfile release
      - Return object exposes pluginManager, swarm, hookManager, memBackend, agentOrchestrator, getState
    
    This brings Ruflo's multi-agent architecture, plugin extensibility, hook-based lifecycle, and typed memory to zCode.