diff --git a/agent/package.json b/agent/package.json index 6724b5a5d29..e27d4aa5ee5 100644 --- a/agent/package.json +++ b/agent/package.json @@ -29,7 +29,7 @@ "@ai16z/plugin-0g": "workspace:*", "@ai16z/plugin-aptos": "workspace:*", "@ai16z/plugin-bootstrap": "workspace:*", - "@ai16z/plugin-buttplug": "workspace:*", + "@ai16z/plugin-intiface": "workspace:*", "@ai16z/plugin-coinbase": "workspace:*", "@ai16z/plugin-conflux": "workspace:*", "@ai16z/plugin-evm": "workspace:*", diff --git a/agent/src/index.ts b/agent/src/index.ts index 05db1681e8d..26d62c09958 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -27,7 +27,7 @@ import { import { zgPlugin } from "@ai16z/plugin-0g"; import createGoatPlugin from "@ai16z/plugin-goat"; import { bootstrapPlugin } from "@ai16z/plugin-bootstrap"; -// import { buttplugPlugin } from "@ai16z/plugin-buttplug"; +// import { intifacePlugin } from "@ai16z/plugin-intiface"; import { coinbaseCommercePlugin, coinbaseMassPaymentsPlugin, diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index d30654bbf2d..7bea050fb3c 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -683,7 +683,7 @@ export type Character = { /** Optional configuration */ settings?: { secrets?: { [key: string]: string }; - buttplug?: boolean; + intiface?: boolean; voice?: { model?: string; // For VITS url?: string; // Legacy VITS support @@ -1155,7 +1155,7 @@ export enum ServiceType { BROWSER = "browser", SPEECH_GENERATION = "speech_generation", PDF = "pdf", - BUTTPLUG = "buttplug", + INTIFACE = "intiface", AWS_S3 = "aws_s3", } diff --git a/packages/plugin-buttplug/.npmignore b/packages/plugin-intiface/.npmignore similarity index 100% rename from packages/plugin-buttplug/.npmignore rename to packages/plugin-intiface/.npmignore diff --git a/packages/plugin-buttplug/intiface-engine/CHANGELOG.md b/packages/plugin-intiface/intiface-engine/CHANGELOG.md similarity index 100% rename from packages/plugin-buttplug/intiface-engine/CHANGELOG.md rename to packages/plugin-intiface/intiface-engine/CHANGELOG.md diff --git a/packages/plugin-buttplug/intiface-engine/README.md b/packages/plugin-intiface/intiface-engine/README.md similarity index 100% rename from packages/plugin-buttplug/intiface-engine/README.md rename to packages/plugin-intiface/intiface-engine/README.md diff --git a/packages/plugin-buttplug/intiface-engine/intiface-engine b/packages/plugin-intiface/intiface-engine/intiface-engine similarity index 100% rename from packages/plugin-buttplug/intiface-engine/intiface-engine rename to packages/plugin-intiface/intiface-engine/intiface-engine diff --git a/packages/plugin-buttplug/package.json b/packages/plugin-intiface/package.json similarity index 92% rename from packages/plugin-buttplug/package.json rename to packages/plugin-intiface/package.json index e00b348aad0..16cc574f3e6 100644 --- a/packages/plugin-buttplug/package.json +++ b/packages/plugin-intiface/package.json @@ -1,5 +1,5 @@ { - "name": "@ai16z/plugin-buttplug", + "name": "@ai16z/plugin-intiface", "version": "0.1.5-alpha.5", "main": "dist/index.js", "type": "module", diff --git a/packages/plugin-buttplug/src/environment.ts b/packages/plugin-intiface/src/environment.ts similarity index 78% rename from packages/plugin-buttplug/src/environment.ts rename to packages/plugin-intiface/src/environment.ts index 47ba5c0cd51..9359952df7b 100644 --- a/packages/plugin-buttplug/src/environment.ts +++ b/packages/plugin-intiface/src/environment.ts @@ -1,10 +1,10 @@ import { IAgentRuntime } from "@ai16z/eliza"; import { z } from "zod"; -export const buttplugEnvSchema = z +export const intifaceEnvSchema = z .object({ INTIFACE_URL: z.string().default("ws://localhost:12345"), - INTIFACE_NAME: z.string().default("Eliza Buttplug Client"), + INTIFACE_NAME: z.string().default("Eliza Intiface Client"), DEVICE_NAME: z.string().default("Lovense Nora"), }) .refine( @@ -20,11 +20,11 @@ export const buttplugEnvSchema = z } ); -export type ButtplugConfig = z.infer; +export type IntifaceConfig = z.infer; -export async function validateButtplugConfig( +export async function validateIntifaceConfig( runtime: IAgentRuntime -): Promise { +): Promise { try { const config = { INTIFACE_URL: @@ -36,14 +36,14 @@ export async function validateButtplugConfig( runtime.getSetting("DEVICE_NAME") || process.env.DEVICE_NAME, }; - return buttplugEnvSchema.parse(config); + return intifaceEnvSchema.parse(config); } catch (error) { if (error instanceof z.ZodError) { const errorMessages = error.errors .map((err) => `${err.path.join(".")}: ${err.message}`) .join("\n"); throw new Error( - `Buttplug configuration validation failed:\n${errorMessages}` + `Intiface configuration validation failed:\n${errorMessages}` ); } throw error; diff --git a/packages/plugin-buttplug/src/index.ts b/packages/plugin-intiface/src/index.ts similarity index 93% rename from packages/plugin-buttplug/src/index.ts rename to packages/plugin-intiface/src/index.ts index b9da82b0158..3cf09276e90 100644 --- a/packages/plugin-buttplug/src/index.ts +++ b/packages/plugin-intiface/src/index.ts @@ -1,5 +1,5 @@ import { ButtplugClient, ButtplugNodeWebsocketClientConnector } from "buttplug"; -import { validateButtplugConfig, type ButtplugConfig } from "./environment"; +import { validateIntifaceConfig, type IntifaceConfig } from "./environment"; import type { Action, HandlerCallback, @@ -15,7 +15,7 @@ import { shutdownIntifaceEngine, } from "./utils"; -export interface IButtplugService extends Service { +export interface IIntifaceService extends Service { vibrate(strength: number, duration: number): Promise; rotate?(strength: number, duration: number): Promise; getBatteryLevel?(): Promise; @@ -23,14 +23,14 @@ export interface IButtplugService extends Service { getDevices(): any[]; } -export class ButtplugService extends Service implements IButtplugService { - static serviceType: ServiceType = ServiceType.BUTTPLUG; +export class IntifaceService extends Service implements IIntifaceService { + static serviceType: ServiceType = ServiceType.INTIFACE; private client: ButtplugClient; private connected = false; private devices: Map = new Map(); private vibrateQueue: VibrateEvent[] = []; private isProcessingQueue = false; - private config: ButtplugConfig | null = null; + private config: IntifaceConfig | null = null; private maxVibrationIntensity = 1; private rampUpAndDown = false; private rampSteps = 20; @@ -62,16 +62,16 @@ export class ButtplugService extends Service implements IButtplugService { } await shutdownIntifaceEngine(); } catch (error) { - console.error("[ButtplugService] Cleanup error:", error); + console.error("[IntifaceService] Cleanup error:", error); } } - getInstance(): IButtplugService { + getInstance(): IIntifaceService { return this; } async initialize(runtime: IAgentRuntime): Promise { - this.config = await validateButtplugConfig(runtime); + this.config = await validateIntifaceConfig(runtime); this.preferredDeviceName = this.config.DEVICE_NAME; this.client = new ButtplugClient(this.config.INTIFACE_NAME); @@ -118,7 +118,7 @@ export class ButtplugService extends Service implements IButtplugService { await new Promise((r) => setTimeout(r, 2000)); } else { console.error( - "Failed to connect to Buttplug server after all retries:", + "Failed to connect to Intiface server after all retries:", error ); throw error; @@ -144,7 +144,7 @@ export class ButtplugService extends Service implements IButtplugService { private async ensureDeviceAvailable() { if (!this.connected) { - throw new Error("Not connected to Buttplug server"); + throw new Error("Not connected to Intiface server"); } if (this.devices.size === 0) { @@ -325,7 +325,7 @@ const vibrateAction: Action = { description: "Control vibration intensity of connected devices", validate: async (runtime: IAgentRuntime, _message: Memory) => { try { - await validateButtplugConfig(runtime); + await validateIntifaceConfig(runtime); return true; } catch { return false; @@ -338,11 +338,11 @@ const vibrateAction: Action = { options: any, callback: HandlerCallback ) => { - const service = runtime.getService( - ServiceType.BUTTPLUG + const service = runtime.getService( + ServiceType.INTIFACE ); if (!service) { - throw new Error("Buttplug service not available"); + throw new Error("Intiface service not available"); } // Extract intensity and duration from message @@ -435,7 +435,7 @@ const rotateAction: Action = { description: "Control rotation intensity of connected devices", validate: async (runtime: IAgentRuntime, _message: Memory) => { try { - await validateButtplugConfig(runtime); + await validateIntifaceConfig(runtime); return true; } catch { return false; @@ -448,8 +448,8 @@ const rotateAction: Action = { options: any, callback: HandlerCallback ) => { - const service = runtime.getService( - ServiceType.BUTTPLUG + const service = runtime.getService( + ServiceType.INTIFACE ); if (!service || !service.rotate) { throw new Error("Rotation not supported"); @@ -493,7 +493,7 @@ const batteryAction: Action = { description: "Check battery level of connected devices", validate: async (runtime: IAgentRuntime, _message: Memory) => { try { - await validateButtplugConfig(runtime); + await validateIntifaceConfig(runtime); return true; } catch { return false; @@ -506,8 +506,8 @@ const batteryAction: Action = { options: any, callback: HandlerCallback ) => { - const service = runtime.getService( - ServiceType.BUTTPLUG + const service = runtime.getService( + ServiceType.INTIFACE ); if (!service || !service.getBatteryLevel) { throw new Error("Battery level check not supported"); @@ -573,13 +573,13 @@ interface VibrateEvent { deviceId?: number; } -export const buttplugPlugin: Plugin = { - name: "buttplug", +export const intifacePlugin: Plugin = { + name: "intiface", description: "Controls intimate hardware devices", actions: [vibrateAction, rotateAction, batteryAction], evaluators: [], providers: [], - services: [new ButtplugService()], + services: [new IntifaceService()], }; -export default buttplugPlugin; +export default intifacePlugin; diff --git a/packages/plugin-buttplug/src/buttplug-user-device-config.json b/packages/plugin-intiface/src/intiface-user-device-config.json similarity index 100% rename from packages/plugin-buttplug/src/buttplug-user-device-config.json rename to packages/plugin-intiface/src/intiface-user-device-config.json diff --git a/packages/plugin-buttplug/src/utils.ts b/packages/plugin-intiface/src/utils.ts similarity index 97% rename from packages/plugin-buttplug/src/utils.ts rename to packages/plugin-intiface/src/utils.ts index 43e930dbf40..12019898d98 100644 --- a/packages/plugin-buttplug/src/utils.ts +++ b/packages/plugin-intiface/src/utils.ts @@ -24,7 +24,7 @@ export async function isPortAvailable(port: number): Promise { export async function startIntifaceEngine(): Promise { const configPath = path.join( __dirname, - "../src/buttplug-user-device-config.json" + "../src/intiface-user-device-config.json" ); try { const child = spawn( @@ -34,7 +34,7 @@ export async function startIntifaceEngine(): Promise { "12345", "--use-bluetooth-le", "--server-name", - "Eliza Buttplugin Server", + "Eliza Intiface Server", "--use-device-websocket-server", "--user-device-config-file", configPath, diff --git a/packages/plugin-buttplug/test/buttplug-user-device-config-test.json b/packages/plugin-intiface/test/buttplug-user-device-config-test.json similarity index 100% rename from packages/plugin-buttplug/test/buttplug-user-device-config-test.json rename to packages/plugin-intiface/test/buttplug-user-device-config-test.json diff --git a/packages/plugin-buttplug/test/fake-buttplug.ts b/packages/plugin-intiface/test/fake-buttplug.ts similarity index 100% rename from packages/plugin-buttplug/test/fake-buttplug.ts rename to packages/plugin-intiface/test/fake-buttplug.ts diff --git a/packages/plugin-buttplug/test/simulate.ts b/packages/plugin-intiface/test/simulate.ts similarity index 100% rename from packages/plugin-buttplug/test/simulate.ts rename to packages/plugin-intiface/test/simulate.ts diff --git a/packages/plugin-buttplug/tsconfig.json b/packages/plugin-intiface/tsconfig.json similarity index 100% rename from packages/plugin-buttplug/tsconfig.json rename to packages/plugin-intiface/tsconfig.json diff --git a/packages/plugin-buttplug/tsup.config.ts b/packages/plugin-intiface/tsup.config.ts similarity index 100% rename from packages/plugin-buttplug/tsup.config.ts rename to packages/plugin-intiface/tsup.config.ts