Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

@elizaos/plugin-tlon

Tlon/Urbit integration plugin for elizaOS agents. This plugin enables agents to communicate via the Urbit network using the Tlon messaging protocol.

Features

  • Direct Messages (DMs): Send and receive direct messages with other Urbit ships
  • Group Channels: Participate in group chat channels
  • Thread Replies: Reply to specific messages in threads
  • Real-time Streaming: SSE-based real-time message streaming
  • Channel Authorization: Control which ships can interact with your agent
  • Auto-discovery: Automatically discover available channels

Installation

# TypeScript
npm install @elizaos/plugin-tlon

# Python
pip install elizaos-plugin-tlon

# Rust
cargo add elizaos-plugin-tlon

Configuration

Environment Variables

Variable Required Description
TLON_SHIP Yes Your Urbit ship name (e.g., ~sampel-palnet)
TLON_URL Yes URL of your Urbit ship's HTTP API
TLON_CODE Yes Authentication code from +code in dojo
TLON_ENABLED No Enable/disable the plugin (default: true)
TLON_GROUP_CHANNELS No JSON array of channel nests to monitor
TLON_DM_ALLOWLIST No JSON array of ships allowed to send DMs
TLON_AUTO_DISCOVER_CHANNELS No Auto-discover channels (default: true)

Example Configuration

TLON_SHIP=~sampel-palnet
TLON_URL=https://sampel-palnet.tlon.network
TLON_CODE=lidlut-tabwed-pillex-ridrup
TLON_ENABLED=true
TLON_GROUP_CHANNELS=["chat/~host-ship/channel-name"]
TLON_DM_ALLOWLIST=["~zod", "~bus"]
TLON_AUTO_DISCOVER_CHANNELS=true

Usage

TypeScript

import tlonPlugin, { TlonService } from '@elizaos/plugin-tlon';

// Add to your agent's plugins
const agent = {
  plugins: [tlonPlugin],
  // ...
};

// Or use the service directly
const service = new TlonService(runtime);
await TlonService.start(runtime);

// Send a DM
await service.sendDirectMessage('~sampel-palnet', 'Hello from my agent!');

// Send a channel message
await service.sendChannelMessage(
  'chat/~host-ship/channel-name',
  'Hello channel!',
  'optional-reply-to-id'
);

Python

from elizaos_plugin_tlon import TlonService, TlonConfig

# Create configuration
config = TlonConfig.from_env()

# Or configure manually
config = TlonConfig(
    ship="sampel-palnet",
    url="https://sampel-palnet.tlon.network",
    code="lidlut-tabwed-pillex-ridrup",
)

# Start the service
service = TlonService(config)
await service.start()

# Send messages
await service.send_dm("~other-ship", "Hello!")
await service.send_channel_message("chat/~host/channel", "Hello channel!")

# Register message handlers
@service.on_message
def handle_message(payload):
    print(f"Received: {payload.text} from {payload.from_ship.name}")

Rust

use elizaos_plugin_tlon::{TlonConfig, TlonService};

// Create configuration
let config = TlonConfig::from_env()?;

// Or configure manually
let config = TlonConfig::new(
    "sampel-palnet".to_string(),
    "https://sampel-palnet.tlon.network".to_string(),
    "lidlut-tabwed-pillex-ridrup".to_string(),
);

// Start the service
let mut service = TlonService::new(config);
service.start().await?;

// Send messages
service.send_dm("other-ship", "Hello!").await?;
service.send_channel_message("chat/~host/channel", "Hello!", None).await?;

Urbit Concepts

Ships

Urbit ships are identified by their @p names, which look like ~sampel-palnet. Ships can be:

  • Galaxies: 8-bit names like ~zod
  • Stars: 16-bit names like ~marzod
  • Planets: 32-bit names like ~sampel-palnet
  • Moons: 64-bit names derived from planets

Channels

Tlon organizes messages into channels. Channel nests follow the format:

<type>/<host-ship>/<channel-name>

For example: chat/~sampel-palnet/general

Authentication

To get your authentication code:

  1. Open your ship's dojo
  2. Run +code
  3. Copy the resulting code (e.g., lidlut-tabwed-pillex-ridrup)

API Reference

TlonService

The main service class for interacting with Tlon/Urbit.

Methods

  • start() - Start the service and connect to the Urbit ship
  • stop() - Stop the service and disconnect
  • sendDirectMessage(ship, text) - Send a DM to a ship
  • sendChannelMessage(channelNest, text, replyToId?) - Send a message to a channel
  • isConnected() - Check if the service is connected

TlonClient

Lower-level HTTP API client for direct Urbit interaction.

Methods

  • authenticate(url, code) - Authenticate with a ship
  • subscribe(params) - Subscribe to an app's path
  • poke(params) - Send a poke to an app
  • scry(path) - Perform a read-only query
  • connect() - Connect and start receiving events
  • close() - Close the connection

Events

The plugin emits the following events:

Event Description
TLON_WORLD_CONNECTED Successfully connected to ship
TLON_WORLD_LEFT Disconnected from ship
TLON_MESSAGE_RECEIVED Any message received
TLON_DM_RECEIVED Direct message received
TLON_GROUP_MESSAGE_RECEIVED Group channel message received
TLON_CONNECTION_ERROR Connection error occurred
TLON_RECONNECTED Successfully reconnected

Development

# Build all implementations
npm run build

# Run tests
npm run test

# TypeScript only
npm run build:ts
npm run test:ts

# Rust only
npm run build:rust
npm run test:rust

# Python only
npm run build:python
npm run test:python

License

MIT

Metadata

Release files for elizaos-plugin-tlon 2.0.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elizaos-plugin-tlon 2.0.0a5
File Size Uploaded
elizaos_plugin_tlon-2.0.0a5.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elizaos-plugin-tlon 2.0.0a5
File Interpreter ABI Platform
elizaos_plugin_tlon-2.0.0a5-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 kB

Release files / elizaos_plugin_tlon-2.0.0a5.tar.gz

Download URL elizaos_plugin_tlon-2.0.0a5.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fa99afc3b24c36a818be8229afee39b8d4569711669ff016bcf401cbd7ea07e3
BLAKE2b-256 checksum
How to use checksums
92085d90278399fee02ccb9e9874bd02922db49b1d48ca97ba91a428119d223d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / elizaos_plugin_tlon-2.0.0a5-py3-none-any.whl

Download URL elizaos_plugin_tlon-2.0.0a5-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4de13f5ea1f96d9afacfa38f68802366772b05dfab333351551a1104681904b8
BLAKE2b-256 checksum
How to use checksums
1f7b9a32407940725f93914924a9d5d0e1a6b8ef7fe187dca1246d40386d717b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

2.0.0a5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page