# ElizaOS Developer Update - 2025-07-29

## Core Framework

ElizaOS's core framework underwent significant architectural improvements this week, focusing on stability and enhancing plugin system capabilities:

1. **Migration from Node.js EventEmitter to Bun's Native EventTarget API** (PR #5609)
   - Replaced legacy EventEmitter with Bun's native EventTarget for improved runtime compatibility and performance
   - Updated InternalMessageBus and SimpleMigrationAgent classes
   - Added method chaining support to maintain backward compatibility

2. **Module Loading Enhancement** (PR #5629)
   - Implemented a new local-first ModuleLoader with consistent resolution guarantees
   - Fixed critical path resolution issues for global CLI installations
   - Added comprehensive test coverage for module loading scenarios

3. **Action Chaining Capability** (PR #5490)
   - Fixed critical issues in action chaining implementation
   - Enhanced the ActionState provider to store action return values
   - Added proper callback mechanism to send messages to users during action chains

4. **Standard Service Interfaces** (PR #5565)
   - Implemented `getServicesByType()` method for retrieving services by type
   - Added support for multiple services per type with standardized interfaces
   - Created type definitions for browser, email, PDF, post, transcription, video, and web-search services

## New Features

### 1. Plugin Quick Starter Template (PR #5589)

A new streamlined template for creating backend-only plugins without frontend overhead:

```bash
elizaos create my-backend-plugin --type plugin --template quick-starter
```

The quick starter template provides a minimal setup focusing only on plugin logic:

```typescript
// src/plugin.ts
import { AgentRuntime, Service, Plugin, ActionResult } from '@elizaos/core';

export class MyService implements Service {
  constructor(private runtime: AgentRuntime) {}
  
  async initialize(): Promise<void> {
    // Service initialization logic
  }
}

const plugin: Plugin = {
  name: 'my-plugin',
  version: '1.0.0',
  services: [MyService],
  // No frontend dependencies required
};

export default plugin;
```

### 2. Image Generation Action (PR #5446)

Added support for generative image capabilities through the bootstrap plugin:

```typescript
// Example usage in character.ts
const character = {
  name: 'ArtBot',
  systemPrompt: 'You are an AI that creates images based on user descriptions.',
  plugins: [
    '@elizaos/plugin-bootstrap',
    '@elizaos/plugin-openai' // or any image provider
  ]
};

// The agent can now use the new action:
// <actions>GENERATE_IMAGE</actions>
```

### 3. Auto-Resizing Chat Input (PR #5546)

Improved user experience with dynamically resizing chat input:

```typescript
// Implementation in ChatInput.tsx
const resizeTextarea = () => {
  if (internalRef.current) {
    internalRef.current.style.height = 'auto';
    const newHeight = Math.min(
      Math.max(internalRef.current.scrollHeight, MIN_HEIGHT),
      MAX_HEIGHT
    );
    internalRef.current.style.height = `${newHeight}px`;
  }
};
```

## Bug Fixes

### 1. Plugin Action Loading in Deployed Versions (PR #5624)

Fixed a critical issue where plugin actions weren't being received by the runtime when using NPM-deployed packages:

- Root cause: The tsup build configuration was incorrectly excluding plugin actions
- Solution: Updated `tsup.config.ts` in the bootstrap plugin to properly include all action files
- Added automated testing to verify action loading in globally installed CLI contexts

### 2. Prompt Format Consistency (PR #5623)

Completed a comprehensive migration from JSON to XML format for all prompts, improving Large Language Model reliability:

```diff
- const promptTemplate = `{
-   "thought": "Think about the user's question",
-   "actions": "REPLY",
-   "response": "My response to the user"
- }`;
+ const promptTemplate = `
+ <response>
+   <thought>Think about the user's question</thought>
+   <actions>REPLY</actions>
+   <text>My response to the user</text>
+ </response>`;
```

### 3. SQL Base Plugin JSON Handling (PR #5628)

Fixed an issue where raw objects were incorrectly passed to SQL queries:

```typescript
// Before: Raw objects passed directly
await sql`INSERT INTO memories (content, metadata) 
          VALUES (${content}::jsonb, ${metadata}::jsonb)`;

// After: Proper stringification before SQL casting
await sql`INSERT INTO memories (content, metadata) 
          VALUES (${JSON.stringify(content)}::jsonb, ${JSON.stringify(metadata)}::jsonb)`;
```

### 4. Plugin Installation on Windows (PR #5437)

Resolved pathing and resolution issues for plugins on Windows:

- Fixed path normalization to address backslash/forward slash inconsistencies
- Improved localhost resolution for dev command functionality
- Added enhanced error logging for plugin loading failures

## API Changes

1. **ActionResult Interface Updates**:
   - Removed duplicate ActionResult interface definition in `components.ts`
   - Standardized return types to use `Promise<ActionResult>` consistently
   - Added proper error handling with ActionResult type structure

2. **Service Type System**:
   ```typescript
   // New standardized service interfaces
   export interface BrowserService extends Service {
     type: 'browser';
     open(url: string): Promise<void>;
     capture(options?: CaptureOptions): Promise<Buffer>;
   }
   
   export interface EmailService extends Service {
     type: 'email';
     send(options: EmailOptions): Promise<boolean>;
     getEmails(options?: EmailFetchOptions): Promise<Email[]>;
   }
   
   // Getting services by type now supports multiple implementations
   const browserServices = runtime.getServicesByType<BrowserService>('browser');
   ```

3. **Character Import with V1-to-V2 Conversion**:
   - Automatic V1 to V2 character conversion during JSON import
   - Plugin matching based on capabilities (llama_local → @elizaos/plugin-ollama)
   - Support for converting legacy character formats seamlessly

## Social Media Integrations

1. **Twitter Plugin Documentation**:
   - Updated documentation for Twitter plugin with X API requirements
   - Added post examples to default Eliza character to enable Twitter posting functionality:
   ```typescript
   examples: [
     {
       input: "Post a tweet saying 'Hello World!'",
       output: "I've posted your tweet that says 'Hello World!' to your timeline.",
       actions: ["POST"]
     }
   ]
   ```

2. **Plugin Registry Updates**:
   - Added new plugins to the registry:
     - plugin-desearch (PR #187)
     - plugin-coti (PR #193)
     - plugin-bonsai (PR #191)

3. **Discord-Ready Extension**:
   - The core-devs team is developing a browser extension using Chrome's desktopCapture API for Discord call integration
   - Enables AI assistance on Discord calls without requiring separate accounts
   - Uses the same API as Loom for screen/audio capture

## Model Provider Updates

1. **Simplified Model Selection Logic**:
   - Made Ollama plugin integration truly conditional based on environment configuration
   - Improved provider selection prompt to reduce unnecessary provider use
   - Added fallback logic for local models

2. **GLM-4.5 Performance**:
   - Team noted the impressive performance of GLM-4.5, an open-source model outperforming most competitors except Sonnet and Opus

3. **OpenRouter Integration Fix**:
   - Resolved configuration issue with OpenRouter integration
   - Fixed error handling for 400 payment errors
   - Updated recommended model configuration:
   ```
   OPENROUTER_LARGE_MODEL=google/gemini-2.5-pro
   ```

## Breaking Changes

1. **EventTarget Migration**:
   - Code using direct EventEmitter methods may need updates to work with the new EventTarget implementation
   - Custom event handlers should be refactored to use the standardized EventTarget pattern
   - Method chaining with direct `on()` calls will continue to work for backward compatibility

2. **Plugin Loading Path Resolution**:
   - Projects relying on specific plugin loading behavior might need updates
   - The new local-first module resolution takes precedence over global plugins
   - Environment variables like `PGLITE_DATA_DIR` are no longer inherited in nested projects

3. **Service Type System Migration**:
   - Plugin developers should update their service implementations to use the new type system
   - Legacy plugins without type declarations will continue to work but won't be available via `getServicesByType()`
   - Consider migrating to the standardized service interfaces for improved interoperability

The team is also working on upcoming features including "elizacloud" and "clanktank" which will be detailed in future updates. The hackathon has received a final extension as announced by Jin.