# ElizaOS Developer Update
**Week of June 19 - June 26, 2025**

## 1. Core Framework

### Plugin Architecture Transformation
We've completed a major architectural shift from project-scoped to agent-scoped plugins in ElizaOS V2. This change enables different plugins for different characters, providing much greater flexibility for agent configurations. The transformation involved significant code changes (+3954/-1881 lines) and required updating the runtime to properly handle character-specific plugin loading.

```javascript
// Previous approach (project-scoped plugins in package.json)
{
  "dependencies": {
    "@elizaos/plugin-openai": "^1.0.3",
    "@elizaos/plugin-knowledge": "^1.0.1",
    // All plugins shared across all agents
  }
}

// New approach (agent-scoped plugins in character definition)
{
  name: 'Herbert',
  plugins: [
    '@elizaos/plugin-sql',
    '@elizaos/plugin-openai',
    '@elizaos/plugin-knowledge',
    // Plugins specific to this character
  ],
  // rest of character config
}
```

### Directory Structure Standardization
We've centralized all CLI-generated data under a hidden `.eliza` folder in the project root, improving organization and making cleanup easier. This refactoring also unified directory detection logic across the codebase, eliminating duplication and ensuring consistent behavior across all CLI commands.

### Type System Improvements
Split the monolithic `types.ts` into granular files for better organization and maintainability. Added comprehensive type definitions with full TypeScript support through a new dedicated `@elizaos/api-client` package. Implemented Zod-based character validation with safe JSON parsing to ensure configuration integrity.

## 2. New Features

### Type-Safe API Client Package
Added a new `@elizaos/api-client` package providing a comprehensive type-safe client for the ElizaOS server API.

```typescript
// Example usage of the new type-safe API client
import { AgentsService } from '@elizaos/api-client';

const agentsService = new AgentsService();
const agents = await agentsService.getAgents();

// Type-safe agent operations
const agent = await agentsService.getAgent(agentId);
await agentsService.updateAgent(agentId, {
  name: "Updated Agent Name",
  enabled: true
});
```

### Plain Text File Support in GUI
Added support for user-uploaded plain text (.txt) files in the GUI, expanding the types of knowledge that can be shared with agents.

```typescript
// Example of handling text file uploads
const handleTextContent = async (file) => {
  const textContent = await file.text();
  return {
    type: "text/plain",
    content: textContent,
    description: `Text content from ${file.name}`,
  };
};
```

### Improved Attachment Handling
Enhanced attachment processing to support local image URLs and include descriptions in prompts, providing better context for agents.

```typescript
// New attachment processing logic with local image support
const processAttachments = (attachments) => {
  return attachments.map(attachment => {
    const isLocalImage = attachment.url && !attachment.url.startsWith('http');
    const fullUrl = isLocalImage ? `${baseUrl}/${attachment.url}` : attachment.url;
    
    return {
      ...attachment,
      url: fullUrl,
      description: attachment.description || `Image: ${attachment.filename || 'unnamed'}`
    };
  });
};
```

### Google Generative AI Support
Added Gemini (Google Generative AI) as a supported AI provider option in the ElizaOS CLI, expanding the available model providers.

## 3. Bug Fixes

### Critical Upload Functionality Issues
Fixed upload functionality by completing the migration from express-fileupload to multer, resolving the "Unexpected end of form" errors during document uploads.

```typescript
// Updated multer configuration for file uploads
const upload = multer({
  storage: multer.memoryStorage(),
  limits: {
    fileSize: 50 * 1024 * 1024, // 50MB limit
  }
});

// Proper endpoint handling with multer
router.post('/upload', upload.single('file'), async (req, res) => {
  try {
    // File is available as req.file
    const fileBuffer = req.file.buffer;
    const fileName = req.file.originalname;
    
    // Process file...
    
    res.json({ success: true });
  } catch (error) {
    res.status(500).json({ success: false, error: error.message });
  }
});
```

### Agent Response Issues
Fixed an issue where agents wouldn't properly respond in Direct Message channels, ensuring messages are correctly filtered by channelId. Also resolved a problem where the GUI would get stuck in "agent is thinking" state when the response failed or was empty.

### Memory Display Problems
Fixed the issue where memory entries were duplicated in the dropdown when the last memory was removed or a new agent was created.

### Environment Loading
Fixed global environment variable loading for default ElizaOS agents and ensured that environment variables are properly loaded before the agent project, resolving configuration issues.

## 4. API Changes

### Reorganized API Routes
Completely restructured the `/packages/cli/src/server/api/` directory into logical domain-based organization:

```
/api
  /agents
  /channels
  /messages
  /memory
  /knowledge
  /audio
  /system
```

### New Agent Settings Management
Added comprehensive API endpoints for managing agent settings, including environment variables and configuration.

```typescript
// Example of the new agent settings API
const updateAgentSettings = async (agentId, settings) => {
  return await fetch(`/api/agents/${agentId}/settings`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(settings),
  }).then(res => res.json());
};
```

### Channel Management API
Added API endpoints for managing channels, making it easier to programmatically create and modify communication channels.

## 5. Social Media Integrations

### Twitter Plugin Status
The Twitter plugin is currently undergoing maintenance. We've updated environment variables to replace legacy username/password-based authentication with API-based authentication using Twitter API keys, tokens, and secrets.

```
# New Twitter environment variables
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET=your_api_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_SECRET=your_access_secret
TWITTER_BEARER_TOKEN=your_bearer_token
```

### Venice Plugin Updates
The Venice plugin received a significant update (v1.0.13) with:
- Image support for visual processing
- Text-to-speech capabilities for audio responses
- Removal of OpenAI dependency for embeddings

## 6. Model Provider Updates

### Google Generative AI (Gemini)
Added support for Google's Gemini models as a new AI provider option in the ElizaOS CLI, expanding beyond the previously supported OpenAI, Anthropic, and Local AI options.

### OpenRouter Configuration
Improved OpenRouter plugin configuration with better embedding support. For proper functionality, place the OpenRouter plugin before OpenAI in your configuration as OpenRouter doesn't provide embeddings on its own.

### Ollama Integration
Added Ollama as a fourth AI provider option in the `elizaos create` command, with improved model selection and configuration options.

## 7. Breaking Changes

### Plugin Architecture Migration
When migrating from V1 to V2, you'll need to update your character files to include plugins directly rather than relying on project-level dependencies. For example:

```javascript
// V1: Plugins defined in package.json dependencies
// V2: Update your character file to include:
{
  name: 'MyAgent',
  plugins: [
    '@elizaos/plugin-bootstrap',
    '@elizaos/plugin-sql',
    '@elizaos/plugin-openai',
    '@elizaos/plugin-knowledge'
  ],
  // rest of character config
}
```

### Directory Structure Changes
ElizaOS V2 centralizes all generated data in the `.eliza` folder. When migrating, you may need to relocate or recreate any custom data previously stored in other locations.

### API Client Usage
If you've built custom integrations using the ElizaOS API directly, you'll need to update to use the new `@elizaos/api-client` package for type-safe API operations:

```typescript
// V1: Direct API calls
await fetch(`/api/agents/${agentId}`)

// V2: Type-safe client
import { AgentsService } from '@elizaos/api-client';
const agentsService = new AgentsService();
const agent = await agentsService.getAgent(agentId);
```

Remember to update any Docker configurations to use the new directory structure and ensure all necessary plugins are included in your character definitions when migrating to V2.