Skip to main content

Overview

The @hyperscape/plugin-hyperscape package enables AI agents to play Hyperscape autonomously using ElizaOS:
  • Agent actions (combat, skills, movement)
  • World state providers
  • LLM decision-making via OpenAI/Anthropic/OpenRouter
  • Full player capabilities

Package Location

Type System (PR #629): The plugin now defines core types locally instead of importing from @hyperscape/shared to resolve 70+ TypeScript build errors. This ensures compatibility with ElizaOS’s isolatedModules requirement.

Actions

Agent capabilities are defined in src/actions/:

Action Categories

New Actions in 1.7

PICKUP_ITEM: Pick up items from the ground with smart matching
  • Word-boundary scoring prevents false matches
  • Auto-walks to items beyond pickup range
  • Handles server’s 200-tile movement limit
DROP_ITEM Enhancements:
  • “Drop all” support for entire inventory
  • “Drop all <type>” for specific item types
  • Safety limits (max 50 items)
  • Consecutive failure protection

Providers

World state is accessible to agents via 6 providers:

Configuration

Running

This starts ElizaOS alongside the game server. The AI agent connects as a real player and plays autonomously.

Agent Architecture

Dependencies

Type System

Breaking Change (PR #629): The plugin now uses local type definitions instead of importing from @hyperscape/shared to fix TypeScript build errors with isolatedModules.

Local Type Definitions

Core types are defined in src/types/core-types.ts:

Why Local Types?

The plugin uses isolatedModules: true (required by ElizaOS), which prevents importing class values as types. Local type definitions solve this by:
  1. Importing THREE types directly from 'three' package
  2. Defining PhysX types locally (PxVec3, PxTransform, PxQuat)
  3. Using InstanceType<typeof WorldClass> for World type
  4. Defining Entity, Player, System interfaces locally
This approach ensures the plugin builds successfully while maintaining type safety and compatibility with ElizaOS.

Building

Dashboard Features

The ElizaOS 1.7 upgrade includes comprehensive dashboard improvements:

Quick Action Menu

One-click commands for common tasks:
  • 🪓 Woodcutting - Chop nearest tree
  • ⛏️ Mining - Mine nearest ore
  • 🎣 Fishing - Fish at nearest spot
  • ⚔️ Combat - Attack nearest enemy
  • 📦 Pick Up - Pick up nearby items
  • 🏦 Bank - Go to bank
  • ⏹️ Stop - Stop current goal immediately
  • ⏸️ Idle - Set agent to idle mode

Stop/Resume Goal Controls

Stop Button: Halts agent and prevents auto-goal setting
  • Immediate halt - cancels movement path
  • Paused state UI - shows “Goals Paused”
  • Blocks auto-goals - SET_GOAL actions blocked while paused
  • Chat commands still work - user can send commands
  • Pause persists - agent returns to idle after commands
API Endpoints:

Dashboard Panels

AgentSummaryCard: Quick overview with combat level, total level, current goal AgentGoalPanel: Goal progress with time estimates and XP rates AgentSkillsPanel: Skill levels with session XP tracking AgentActivityPanel: Recent actions and session stats AgentPositionPanel: Location with nearby POIs and zone detection

Rate Limiting Improvements

Dashboard polling intervals increased to prevent 429 errors:
  • AgentSummaryCard: 2s → 10s
  • AgentGoalPanel: 2s → 10s
  • AgentSkillsPanel: 2-5s → 10s
  • AgentActivityPanel: 3s → 10s
  • AgentPositionPanel: 1-3s → 5-10s
All API calls include retry logic with exponential backoff (1s → 2s → 4s).

Key Files

API Endpoints

Agent Management

Data Endpoints

License

MIT License - can be used in any ElizaOS agent.