Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
[submodule "src/plugin-hyperfy/hyperfy"]
path = src/plugin-hyperfy/hyperfy
url = https://github.com/tcm390/hyperfy.git
branch = dev

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"scripts": {
"start": "elizaos start",
"dev": "elizaos dev",
"build": "tsup && cp src/plugin-hyperfy/physx/physx-js-webidl.js src/plugin-hyperfy/physx/physx-js-webidl.wasm dist/ && cp -r src/plugin-hyperfy/public/scripts dist/ && cp -r src/plugin-hyperfy/public/assets dist/ && cp -r src/plugin-hyperfy/public/avatars dist/ && cp -r src/plugin-hyperfy/public/emotes dist/ && cp -r src/plugin-hyperfy/public/puppeteer dist/",
"build": "tsup && cp -r src/plugin-hyperfy/public/scripts dist/ && cp -r src/plugin-hyperfy/public/assets dist/ && cp -r src/plugin-hyperfy/public/avatars dist/ && cp -r src/plugin-hyperfy/public/emotes dist/ && cp -r src/plugin-hyperfy/public/puppeteer dist/",
"lint": "prettier --write ./src",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
Expand Down
1 change: 0 additions & 1 deletion src/plugin-hyperfy/hyperfy
Submodule hyperfy deleted from 235cc1
2 changes: 0 additions & 2 deletions src/plugin-hyperfy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from '@elizaos/core';
import { HyperfyService } from './service';
import { z } from 'zod';
// import { hyperfyChatAction } from './actions/chat';
import { hyperfyGotoEntityAction } from './actions/goto';
import { hyperfyUseItemAction } from './actions/use';
import { hyperfyUnuseItemAction } from './actions/unuse';
Expand All @@ -27,7 +26,6 @@ import { hyperfyEvents } from './events';
const HYPERFY_WS_URL = process.env.WS_URL || 'wss://chill.hyperfy.xyz/ws'
// ---------------------------------------------


// Define the plugin configuration schema (optional, adjust as needed)
// Renamed this one to avoid conflict
const hyperfyPluginConfigSchema = z.object({
Expand Down
3 changes: 1 addition & 2 deletions src/plugin-hyperfy/managers/build-manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ChannelType, Content, HandlerCallback, IAgentRuntime, Memory, ModelType, composePromptFromState, createUniqueUuid, logger, parseKeyValueXml } from "@elizaos/core";
import { HyperfyService } from "../service";
import { agentActivityLock } from "./guards";
import { uuid } from '../hyperfy/src/core/utils.js'
import { uuid } from 'hyperfy'
import { cloneDeep } from 'lodash-es'


Expand Down
2 changes: 1 addition & 1 deletion src/plugin-hyperfy/managers/emote-manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs/promises'
import path from 'path'
import { EMOTES_LIST } from '../constants.js'
import { Emotes } from '../hyperfy/src/core/extras/playerEmotes.js'
import { Emotes } from 'hyperfy'
import { hashFileBuffer, getModuleDirectory } from '../utils'
import { IAgentRuntime, logger } from '@elizaos/core'
import { HyperfyService } from '../service.js'
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-hyperfy/managers/puppeteer-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { promises as fsPromises } from 'fs';
import puppeteer from 'puppeteer'
import { IAgentRuntime, ModelType } from '@elizaos/core'
import { HyperfyService } from '../service.js'
import * as THREE from 'three';
import { THREE } from 'hyperfy';
import { resolveUrl } from '../utils.js';
import { getModuleDirectory } from '../utils.js';

Expand Down
22 changes: 0 additions & 22 deletions src/plugin-hyperfy/physx/loadPhysX.js

This file was deleted.

26,944 changes: 0 additions & 26,944 deletions src/plugin-hyperfy/physx/physx-js-webidl.js

This file was deleted.

Binary file removed src/plugin-hyperfy/physx/physx-js-webidl.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions src/plugin-hyperfy/providers/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
createUniqueUuid
} from '@elizaos/core';
import { HyperfyService } from '../service';
import * as THREE from 'three'
import { Vector3Enhanced } from '../hyperfy/src/core/extras/Vector3Enhanced.js'
import { THREE } from 'hyperfy';
import { Vector3Enhanced } from 'hyperfy'

export const hyperfyProvider: Provider = {
name: 'HYPERFY_WORLD_STATE',
Expand Down
4 changes: 2 additions & 2 deletions src/plugin-hyperfy/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
import crypto from 'crypto'
import fs from 'fs/promises'
import path from 'path'
import { createNodeClientWorld } from './hyperfy/src/core/createNodeClientWorld.js'
import { createNodeClientWorld } from 'hyperfy'
import { AgentControls } from './systems/controls'
import { AgentEnvironment } from './systems/environment.js'
import { AgentLoader } from './systems/loader'
import { AgentLiveKit } from './systems/liveKit.js'
import { AgentActions } from './systems/actions.js'
import { loadPhysX } from './physx/loadPhysX.js'
import { loadPhysX } from 'hyperfy'
import { BehaviorManager } from "./managers/behavior-manager.js"
import { EmoteManager } from './managers//emote-manager.js'
import { MessageManager } from './managers//message-manager.js'
Expand Down
4 changes: 2 additions & 2 deletions src/plugin-hyperfy/systems/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { System } from '../hyperfy/src/core/systems/System';
import * as THREE from 'three'
import { System } from 'hyperfy';
import { THREE } from 'hyperfy';

interface ActionNode extends THREE.Object3D {
[key: string]: any;
Expand Down
8 changes: 6 additions & 2 deletions src/plugin-hyperfy/systems/avatar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isString } from 'lodash-es'
import { Node } from '../hyperfy/src/core/nodes/Node'
import * as THREE from 'three'
import { Node } from 'hyperfy'
import { THREE } from 'hyperfy';

const defaults = {
src: null as string | null,
Expand Down Expand Up @@ -96,6 +96,10 @@ export class AgentAvatar extends Node {
this.factory?.applyStats?.(stats)
}

disableRateCheck() {

}

get src(): string | null {
return this._src
}
Expand Down
6 changes: 3 additions & 3 deletions src/plugin-hyperfy/systems/controls.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { System } from '../hyperfy/src/core/systems/System.js'
import { System } from 'hyperfy'
import { logger } from '@elizaos/core';
import * as THREE from 'three';
import { Vector3Enhanced } from '../hyperfy/src/core/extras/Vector3Enhanced.js'
import { THREE } from 'hyperfy';
import { Vector3Enhanced } from 'hyperfy'

const FORWARD = new THREE.Vector3(0, 0, -1)
const v1 = new THREE.Vector3()
Expand Down
7 changes: 3 additions & 4 deletions src/plugin-hyperfy/systems/environment.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

import { CSM } from '../hyperfy/src/core/libs/csm/CSM'
import { CSM } from 'hyperfy'
import { isNumber, isString } from 'lodash-es'
import { System } from '../hyperfy/src/core/systems/System.js'
import { logger } from '@elizaos/core';
import * as THREE from 'three';
import { System } from 'hyperfy'
import { THREE } from 'hyperfy';
import { PuppeteerManager } from "../managers/puppeteer-manager.js";
import { resolveUrl } from '../utils.js';

Expand Down
2 changes: 1 addition & 1 deletion src/plugin-hyperfy/systems/liveKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TrackKind,
AudioStream
} from '@livekit/rtc-node';
import { System } from '../hyperfy/src/core/systems/System';
import { System } from 'hyperfy';
import { spawn } from 'node:child_process';

export interface LiveKitInitOptions {
Expand Down
13 changes: 6 additions & 7 deletions src/plugin-hyperfy/systems/loader.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as THREE from "three";
import { System } from "../hyperfy/src/core/systems/System.js";
import { createNode } from "../hyperfy/src/core/extras/createNode.js";
import { GLTFLoader } from "../hyperfy/src/core/libs/gltfloader/GLTFLoader.js";
import { glbToNodes } from "../hyperfy/src/core/extras/glbToNodes.js";
import { createEmoteFactory } from "../hyperfy/src/core/extras/createEmoteFactory.js";
import { THREE } from 'hyperfy';
import { System } from "hyperfy";
import { createNode } from "hyperfy";
import { GLTFLoader } from "hyperfy";
import { glbToNodes } from "hyperfy";
import { createEmoteFactory } from "hyperfy";
import { AgentAvatar } from "./avatar.js";
import { PuppeteerManager } from "../managers/puppeteer-manager.js";
import { promises as fsPromises } from 'fs';
import { resolveUrl } from "../utils.js";

// import { VRMLoaderPlugin } from "@pixiv/three-vrm";
Expand Down