Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
79cfe49
Rename old plugins -> features
avaer Dec 28, 2024
076a479
Make plugins initialized manually in the agent
avaer Dec 28, 2024
6c54398
Update features + plugins import strategy
avaer Dec 28, 2024
05590c2
Add fs proxy stub
avaer Dec 28, 2024
1462c50
Add missing @fal-ai/client for 3d generation plugin
avaer Dec 28, 2024
a1413c0
Add @elizaos/core proxy
avaer Dec 28, 2024
0cab4ae
Update types
avaer Dec 28, 2024
641f78f
Update lock
avaer Dec 28, 2024
41e24df
Add missing fs resolve
avaer Dec 28, 2024
a23280a
Add node builtin proxy implementation note
avaer Dec 28, 2024
814a856
Add plugin for testing
avaer Dec 28, 2024
b5e4af2
Code cleanup
avaer Dec 28, 2024
47a2d16
Update proxy package names to be more specific
avaer Dec 28, 2024
5a6f33b
Update package imports and lock
avaer Dec 28, 2024
922208e
Update elizaLogger export
avaer Dec 29, 2024
eadbfce
Major plugins integration debugging
avaer Dec 29, 2024
5508bb1
Patch 3d generation plugin
avaer Dec 29, 2024
85801d7
Update features component typeing
avaer Dec 29, 2024
46f25df
Add solana plugin
avaer Dec 29, 2024
50b30a0
Add trustdb plugin
avaer Dec 29, 2024
0b1850d
Add tee plugin
avaer Dec 29, 2024
5188fe0
Update lock
avaer Dec 29, 2024
12af0df
Update package.json
avaer Dec 29, 2024
d365582
Add elizaos-core-proxy index
avaer Dec 29, 2024
ac98543
Add deps to elizaos-core-proxy
avaer Dec 29, 2024
b196f74
Add new Solana plugin and update 3D generation plugin
avaer Dec 29, 2024
3ca4ca5
Add generation module export and update settings in elizaos-core
avaer Dec 29, 2024
21e0456
Add mainFields configuration for Vite server resolving
avaer Dec 29, 2024
1f0dd1a
Add plugins hacks
avaer Dec 29, 2024
84611f3
Update elizaos-core-proxy files
avaer Dec 30, 2024
b37120f
Add missing logger
avaer Dec 30, 2024
7ee68ba
Add missing models
avaer Dec 30, 2024
5945687
Add twitter plugin source
avaer Dec 30, 2024
aa5c079
Add twitter plugin hacks
avaer Dec 30, 2024
2fb8fdc
Add twitter plugin install
avaer Dec 30, 2024
3e68208
Hook in more plugins
avaer Dec 30, 2024
83617fe
Update lock
avaer Dec 30, 2024
e34a695
Add missing settings.ts
avaer Dec 30, 2024
2dc0b4a
Small cleanup
avaer Dec 30, 2024
3eb55c1
Update lock
avaer Dec 30, 2024
657047a
Add more plugins
avaer Dec 30, 2024
8adae36
Remove .npmignores
avaer Dec 30, 2024
b92cb53
Add new plugin installs
avaer Dec 30, 2024
dd18dd2
Update plugin hacks
avaer Dec 30, 2024
b915a35
Update lock
avaer Dec 30, 2024
64815ec
More plugins integration
avaer Dec 30, 2024
f760aff
Plugins hacks
avaer Dec 30, 2024
417b00d
Update lock
avaer Dec 30, 2024
9903fdc
Add whatsapp plugin
avaer Dec 30, 2024
1df9a71
Move plugin-whatsapp to clients
avaer Dec 30, 2024
d41ad5e
Add clients to types
avaer Dec 30, 2024
3b458e9
Add initial clients integration
avaer Dec 30, 2024
1910740
Update lock
avaer Dec 30, 2024
a1de4fd
Add missing plugin-whatsapp install
avaer Dec 30, 2024
fd1c9ad
Dead code cleanup
avaer Dec 30, 2024
5253b7a
Add flow plugin
avaer Dec 30, 2024
061be08
Remove old .gitignore
avaer Dec 30, 2024
d43417c
Hack flow plugin
avaer Dec 30, 2024
7c97141
Add flow plugin to installs
avaer Dec 30, 2024
2e7fe51
Plug in flow plugin
avaer Dec 30, 2024
3b908c7
Disable dead ssr mode
avaer Dec 30, 2024
cb35c8f
Include cdc assets as strings
avaer Dec 30, 2024
039ab89
Update lock
avaer Dec 30, 2024
7758c54
Add web search plugin
avaer Dec 30, 2024
6e8ef27
Remove .npmignore
avaer Dec 30, 2024
3023f54
Add web search plugin hacks
avaer Dec 30, 2024
9fe3031
Web search plugin integration
avaer Dec 30, 2024
6d46680
Update lock
avaer Dec 30, 2024
5223ade
Add image generation plugin
avaer Dec 30, 2024
35b6b66
Remove .npmignore
avaer Dec 30, 2024
81e871b
Update main file path to src/index.ts in package.json
avaer Dec 30, 2024
4e16f79
Add image generation plugin to upstreet agent
avaer Dec 30, 2024
3f26570
Update lock
avaer Dec 30, 2024
50835bf
Add story plugin
avaer Dec 30, 2024
f0de695
Add plugin-story to react-agents plugins list
avaer Dec 30, 2024
db13425
Hack story plugin
avaer Dec 30, 2024
76374ce
Update lock
avaer Dec 30, 2024
2a97963
Add nft generation plugin
avaer Dec 30, 2024
2849e1e
Remove.npmignore
avaer Dec 30, 2024
aa0de27
Hack nft generation plugin
avaer Dec 30, 2024
b5cb56a
Add plugin for NFT generation in Upstreet Agent
avaer Dec 30, 2024
515bef3
Update lock
avaer Dec 30, 2024
73ea6c5
Add evm plugin
avaer Dec 30, 2024
beaaa96
Add plugin-evm to list of plugins in package.json
avaer Dec 30, 2024
c0fbd16
Add evm plugin hacks
avaer Dec 30, 2024
5dae9b7
Update lock
avaer Dec 30, 2024
e9ec2a6
Add gitbook plugin source
avaer Dec 30, 2024
05ca8c8
Hook in gitbook plugin
avaer Dec 30, 2024
ac3ca0d
Add gitbook plugin hacks
avaer Dec 30, 2024
97e3fb8
More gitbook plugin hacks
avaer Dec 30, 2024
710fbf1
Add plugin-gitbook to upstreet-agent dependencies
avaer Dec 30, 2024
28f2b30
Update lock
avaer Dec 30, 2024
a965ccf
Add near plugin source
avaer Dec 30, 2024
c312109
Remove npmignore
avaer Dec 30, 2024
1df87fc
Add near plugin hacks
avaer Dec 30, 2024
2b4c2a7
Add plugin-near to the list of plugins
avaer Dec 30, 2024
2abd52b
Update lock
avaer Dec 30, 2024
b3d37cc
Add avalanche plugin source
avaer Dec 30, 2024
2ea046f
Add avalanche plugin to upstreet agent
avaer Dec 30, 2024
609941a
Plugin hacks
avaer Dec 30, 2024
def0ea1
Update lock
avaer Dec 30, 2024
46ba29a
Add multiversx
avaer Dec 30, 2024
8a47ca8
Remove npmignore
avaer Dec 30, 2024
5ff0313
Hack multiversx plugin
avaer Dec 30, 2024
8f8489c
Add plugin-multiversx to the list of plugins
avaer Dec 30, 2024
0bccb2e
Update lock
avaer Dec 30, 2024
bac0bf1
Add video generation plugin
avaer Dec 30, 2024
eda3e0c
Remove npmignore
avaer Dec 30, 2024
558c7eb
Hack video generation plugin
avaer Dec 30, 2024
78de9fc
Add video generation plugin support
avaer Dec 30, 2024
3717273
Update lock
avaer Dec 30, 2024
15905c1
Add zksnyc plugin
avaer Dec 30, 2024
f150b56
Add zksync-era plugin to upstreet-agent package
avaer Dec 30, 2024
b4ddf85
Hack zksync plugin
avaer Dec 30, 2024
68dfcf6
Update lock
avaer Dec 30, 2024
0e2028e
Add 0g plugin
avaer Dec 30, 2024
67b4386
Hack 0g plugin
avaer Dec 30, 2024
bdb39ee
Integrate 0g plugin
avaer Dec 30, 2024
4bf7a6c
Update lock
avaer Dec 30, 2024
cc7e4c1
Add intiface plugin
avaer Dec 30, 2024
97d59ab
Remove .npmignore
avaer Dec 30, 2024
95b5b59
Hack intiface plugin
avaer Dec 30, 2024
7969c40
Integration intiface plugin
avaer Dec 30, 2024
cb250f6
Hack intiface plugin
avaer Dec 30, 2024
e4188d6
Update lock
avaer Dec 30, 2024
023a94f
Add icp plugin
avaer Dec 30, 2024
7987766
Hack icp plugin
avaer Dec 30, 2024
421217a
Add plugin-icp to the list of plugins
avaer Dec 30, 2024
0ba0ead
Update lock
avaer Dec 30, 2024
d223632
Add echochambers plugin
avaer Dec 30, 2024
30cfcc9
Add plugin-echochambers to upstreet-agent plugins
avaer Dec 30, 2024
6a1fb64
Hack echochambers plugin
avaer Dec 30, 2024
c365eea
Update lock
avaer Dec 30, 2024
d84d001
Add starknet plugin
avaer Dec 30, 2024
38fe2cb
Remove .npmignore
avaer Dec 30, 2024
de465b8
Add '@elizaos/plugin-starknet' to the list of plugins
avaer Dec 30, 2024
587010d
Hack starknet plugin
avaer Dec 30, 2024
da12f5f
Update lock
avaer Dec 30, 2024
e65b608
Add conflux plugin
avaer Dec 30, 2024
1dde3ff
Add conflux plugin to upstreet-agent package
avaer Dec 30, 2024
f30dc1a
Hack conflux plugin
avaer Dec 30, 2024
68835ea
Update lock
avaer Dec 30, 2024
04cc5a0
Add aptos plugin
avaer Dec 30, 2024
2d644b8
Remove npmignore
avaer Dec 30, 2024
3ff76d8
Hack aptos plugin
avaer Dec 30, 2024
f22bc11
Add plugin-aptos to plugins list
avaer Dec 30, 2024
20a0637
Update lock
avaer Dec 30, 2024
80e6def
Add bootstrap plugin source
avaer Dec 30, 2024
0f3ac92
Remove .npmignore
avaer Dec 30, 2024
a157e61
Add Bootstrap plugin to the list of available plugins
avaer Dec 30, 2024
d160dd0
Hack boostrap plugin
avaer Dec 30, 2024
72887ba
Update lock
avaer Dec 30, 2024
4005547
Logging cleanup
avaer Dec 30, 2024
a4b94cd
Add ton plugin
avaer Dec 30, 2024
a896a19
Hack ton plugin
avaer Dec 30, 2024
4292609
Add ton plugin
avaer Dec 30, 2024
7ca56cf
Update lock
avaer Dec 30, 2024
77ff38b
Add cronoszkevm plugin
avaer Dec 30, 2024
826178d
Hack cronoszkevm plugin
avaer Dec 30, 2024
a558c06
Integrate cronosZkEVMPlugin
avaer Dec 30, 2024
a4f9d51
Update lock
avaer Dec 30, 2024
82b5d3c
Add abstract plugin
avaer Dec 30, 2024
0b0c5e9
Hack abstract plugin
avaer Dec 30, 2024
1178193
Add plugin-abstract to the list of plugins
avaer Dec 30, 2024
73cfe02
Update lock
avaer Dec 30, 2024
547e5b6
Add fuel plugin
avaer Dec 30, 2024
be27696
Remove npmignore
avaer Dec 30, 2024
3f6fb3e
Hack fuel plugin
avaer Dec 30, 2024
64c1e92
Integrate fuel plugin
avaer Dec 30, 2024
f0191d8
Update lock
avaer Dec 30, 2024
7715388
Add ferePro plugin
avaer Dec 30, 2024
83a878d
Remove npmignore
avaer Dec 30, 2024
3fc1446
Hack ferePro plugin
avaer Dec 30, 2024
606c5f9
Add ferePro plugin
avaer Dec 30, 2024
b1e56c5
Update lock
avaer Dec 30, 2024
d703f23
Move whatsapp plugin to plugins
avaer Dec 30, 2024
9902434
Remove whataspp plugin from clients
avaer Dec 30, 2024
a10e4ed
Plugins cleanup
avaer Dec 30, 2024
05526b4
Update plugin install
avaer Dec 30, 2024
046869e
Update lock
avaer Dec 30, 2024
f58dd31
Add discord client
avaer Dec 30, 2024
0062d79
Remove npmignore
avaer Dec 30, 2024
106aa53
Add github source
avaer Dec 30, 2024
b5a1081
Remove .npmignore
avaer Dec 30, 2024
eb1f1f4
Add twitter client
avaer Dec 30, 2024
25af084
Remove npmignore
avaer Dec 30, 2024
97ee037
Add client installs
avaer Dec 30, 2024
dd652b5
Update lock
avaer Dec 30, 2024
beb0f7e
Add components types
avaer Dec 30, 2024
6784438
Major clients integration stub update
avaer Dec 30, 2024
77aa2df
Major plugins integration update
avaer Dec 30, 2024
c1d4eac
Hook in initial runtime
avaer Dec 30, 2024
da08825
Hack clients
avaer Dec 30, 2024
803e0cf
Add slack client
avaer Dec 31, 2024
872e1c7
Install slack client
avaer Dec 31, 2024
a0f0755
Hook in slack client
avaer Dec 31, 2024
5f17d9e
Hack slack client
avaer Dec 31, 2024
7ddae5c
Update lock
avaer Dec 31, 2024
74d28b9
Add telegram client
avaer Dec 31, 2024
b2db1c6
Add telegram client
avaer Dec 31, 2024
acb7fad
Update lock
avaer Dec 31, 2024
b242106
Hack telegram client
avaer Dec 31, 2024
0fa02a3
Update lock
avaer Dec 31, 2024
9bb4b37
Install farcaster client
avaer Dec 31, 2024
2d419c8
Hook in farcaster client
avaer Dec 31, 2024
48c01c6
Hack farcaaster client
avaer Dec 31, 2024
e896f83
Update lock
avaer Dec 31, 2024
8ef4633
Add lens client
avaer Dec 31, 2024
5f5538a
Integrate lens client
avaer Dec 31, 2024
43204a9
Hack lens client
avaer Dec 31, 2024
f133712
Update lock
avaer Dec 31, 2024
dac4c20
Update @discordjs/opus to npm in discord-client
avaer Dec 31, 2024
3d827f4
Update lock
avaer Dec 31, 2024
1f944c5
Fixing chat build
avaer Dec 31, 2024
c38d2df
Revert "Update @discordjs/opus to npm in discord-client"
avaer Dec 31, 2024
1a89db8
Add cdc asset handling
avaer Dec 31, 2024
f2a7351
Add missing transpile package in chat config
avaer Dec 31, 2024
5cc054e
Fix package name
avaer Dec 31, 2024
25aa569
Remove discord client
avaer Dec 31, 2024
5735940
Update lock
avaer Dec 31, 2024
91b8994
Fix node: imports in chat
avaer Dec 31, 2024
fa871ba
Fix chat imports
avaer Dec 31, 2024
70a06cf
Add additional imports
avaer Dec 31, 2024
ef8698c
Add additional proxy packages
avaer Dec 31, 2024
43a42ae
Update lock
avaer Dec 31, 2024
c863c62
Small cleanup
avaer Dec 31, 2024
9380093
Add wrangler rules
avaer Dec 31, 2024
7f36210
Update wrangler compatibility flags
avaer Dec 31, 2024
c2be1a4
Fix electron runtime
avaer Dec 31, 2024
832b297
Remove old wrangler version
avaer Jan 1, 2025
d2979ef
Update wrangler version
avaer Jan 1, 2025
85dc36e
Remove conflicting fastembed module install
avaer Jan 1, 2025
2859191
Add init.ts
avaer Jan 1, 2025
ab1bfe8
Import init.ts
avaer Jan 1, 2025
cd88859
Copy in init.ts in agent install
avaer Jan 1, 2025
c8f7abd
Pass stack trace limit to wrangler
avaer Jan 1, 2025
37f55ba
Bugfix lens agent
avaer Jan 1, 2025
ab12e93
Fix wallet import
avaer Jan 1, 2025
e1acfa6
Remove dead AGENT_JSON var
avaer Jan 1, 2025
0d3ff74
Update lock
avaer Jan 1, 2025
71cf9ac
Add missing imports
avaer Jan 1, 2025
852f7a9
Hook in more core imports
avaer Jan 1, 2025
8c1309d
Hack import.meta.url
avaer Jan 1, 2025
f6e30ed
Fix import.meta.url hack
avaer Jan 1, 2025
6058596
Port amqplib -> rhea in solana plugin
avaer Jan 1, 2025
6577c26
Update lock
avaer Jan 1, 2025
60a0ef7
Add missing embedding.ts
avaer Jan 1, 2025
f17eeda
Merge branch 'dev' into plugins
avaer Jan 1, 2025
940cd4f
Comment out local embedding support
avaer Jan 1, 2025
c5002fb
Remove .gitignore
avaer Jan 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
78 changes: 70 additions & 8 deletions apps/chat/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const path = require('path');
const webpack = require('webpack');
const { builtinModules } = require('module');

