Skip to content

Sendo-labs/plugin-sendo-worker

Repository files navigation

@sendo-labs/plugin-sendo-worker

Sendo Worker Plugin - An intelligent orchestrator that dynamically analyzes agent capabilities, executes data collection actions, and generates LLM-powered recommendations.

License: MIT


🎯 Overview

The Sendo Worker plugin transforms ElizaOS agents into intelligent analysts by:

  • Discovering available actions and providers dynamically
  • Categorizing actions via LLM (DATA vs ACTION)
  • Executing analysis actions in parallel
  • Generating comprehensive 4-section analyses via LLM
  • Recommending contextual actions with execution triggers
  • Tracking action execution with async status updates

Key principle: 100% dynamic - zero hardcoded logic. The plugin adapts automatically to any installed plugins.


✨ Features

πŸ” Dynamic Discovery

  • Automatically discovers all available actions and providers
  • LLM-based categorization (DATA vs ACTION)
  • Adapts to new plugins without code changes

⚑ Intelligent Execution

  • Parallel action execution for performance
  • Smart filtering of relevant actions
  • Dynamic trigger message generation via LLM
  • Real runtime integration (no mocks)

πŸ“Š LLM-Powered Analysis

Four comprehensive sections:

  • Wallet Overview: Holdings, balances, recent activity
  • Market Conditions: Trends, sentiment, opportunities
  • Risk Assessment: Exposure, volatility, warnings
  • Opportunities: Actionable insights with data attribution

🎯 Smart Recommendations

  • Context-aware action suggestions
  • Confidence scoring and priority ranking
  • Ready-to-execute trigger messages
  • Estimated impact and gas costs

πŸ”„ Async Execution

  • Non-blocking action execution
  • Real-time status tracking (pending β†’ executing β†’ completed/failed)
  • Result storage with error handling
  • Database persistence

πŸ“¦ Installation

npm install @sendo-labs/plugin-sendo-worker

or with Bun:

bun add @sendo-labs/plugin-sendo-worker

πŸš€ Usage

Basic Setup

import { sendoWorkerPlugin } from '@sendo-labs/plugin-sendo-worker';

const agent = {
  plugins: [
    sendoWorkerPlugin,
    // ... your other plugins
  ],
};

Running Analysis

The plugin exposes REST endpoints for analysis management:

Run Analysis

POST /analysis

Returns a complete analysis with recommendations based on all available plugins.

Get Analyses

GET /analysis

Returns list of recent analyses for the agent.

Get Recommendations

GET /analysis/:analysisId/actions

Returns recommended actions for a specific analysis.

Decide on Actions

POST /actions/decide
Body: {
  decisions: [
    { actionId: "rec-123", decision: "accept" },
    { actionId: "rec-456", decision: "reject" }
  ]
}

Decide on recommended actions:

  • accept: Executes the action asynchronously
  • reject: Marks as rejected without execution

Check Action Status

GET /action/:actionId

Returns current status and result of an action.


πŸ—οΈ Architecture

Service Layer

SendoWorkerService (src/services/sendoWorkerService.ts)

Main orchestrator with these key methods:

  • runAnalysis() - Complete workflow orchestrator
  • categorizeActions() - LLM-based action classification
  • collectProviderData() - Provider data collection
  • selectRelevantDataActions() - Smart action filtering
  • executeAnalysisActions() - Parallel action execution
  • generateAnalysis() - LLM-powered 4-section analysis
  • generateRecommendations() - Context-aware suggestions
  • executeActions() - Async action execution

Database Schema

analysis_results

  • Stores complete analyses with LLM-generated insights
  • Links to plugin attribution

recommended_actions

  • Stores action recommendations
  • Tracks execution status (pending/executing/completed/failed)
  • Stores results and errors

Helpers

actionResult utilities (src/utils/actionResult.ts)

  • getActionResultFromCache() - Retrieve ActionResult from runtime stateCache
  • extractErrorMessage() - Clean error message extraction

πŸ› οΈ Development

Prerequisites

  • Node.js 18+ or Bun
  • PostgreSQL database (for persistence)

Build

bun run build

Watch Mode

bun run dev

Type Checking

bun run typecheck

πŸ“ Project Structure

plugin-sendo-worker/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ services/          # SendoWorkerService (main orchestrator)
β”‚   β”œβ”€β”€ routes/            # REST API endpoints
β”‚   β”œβ”€β”€ schemas/           # Drizzle ORM database schemas
β”‚   β”œβ”€β”€ templates/         # LLM prompt templates
β”‚   β”œβ”€β”€ types/             # TypeScript type definitions
β”‚   β”œβ”€β”€ utils/             # Helper functions
β”‚   └── index.ts           # Plugin export
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── tsup.config.ts

🀝 Contributing

Contributions welcome! Please ensure:

  • Code follows existing patterns
  • Tests pass (when implemented)
  • TypeScript types are correct
  • Documentation is updated

πŸ“„ License

MIT


πŸ”— Related


Built with ❀️ by Sendo Labs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •