Skip to content

Commit 9170b69

Browse files
authored
Merge pull request #612 from ai16z/shaw/fix-buttplugio
fix: Fix buttplug.io integration and merge
2 parents ed27197 + 22a1eb7 commit 9170b69

23 files changed

+1835
-9776
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ STARKNET_ADDRESS=
9191
STARKNET_PRIVATE_KEY=
9292
STARKNET_RPC_URL=
9393

94+
# Intiface Configuration
95+
INTIFACE_WEBSOCKET_URL=ws://localhost:12345
96+
9497

9598
# Farcaster
9699
FARCASTER_HUB_URL=

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_modules
55
.env.production
66
concatenated-output.ts
77
embedding-cache.json
8+
packages/plugin-buttplug/intiface-engine
89

910
.DS_Store
1011

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@ai16z/eliza": "workspace:*",
2323
"@ai16z/plugin-bootstrap": "workspace:*",
2424
"@ai16z/plugin-conflux": "workspace:*",
25+
"@ai16z/plugin-buttplug": "workspace:*",
2526
"@ai16z/plugin-image-generation": "workspace:*",
2627
"@ai16z/plugin-node": "workspace:*",
2728
"@ai16z/plugin-solana": "workspace:*",

agent/src/character.ts

-402
This file was deleted.

agent/src/index.ts

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,45 @@
11
import { PostgresDatabaseAdapter } from "@ai16z/adapter-postgres";
22
import { SqliteDatabaseAdapter } from "@ai16z/adapter-sqlite";
3+
import { AutoClientInterface } from "@ai16z/client-auto";
34
import { DirectClientInterface } from "@ai16z/client-direct";
45
import { DiscordClientInterface } from "@ai16z/client-discord";
5-
import { AutoClientInterface } from "@ai16z/client-auto";
66
import { TelegramClientInterface } from "@ai16z/client-telegram";
77
import { TwitterClientInterface } from "@ai16z/client-twitter";
88
import {
9-
DbCacheAdapter,
10-
defaultCharacter,
11-
FsCacheAdapter,
12-
ICacheManager,
13-
IDatabaseCacheAdapter,
14-
stringToUuid,
159
AgentRuntime,
1610
CacheManager,
1711
Character,
12+
DbCacheAdapter,
13+
FsCacheAdapter,
1814
IAgentRuntime,
15+
ICacheManager,
16+
IDatabaseAdapter,
17+
IDatabaseCacheAdapter,
1918
ModelProviderName,
19+
defaultCharacter,
2020
elizaLogger,
2121
settings,
22-
IDatabaseAdapter,
22+
stringToUuid,
2323
validateCharacterConfig,
2424
} from "@ai16z/eliza";
25-
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
26-
import { confluxPlugin } from "@ai16z/plugin-conflux";
27-
import { solanaPlugin } from "@ai16z/plugin-solana";
2825
import { zgPlugin } from "@ai16z/plugin-0g";
29-
import { type NodePlugin, createNodePlugin } from "@ai16z/plugin-node";
26+
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
27+
import { buttplugPlugin } from "@ai16z/plugin-buttplug";
3028
import {
3129
coinbaseCommercePlugin,
3230
coinbaseMassPaymentsPlugin,
3331
} from "@ai16z/plugin-coinbase";
32+
import { confluxPlugin } from "@ai16z/plugin-conflux";
33+
import {
34+
createNodePlugin,
35+
} from "@ai16z/plugin-node";
36+
import { solanaPlugin } from "@ai16z/plugin-solana";
3437
import Database from "better-sqlite3";
3538
import fs from "fs";
36-
import readline from "readline";
37-
import yargs from "yargs";
3839
import path from "path";
40+
import readline from "readline";
3941
import { fileURLToPath } from "url";
40-
import { character } from "./character.ts";
42+
import yargs from "yargs";
4143

4244
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
4345
const __dirname = path.dirname(__filename); // get the name of the directory
@@ -238,7 +240,7 @@ function getSecret(character: Character, secret: string) {
238240
return character.settings.secrets?.[secret] || process.env[secret];
239241
}
240242

241-
let nodePlugin: NodePlugin | undefined;
243+
let nodePlugin: any | undefined;
242244

243245
export function createAgent(
244246
character: Character,
@@ -275,6 +277,7 @@ export function createAgent(
275277
getSecret(character, "COINBASE_PRIVATE_KEY")
276278
? coinbaseMassPaymentsPlugin
277279
: null,
280+
getSecret(character, "BUTTPLUG_API_KEY") ? buttplugPlugin : null,
278281
].filter(Boolean),
279282
providers: [],
280283
actions: [],
@@ -338,7 +341,7 @@ const startAgents = async () => {
338341

339342
let charactersArg = args.characters || args.character;
340343

341-
let characters = [character];
344+
let characters = [defaultCharacter];
342345

343346
if (charactersArg) {
344347
characters = await loadCharacters(charactersArg);
+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[@ai16z/eliza v1.0.0](../index.md) / IButtplugService
2+
3+
# Interface: IButtplugService
4+
5+
## Extends
6+
7+
- [`Service`](../classes/Service.md)
8+
9+
## Methods
10+
11+
### vibrate()
12+
13+
> **vibrate**(`strength`, `duration`): `Promise`\<`void`\>
14+
15+
#### Parameters
16+
17+
**strength**: `number`
18+
19+
**duration**: `number`
20+
21+
#### Returns
22+
23+
`Promise`\<`void`\>
24+
25+
#### Defined in
26+
27+
[packages/plugin-buttplug/src/index.ts:14](https://github.com/ai16z/eliza/blob/main/packages/plugin-buttplug/src/index.ts#L14)
28+
29+
---
30+
31+
### rotate()
32+
33+
> **rotate**(`strength`, `duration`): `Promise`\<`void`\>
34+
35+
#### Parameters
36+
37+
**strength**: `number`
38+
39+
**duration**: `number`
40+
41+
#### Returns
42+
43+
`Promise`\<`void`\>
44+
45+
#### Defined in
46+
47+
[packages/plugin-buttplug/src/index.ts:15](https://github.com/ai16z/eliza/blob/main/packages/plugin-buttplug/src/index.ts#L15)
48+
49+
---
50+
51+
---
52+
53+
### getBatteryLevel()
54+
55+
> **getBatteryLevel**(): `Promise`\<`number`\>
56+
57+
#### Returns
58+
59+
`Promise`\<`number`\>
60+
61+
#### Defined in
62+
63+
[packages/plugin-buttplug/src/index.ts:17](https://github.com/ai16z/eliza/blob/main/packages/plugin-buttplug/src/index.ts#L17)
64+
65+
---
66+
67+
### isConnected()
68+
69+
> **isConnected**(): `boolean`
70+
71+
#### Returns
72+
73+
`boolean`
74+
75+
#### Defined in
76+
77+
[packages/plugin-buttplug/src/index.ts:15](https://github.com/ai16z/eliza/blob/main/packages/plugin-buttplug/src/index.ts#L15)
78+
79+
---
80+
81+
### getDevices()
82+
83+
> **getDevices**(): `any`[]
84+
85+
#### Returns
86+
87+
`any`[]
88+
89+
#### Defined in
90+
91+
[packages/plugin-buttplug/src/index.ts:16](https://github.com/ai16z/eliza/blob/main/packages/plugin-buttplug/src/index.ts#L16)

docs/docs/packages/plugins.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@ Integrates Solana blockchain functionality:
8484
- `walletProvider` - Wallet management
8585
- `trustScoreProvider` - Transaction trust metrics
8686

87+
#### 5. Buttplug Plugin (`@eliza/plugin-buttplug`)
88+
89+
Integrates Buttplug.io for intimate toy control:
90+
91+
**Services:**
92+
93+
- `ButtplugService` - Buttplug.io integration itself
94+
95+
**Actions:**
96+
97+
- `VIBRATE` - Control vibration intensity and duration of connected devices
98+
- `ROTATE` - Control rotation intensity and duration of connected devices
99+
- `BATTERY` - Get the battery level of connected devices
100+
87101
## Using Plugins
88102

89103
### Installation
@@ -99,10 +113,10 @@ pnpm add @eliza/plugin-[name]
99113
```typescript
100114
import { bootstrapPlugin } from "@eliza/plugin-bootstrap";
101115
import { imageGenerationPlugin } from "@eliza/plugin-image-generation";
102-
116+
import { buttplugPlugin } from "@eliza/plugin-buttplug";
103117
const character = {
104118
// ... other character config
105-
plugins: [bootstrapPlugin, imageGenerationPlugin],
119+
plugins: [bootstrapPlugin, imageGenerationPlugin, buttplugPlugin],
106120
};
107121
```
108122

0 commit comments

Comments
 (0)