module.exports = {
// experimental: {
Expand All @@ -14,6 +15,48 @@ module.exports = {
'react-agents-client',
'ecctrl',
'ucom',
'@elizaos/core',
'@elizaos/client-farcaster',
'@elizaos/client-github',
'@elizaos/client-lens',
'@elizaos/client-slack',
'@elizaos/client-telegram',
'@elizaos/client-twitter',
'@elizaos/plugin-0g',
'@elizaos/plugin-3d-generation',
'@elizaos/plugin-abstract',
'@elizaos/plugin-aptos',
'@elizaos/plugin-avalanche',
'@elizaos/plugin-bootstrap',
'@elizaos/plugin-coinbase',
'@elizaos/plugin-conflux',
'@elizaos/plugin-cronoszkevm',
'@elizaos/plugin-echochambers',
'@elizaos/plugin-evm',
'@elizaos/plugin-ferepro',
'@elizaos/plugin-flow',
'@elizaos/plugin-fuel',
'@elizaos/plugin-gitbook',
'@elizaos/plugin-goat',
'@elizaos/plugin-icp',
'@elizaos/plugin-image-generation',
'@elizaos/plugin-intiface',
'@elizaos/plugin-multiversx',
'@elizaos/plugin-near',
'@elizaos/plugin-nft-generation',
'@elizaos/plugin-node',
'@elizaos/plugin-solana',
'@elizaos/plugin-starknet',
'@elizaos/plugin-story',
'@elizaos/plugin-sui',
'@elizaos/plugin-tee',
'@elizaos/plugin-ton',
'@elizaos/plugin-trustdb',
'@elizaos/plugin-twitter',
'@elizaos/plugin-video-generation',
'@elizaos/plugin-web-search',
'@elizaos/plugin-whatsapp',
'@elizaos/plugin-zksync-era',
],
async redirects() {
return [
Expand Down Expand Up @@ -88,28 +131,42 @@ module.exports = {
use: [options.defaultLoaders.babel],
}); */

config.plugins.push(
new webpack.NormalModuleReplacementPlugin(/^node:(.*)$/, (resource) => {
resource.request = resource.request.replace(/^node:/, '');
})
);

// fix react resolution in sdk subpackage
const usdkPath = path.resolve(__dirname, '../../packages/usdk');
const upstreetAgentPath = path.resolve(__dirname, '../../packages/usdk/packages/upstreet-agent');
const reactAgentsPath = path.resolve(__dirname, '../../packages/usdk/packages/upstreet-agent/packages/react-agents');
const reactAgentsClientPath = path.resolve(__dirname, '../../packages/usdk/packages/upstreet-agent/packages/react-agents-client');
const reactAgentsBrowserPath = path.resolve(__dirname, '../../packages/usdk/packages/upstreet-agent/packages/react-agents-browser');
const replacePlugin = (scopePath, moduleRegexp) => {
const replacePlugin = (scopePath, moduleRegexp, importPath) => {
return new webpack.NormalModuleReplacementPlugin(moduleRegexp, (resource) => {
if (resource.context.includes(scopePath)) {
if (
(typeof scopePath == 'string' && resource.context.includes(scopePath)) ||
(scopePath instanceof RegExp && scopePath.test(resource.context))
) {
if (builtinModules.includes(resource.request)) {
resource.request = path.join(importPath, 'node_modules', resource.request);
}
const p = require.resolve(resource.request, {
paths: [scopePath],
paths: [importPath],
});
resource.request = p;
}
});
};
const modulesRegex = /^react|^fs$|^child_process$/;
config.plugins.push(
replacePlugin(reactAgentsPath, /^react/),
replacePlugin(reactAgentsClientPath, /^react/),
replacePlugin(reactAgentsBrowserPath, /^react/),
replacePlugin(upstreetAgentPath, /^react/),
replacePlugin(usdkPath, /^react/),
replacePlugin(reactAgentsPath, modulesRegex, upstreetAgentPath),
replacePlugin(reactAgentsClientPath, modulesRegex, upstreetAgentPath),
replacePlugin(reactAgentsBrowserPath, modulesRegex, upstreetAgentPath),
replacePlugin(upstreetAgentPath, modulesRegex, upstreetAgentPath),
replacePlugin(usdkPath, modulesRegex, upstreetAgentPath),
replacePlugin(/\/path-scurry\/|\/0g-ts-sdk\//, modulesRegex, upstreetAgentPath),
);

// config.experiments = {
Expand All @@ -123,6 +180,11 @@ module.exports = {
type: 'asset/resource',
});

config.module.rules.push({
test: /\.cdc$/,
type: 'asset/source'
});

return config;
},
async headers() {
Expand Down
1 change: 0 additions & 1 deletion packages/usdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"web-worker": "1.2.0",
"webp-wasm": "^1.0.6",
"winston": "^3.16.0",
"wrangler": "^3.95.0",
"ws": "^8.17.0",
"yjs": "^13.6.18",
"zjs": "file:./packages/upstreet-agent/packages/react-agents-client/packages/multiplayer/packages/zjs",
Expand Down
4 changes: 2 additions & 2 deletions packages/usdk/packages/upstreet-agent/durable-object.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './init.ts';
import './main.jsx';
import React from 'react';
import dotenv from 'dotenv';
import { createRoot, Root } from 'react-agents/root.ts';
Expand All @@ -6,8 +8,6 @@ import App from './agent.tsx';
import agentJsonSource from './agent.json';
import envTxt from './.env.txt';

Error.stackTraceLimit = 300;

const alarmTimeout = 10 * 1000;

const parseAgentJson = (agentJsonSource) => {
Expand Down
7 changes: 7 additions & 0 deletions packages/usdk/packages/upstreet-agent/init.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Error.stackTraceLimit = 300;
globalThis.__filename = 'node.js';
globalThis.__dirname = '/';
(globalThis.process as any).version = '20.0.0';
if (typeof import.meta.url === 'undefined') {
import.meta.url = `file://localhost/${globalThis.__filename}`;
}
3 changes: 1 addition & 2 deletions packages/usdk/packages/upstreet-agent/main.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import './init.ts';
export { DurableObject } from './durable-object.tsx';
import { headers } from 'react-agents/constants.mjs';
import agentJsonSource from './agent.json';

Error.stackTraceLimit = 300;

const parseAgentJson = (agentJsonSource) => {
try {
if (typeof agentJsonSource === 'string') {
Expand Down
45 changes: 45 additions & 0 deletions packages/usdk/packages/upstreet-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,65 @@
"dependencies": {
"@aws-sdk/util-format-url": "^3.577.0",
"@electric-sql/pglite": "^0.2.15",
"@elizaos/core": "file:./packages/elizaos-core-proxy",
"@elizaos/client-farcaster": "file:./packages/react-agents/components/clients/client-farcaster",
"@elizaos/client-github": "file:./packages/react-agents/components/clients/client-github",
"@elizaos/client-lens": "file:./packages/react-agents/components/clients/client-lens",
"@elizaos/client-slack": "file:./packages/react-agents/components/clients/client-slack",
"@elizaos/client-telegram": "file:./packages/react-agents/components/clients/client-telegram",
"@elizaos/client-twitter": "file:./packages/react-agents/components/clients/client-twitter",
"@elizaos/plugin-0g": "file:./packages/react-agents/components/plugins/plugin-0g",
"@elizaos/plugin-3d-generation": "file:./packages/react-agents/components/plugins/plugin-3d-generation",
"@elizaos/plugin-abstract": "file:./packages/react-agents/components/plugins/plugin-abstract",
"@elizaos/plugin-aptos": "file:./packages/react-agents/components/plugins/plugin-aptos",
"@elizaos/plugin-bootstrap": "file:./packages/react-agents/components/plugins/plugin-bootstrap",
"@elizaos/plugin-coinbase": "file:./packages/react-agents/components/plugins/plugin-coinbase",
"@elizaos/plugin-conflux": "file:./packages/react-agents/components/plugins/plugin-conflux",
"@elizaos/plugin-cronoszkevm": "file:./packages/react-agents/components/plugins/plugin-cronoszkevm",
"@elizaos/plugin-echochambers": "file:./packages/react-agents/components/plugins/plugin-echochambers",
"@elizaos/plugin-evm": "file:./packages/react-agents/components/plugins/plugin-evm",
"@elizaos/plugin-avalanche": "file:./packages/react-agents/components/plugins/plugin-avalanche",
"@elizaos/plugin-ferePro": "file:./packages/react-agents/components/plugins/plugin-ferePro",
"@elizaos/plugin-flow": "file:./packages/react-agents/components/plugins/plugin-flow",
"@elizaos/plugin-fuel": "file:./packages/react-agents/components/plugins/plugin-fuel",
"@elizaos/plugin-gitbook": "file:./packages/react-agents/components/plugins/plugin-gitbook",
"@elizaos/plugin-goat": "file:./packages/react-agents/components/plugins/plugin-goat",
"@elizaos/plugin-icp": "file:./packages/react-agents/components/plugins/plugin-icp",
"@elizaos/plugin-image-generation": "file:./packages/react-agents/components/plugins/plugin-image-generation",
"@elizaos/plugin-intiface": "file:./packages/react-agents/components/plugins/plugin-intiface",
"@elizaos/plugin-near": "file:./packages/react-agents/components/plugins/plugin-near",
"@elizaos/plugin-nft-generation": "file:./packages/react-agents/components/plugins/plugin-nft-generation",
"@elizaos/plugin-multiversx": "file:./packages/react-agents/components/plugins/plugin-multiversx",
"@elizaos/plugin-solana": "file:./packages/react-agents/components/plugins/plugin-solana",
"@elizaos/plugin-starknet": "file:./packages/react-agents/components/plugins/plugin-starknet",
"@elizaos/plugin-story": "file:./packages/react-agents/components/plugins/plugin-story",
"@elizaos/plugin-sui": "file:./packages/react-agents/components/plugins/plugin-sui",
"@elizaos/plugin-tee": "file:./packages/react-agents/components/plugins/plugin-tee",
"@elizaos/plugin-ton": "file:./packages/react-agents/components/plugins/plugin-ton",
"@elizaos/plugin-trustdb": "file:./packages/react-agents/components/plugins/plugin-trustdb",
"@elizaos/plugin-twitter": "file:./packages/react-agents/components/plugins/plugin-twitter",
"@elizaos/plugin-video-generation": "file:./packages/react-agents/components/plugins/plugin-video-generation",
"@elizaos/plugin-web-search": "file:./packages/react-agents/components/plugins/plugin-web-search",
"@elizaos/plugin-whatsapp": "file:./packages/react-agents/components/plugins/plugin-whatsapp",
"@elizaos/plugin-zksync-era": "file:./packages/react-agents/components/plugins/plugin-zksync-era",
"@iarna/toml": "^2.2.5",
"@supabase/postgrest-js": "^1.17.7",
"@supabase/supabase-js": "^2.47.1",
"@tsndr/cloudflare-worker-jwt": "2.5.3",
"@types/jest": "^29.5.13",
"browser-util-inspect": "^0.2.0",
"child_process": "file:./packages/fs-proxy",
"codecs": "file:./packages/codecs",
"debouncer": "file:./packages/debouncer",
"dedent": "^1.5.3",
"dotenv": "^16.4.5",
"ethers": "^6.12.0",
"format-util": "^1.0.5",
"fs": "file:./packages/fs-proxy",
"javascript-time-ago": "^2.5.11",
"jest": "^29.0.0",
"jimp": "^1.6.0",
"memfs": "^4.15.1",
"memoize-one": "^6.0.0",
"minimatch": "^9.0.4",
"openai": "^4.56.0",
Expand All @@ -31,6 +75,7 @@
"react-agents-node": "file:./packages/react-agents-node",
"react-reconciler": "file:./packages/react-reconciler",
"stripe": "^16.10.0",
"tls": "file:./packages/tls-proxy",
"together-ai": "^0.6.0-alpha.4",
"ts-jest": "^29.2.5",
"twitter-api-sdk": "^1.2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const spawn = () => {
throw new Error('not implemented');
};
const childProcess = {
spawn,
};
export default childProcess;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "child_process",
"main": "child-process.mjs"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import handlebars from "handlebars";
import { type State } from "./types.ts";
import { names, uniqueNamesGenerator } from "unique-names-generator";

/**
* Composes a context string by replacing placeholders in a template with corresponding values from the state.
*
* This function takes a template string with placeholders in the format `{{placeholder}}` and a state object.
* It replaces each placeholder with the value from the state object that matches the placeholder's name.
* If a matching key is not found in the state object for a given placeholder, the placeholder is replaced with an empty string.
*
* By default, this function uses a simple string replacement approach. However, when `templatingEngine` is set to `'handlebars'`, it uses Handlebars templating engine instead, compiling the template into a reusable function and evaluating it with the provided state object.
*
* @param {Object} params - The parameters for composing the context.
* @param {State} params.state - The state object containing values to replace the placeholders in the template.
* @param {string} params.template - The template string containing placeholders to be replaced with state values.
* @param {"handlebars" | undefined} [params.templatingEngine] - The templating engine to use for compiling and evaluating the template (optional, default: `undefined`).
* @returns {string} The composed context string with placeholders replaced by corresponding state values.
*
* @example
* // Given a state object and a template
* const state = { userName: "Alice", userAge: 30 };
* const template = "Hello, {{userName}}! You are {{userAge}} years old";
*
* // Composing the context with simple string replacement will result in:
* // "Hello, Alice! You are 30 years old."
* const contextSimple = composeContext({ state, template });
*/
export const composeContext = ({
state,
template,
templatingEngine,
}: {
state: State;
template: string;
templatingEngine?: "handlebars";
}) => {
if (templatingEngine === "handlebars") {
const templateFunction = handlebars.compile(template);
return templateFunction(state);
}

// @ts-expect-error match isn't working as expected
const out = template.replace(/{{\w+}}/g, (match) => {
const key = match.replace(/{{|}}/g, "");
return state[key] ?? "";
});
return out;
};

/**
* Adds a header to a body of text.
*
* This function takes a header string and a body string and returns a new string with the header prepended to the body.
* If the body string is empty, the header is returned as is.
*
* @param {string} header - The header to add to the body.
* @param {string} body - The body to which to add the header.
* @returns {string} The body with the header prepended.
*
* @example
* // Given a header and a body
* const header = "Header";
* const body = "Body";
*
* // Adding the header to the body will result in:
* // "Header\nBody"
* const text = addHeader(header, body);
*/
export const addHeader = (header: string, body: string) => {
return body.length > 0 ? `${header ? header + "\n" : header}${body}\n` : "";
};

/**
* Generates a string with random user names populated in a template.
*
* This function generates a specified number of random user names and populates placeholders
* in the provided template with these names. Placeholders in the template should follow the format `{{userX}}`
* where `X` is the position of the user (e.g., `{{user1}}`, `{{user2}}`).
*
* @param {string} params.template - The template string containing placeholders for random user names.
* @param {number} params.length - The number of random user names to generate.
* @returns {string} The template string with placeholders replaced by random user names.
*
* @example
* // Given a template and a length
* const template = "Hello, {{user1}}! Meet {{user2}} and {{user3}}.";
* const length = 3;
*
* // Composing the random user string will result in:
* // "Hello, John! Meet Alice and Bob."
* const result = composeRandomUser({ template, length });
*/
export const composeRandomUser = (template: string, length: number) => {
const exampleNames = Array.from({ length }, () =>
uniqueNamesGenerator({ dictionaries: [names] })
);
let result = template;
for (let i = 0; i < exampleNames.length; i++) {
result = result.replaceAll(`{{user${i + 1}}}`, exampleNames[i]);
}

return result;
};
Loading