@elizaos/plugin-roblox 2.0.0-alpha.7 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.md +186 -0
- package/dist/actions/executeGameAction.d.ts.map +1 -1
- package/dist/actions/executeRobloxAction.d.ts +4 -0
- package/dist/actions/executeRobloxAction.d.ts.map +1 -0
- package/dist/actions/getPlayerInfo.d.ts.map +1 -1
- package/dist/actions/index.d.ts +2 -4
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/robloxAction.d.ts +4 -0
- package/dist/actions/robloxAction.d.ts.map +1 -0
- package/dist/actions/sendGameMessage.d.ts.map +1 -1
- package/dist/actions/sendRobloxMessage.d.ts +4 -0
- package/dist/actions/sendRobloxMessage.d.ts.map +1 -0
- package/dist/generated/specs/specs.d.ts +1 -18
- package/dist/generated/specs/specs.d.ts.map +1 -1
- package/dist/index.js +443 -518
- package/dist/index.js.map +9 -11
- package/dist/providers/gameStateProvider.d.ts.map +1 -1
- package/dist/providers/robloxPlayerProvider.d.ts +3 -0
- package/dist/providers/robloxPlayerProvider.d.ts.map +1 -0
- package/dist/services/RobloxService.d.ts +0 -4
- package/dist/services/RobloxService.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/config.d.ts +0 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +10 -17
package/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 elizaOS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# @elizaos/plugin-roblox
|
|
2
|
+
|
|
3
|
+
Roblox plugin for elizaOS v2.0.0 - Enables AI agents to communicate with Roblox games via the Open Cloud API.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Messaging Service**: Cross-server communication with Roblox games
|
|
8
|
+
- **DataStore Operations**: Persistent data storage for agents
|
|
9
|
+
- **Player Management**: Look up player information by ID or username
|
|
10
|
+
- **Game Actions**: Execute custom actions in-game
|
|
11
|
+
- **Experience Info**: Retrieve game metadata and statistics
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### TypeScript
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @elizaos/plugin-roblox
|
|
19
|
+
# or
|
|
20
|
+
bun add @elizaos/plugin-roblox
|
|
21
|
+
```
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### TypeScript (elizaOS)
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { robloxPlugin } from "@elizaos/plugin-roblox";
|
|
28
|
+
|
|
29
|
+
// Add to your agent configuration
|
|
30
|
+
const agent = {
|
|
31
|
+
plugins: [robloxPlugin],
|
|
32
|
+
// ... other config
|
|
33
|
+
};
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Environment Variables
|
|
37
|
+
|
|
38
|
+
| Variable | Required | Description |
|
|
39
|
+
| ------------------------ | -------- | ---------------------------------------- |
|
|
40
|
+
| `ROBLOX_API_KEY` | Yes | Roblox Open Cloud API key |
|
|
41
|
+
| `ROBLOX_UNIVERSE_ID` | Yes | Universe ID of your experience |
|
|
42
|
+
| `ROBLOX_PLACE_ID` | No | Specific place ID |
|
|
43
|
+
| `ROBLOX_WEBHOOK_SECRET` | No | Secret for webhook validation |
|
|
44
|
+
| `ROBLOX_MESSAGING_TOPIC` | No | Messaging topic (default: "eliza-agent") |
|
|
45
|
+
| `ROBLOX_DRY_RUN` | No | Enable dry run mode (default: false) |
|
|
46
|
+
|
|
47
|
+
## Action
|
|
48
|
+
|
|
49
|
+
### ROBLOX_ACTION
|
|
50
|
+
|
|
51
|
+
Route Roblox game integration through one compact action surface.
|
|
52
|
+
|
|
53
|
+
Supported subactions:
|
|
54
|
+
|
|
55
|
+
- `message`: send a message to all players or target player IDs
|
|
56
|
+
- `execute`: publish a game-side action payload such as `spawn_entity`, `give_coins`, or `teleport`
|
|
57
|
+
- `get_player`: look up Roblox player information by username or user ID
|
|
58
|
+
|
|
59
|
+
**Examples:**
|
|
60
|
+
|
|
61
|
+
- "Tell everyone in the game that there's a special event happening"
|
|
62
|
+
- "Give player456 100 coins as a reward"
|
|
63
|
+
- "Who is player 12345678?"
|
|
64
|
+
|
|
65
|
+
## Providers
|
|
66
|
+
|
|
67
|
+
### roblox-game-state
|
|
68
|
+
|
|
69
|
+
Provides information about the connected Roblox experience to the agent's context:
|
|
70
|
+
|
|
71
|
+
- Universe ID and Place ID
|
|
72
|
+
- Experience name and statistics
|
|
73
|
+
- Active player count
|
|
74
|
+
- Creator information
|
|
75
|
+
- Messaging topic configuration
|
|
76
|
+
|
|
77
|
+
## Services
|
|
78
|
+
|
|
79
|
+
### RobloxService
|
|
80
|
+
|
|
81
|
+
Main service for managing Roblox connections and communication:
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { RobloxService, ROBLOX_SERVICE_NAME } from "@elizaos/plugin-roblox";
|
|
85
|
+
|
|
86
|
+
// Get service from runtime
|
|
87
|
+
const service = runtime.getService<RobloxService>(ROBLOX_SERVICE_NAME);
|
|
88
|
+
|
|
89
|
+
// Send a message to all players
|
|
90
|
+
await service.sendMessage(runtime.agentId, "Hello from Eliza!");
|
|
91
|
+
|
|
92
|
+
// Execute a game action
|
|
93
|
+
await service.executeAction(
|
|
94
|
+
runtime.agentId,
|
|
95
|
+
"spawn_item",
|
|
96
|
+
{ item: "sword", rarity: "legendary" },
|
|
97
|
+
[12345678], // Target specific player
|
|
98
|
+
);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Roblox Game Integration
|
|
102
|
+
|
|
103
|
+
To receive messages from your Roblox game, you'll need to set up a Luau script that listens to the Messaging Service:
|
|
104
|
+
|
|
105
|
+
```lua
|
|
106
|
+
-- Server script in Roblox Studio
|
|
107
|
+
local MessagingService = game:GetService("MessagingService")
|
|
108
|
+
|
|
109
|
+
local TOPIC = "eliza-agent" -- Must match ROBLOX_MESSAGING_TOPIC
|
|
110
|
+
|
|
111
|
+
MessagingService:SubscribeAsync(TOPIC, function(message)
|
|
112
|
+
local data = game:GetService("HttpService"):JSONDecode(message.Data)
|
|
113
|
+
|
|
114
|
+
if data.type == "agent_message" then
|
|
115
|
+
-- Handle agent message
|
|
116
|
+
print("Agent says:", data.content)
|
|
117
|
+
-- Broadcast to players, show in chat, etc.
|
|
118
|
+
elseif data.type == "agent_action" then
|
|
119
|
+
-- Handle agent action
|
|
120
|
+
print("Agent action:", data.action, data.parameters)
|
|
121
|
+
-- Execute the action in-game
|
|
122
|
+
end
|
|
123
|
+
end)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Limitations & recommended architecture (critical notes)
|
|
127
|
+
|
|
128
|
+
### Inbound messages (Roblox → agent)
|
|
129
|
+
|
|
130
|
+
Roblox Open Cloud **does not provide an external “subscribe” API** for `MessagingService`. That means:
|
|
131
|
+
|
|
132
|
+
- This plugin supports **agent → Roblox** (publish) reliably.
|
|
133
|
+
- It cannot, by itself, “listen to player chat” from outside Roblox by polling Open Cloud.
|
|
134
|
+
|
|
135
|
+
**Recommended approach**: run a small HTTP bridge server that Roblox calls via `HttpService:RequestAsync(...)` and let the agent respond. See `examples/roblox/`.
|
|
136
|
+
|
|
137
|
+
### Movement / “walking around”
|
|
138
|
+
|
|
139
|
+
Agents cannot move things in Roblox via Open Cloud directly. Movement is possible only when your Roblox experience:
|
|
140
|
+
|
|
141
|
+
- subscribes to the topic
|
|
142
|
+
- interprets `agent_action` payloads (e.g. `move_npc`, `teleport`)
|
|
143
|
+
- performs the movement using Roblox APIs (Humanoid / Pathfinding / TeleportService)
|
|
144
|
+
|
|
145
|
+
### Voice
|
|
146
|
+
|
|
147
|
+
Open Cloud does not provide a direct “agent voice” channel.
|
|
148
|
+
|
|
149
|
+
- You can generate audio externally, but Roblox playback requires game-side logic and Roblox’s audio constraints (assets / permissions / allowed sources).
|
|
150
|
+
- Most deployments start with **text** and add voice later with custom UI and an audio pipeline.
|
|
151
|
+
|
|
152
|
+
## Project Structure
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
plugin-roblox/
|
|
156
|
+
├── typescript/ # TypeScript implementation
|
|
157
|
+
│ ├── actions/ # ROBLOX_ACTION router
|
|
158
|
+
│ ├── services/ # RobloxService
|
|
159
|
+
│ ├── providers/ # Context providers
|
|
160
|
+
│ ├── client/ # API client
|
|
161
|
+
│ ├── types/ # Type definitions
|
|
162
|
+
│ └── index.ts # Plugin entry point
|
|
163
|
+
├── rust/ # Rust implementation
|
|
164
|
+
│ └── src/
|
|
165
|
+
│ ├── client.rs # API client
|
|
166
|
+
│ ├── service.rs # Service implementation
|
|
167
|
+
│ └── lib.rs # Crate entry point
|
|
168
|
+
├── python/ # Python implementation
|
|
169
|
+
│ └── elizaos_plugin_roblox/
|
|
170
|
+
│ ├── client.py # API client
|
|
171
|
+
│ ├── service.py # Service implementation
|
|
172
|
+
│ └── __init__.py # Package entry point
|
|
173
|
+
└── package.json # npm package configuration
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Development
|
|
177
|
+
|
|
178
|
+
### Building
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# TypeScript
|
|
182
|
+
bun run build
|
|
183
|
+
# TypeScript
|
|
184
|
+
bun run test
|
|
185
|
+
# TypeScript
|
|
186
|
+
bun run lint
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeGameAction.d.ts","sourceRoot":"","sources":["../../actions/executeGameAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAwIvB,QAAA,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"executeGameAction.d.ts","sourceRoot":"","sources":["../../actions/executeGameAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAwIvB,QAAA,MAAM,iBAAiB,EAAE,MA0HxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeRobloxAction.d.ts","sourceRoot":"","sources":["../../actions/executeRobloxAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAUZ,MAAM,eAAe,CAAC;AAiMvB,eAAO,MAAM,mBAAmB,EAAE,MA2GjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPlayerInfo.d.ts","sourceRoot":"","sources":["../../actions/getPlayerInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AA4DvB,QAAA,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"getPlayerInfo.d.ts","sourceRoot":"","sources":["../../actions/getPlayerInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AA4DvB,QAAA,MAAM,aAAa,EAAE,MAgKpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Action } from "@elizaos/core";
|
|
2
|
-
import
|
|
3
|
-
import getPlayerInfo from "./getPlayerInfo";
|
|
4
|
-
import sendGameMessage from "./sendGameMessage";
|
|
2
|
+
import robloxAction from "./robloxAction";
|
|
5
3
|
export declare const robloxActions: Action[];
|
|
6
|
-
export {
|
|
4
|
+
export { robloxAction };
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,MAAM,EAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"robloxAction.d.ts","sourceRoot":"","sources":["../../actions/robloxAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAUZ,MAAM,eAAe,CAAC;AA+YvB,eAAO,MAAM,YAAY,EAAE,MAmI1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendGameMessage.d.ts","sourceRoot":"","sources":["../../actions/sendGameMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAuCvB,QAAA,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"sendGameMessage.d.ts","sourceRoot":"","sources":["../../actions/sendGameMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAuCvB,QAAA,MAAM,eAAe,EAAE,MA2HtB,CAAC;AAaF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendRobloxMessage.d.ts","sourceRoot":"","sources":["../../actions/sendRobloxMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AA0FvB,eAAO,MAAM,iBAAiB,EAAE,MAkG/B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Auto-generated canonical action/provider
|
|
2
|
+
* Auto-generated canonical action/provider docs for plugin-roblox.
|
|
3
3
|
* DO NOT EDIT - Generated from prompts/specs/**.
|
|
4
4
|
*/
|
|
5
5
|
export type ActionDoc = {
|
|
@@ -15,13 +15,6 @@ export type ProviderDoc = {
|
|
|
15
15
|
position?: number;
|
|
16
16
|
dynamic?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export type EvaluatorDoc = {
|
|
19
|
-
name: string;
|
|
20
|
-
description: string;
|
|
21
|
-
similes?: readonly string[];
|
|
22
|
-
alwaysRun?: boolean;
|
|
23
|
-
examples?: readonly unknown[];
|
|
24
|
-
};
|
|
25
18
|
export declare const coreActionsSpec: {
|
|
26
19
|
readonly version: "1.0.0";
|
|
27
20
|
readonly actions: readonly [];
|
|
@@ -46,18 +39,8 @@ export declare const allProvidersSpec: {
|
|
|
46
39
|
readonly dynamic: true;
|
|
47
40
|
}];
|
|
48
41
|
};
|
|
49
|
-
export declare const coreEvaluatorsSpec: {
|
|
50
|
-
readonly version: "1.0.0";
|
|
51
|
-
readonly evaluators: readonly [];
|
|
52
|
-
};
|
|
53
|
-
export declare const allEvaluatorsSpec: {
|
|
54
|
-
readonly version: "1.0.0";
|
|
55
|
-
readonly evaluators: readonly [];
|
|
56
|
-
};
|
|
57
42
|
export declare const coreActionDocs: readonly ActionDoc[];
|
|
58
43
|
export declare const allActionDocs: readonly ActionDoc[];
|
|
59
44
|
export declare const coreProviderDocs: readonly ProviderDoc[];
|
|
60
45
|
export declare const allProviderDocs: readonly ProviderDoc[];
|
|
61
|
-
export declare const coreEvaluatorDocs: readonly EvaluatorDoc[];
|
|
62
|
-
export declare const allEvaluatorDocs: readonly EvaluatorDoc[];
|
|
63
46
|
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AACX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AACX,eAAO,MAAM,iBAAiB;;;;;;;CASpB,CAAC;AACX,eAAO,MAAM,gBAAgB;;;;;;;CASnB,CAAC;AAEX,eAAO,MAAM,cAAc,EAAE,SAAS,SAAS,EAA4B,CAAC;AAC5E,eAAO,MAAM,aAAa,EAAE,SAAS,SAAS,EAA2B,CAAC;AAC1E,eAAO,MAAM,gBAAgB,EAAE,SAAS,WAAW,EAAgC,CAAC;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAA+B,CAAC"}
|