Skip to content

Commit 7d838ce

Browse files
committed
Files required for PR, now ready for review
1 parent b4ad3ce commit 7d838ce

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,5 @@ STORY_PRIVATE_KEY= # Story private key
335335
STORY_API_BASE_URL= # Story API base URL
336336
STORY_API_KEY= # Story API key
337337
PINATA_JWT= # Pinata JWT for uploading files to IPFS
338+
339+
GITHUB_TOKEN= # Github token for github actions

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ You may need to install Sharp. If you see an error when starting up, try install
120120
pnpm install --include=optional sharp
121121
```
122122

123+
### Optional: install the Shaiw Developer Code Assistant
124+
125+
[README.md](packages/plugin-code-assistant/README.md)
126+
123127
### Community & contact
124128

125129
- [GitHub Issues](https://github.com/elizaos/eliza/issues). Best for: bugs you encounter using Eliza, and feature proposals.

scripts/dev.sh

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/bin/bash
2+
3+
echo "Passing arguments: $*"
4+
5+
# Base packages directory
6+
PACKAGES_DIR="./packages"
7+
8+
# Display help message to users
9+
cat << "EOF"
10+
11+
***********************************************************************
12+
* *
13+
* IMPORTANT NOTICE: *
14+
* *
15+
* To add your plugin to the development workflow: *
16+
* *
17+
* 1. Navigate to the 'scripts' directory in your project. *
18+
* *
19+
* cd scripts *
20+
* *
21+
* 2. Edit the 'dev.sh' script file. *
22+
* *
23+
* nano dev.sh *
24+
* *
25+
* 3. Add the following changes: *
26+
* *
27+
* a. Ensure your plugin's package.json contains a 'dev' command *
28+
* under the "scripts" section. Example: *
29+
* *
30+
* "scripts": { *
31+
* "dev": "your-dev-command-here" *
32+
* } *
33+
* *
34+
* b. Add your plugin's folder name to the WORKING_FOLDERS list *
35+
* (relative to ./packages). *
36+
* *
37+
* Example: WORKING_FOLDERS=("client-direct" "your-plugin-folder") *
38+
* *
39+
* 4. Update the 'agent/package.json' file: *
40+
* *
41+
* Add your plugin to the "dependencies" section like so: *
42+
* *
43+
* "@elizaos/your-plugin-name": "workspace:*" *
44+
* *
45+
* 5. Edit the 'index.ts' file in 'agent/src': *
46+
* *
47+
* a. Import your plugin: *
48+
* *
49+
* import yourPlugin from '@elizaos/your-plugin-name'; *
50+
* *
51+
* b. Add your plugin to the `plugins` array: *
52+
* *
53+
* const plugins = [ *
54+
* existingPlugin, *
55+
* yourPlugin, *
56+
* ]; *
57+
* *
58+
* This will ensure that your plugin's development server runs *
59+
* alongside others when you execute this script. *
60+
***********************************************************************
61+
62+
EOF
63+
64+
# 2 seconds delay
65+
for i in {1..5}; do
66+
echo -n "."
67+
sleep 0.4
68+
done
69+
70+
# Check if the packages directory exists
71+
if [ ! -d "$PACKAGES_DIR" ]; then
72+
echo "Error: Directory $PACKAGES_DIR does not exist."
73+
exit 1
74+
fi
75+
76+
# List of working folders to watch (relative to $PACKAGES_DIR)
77+
WORKING_FOLDERS=("client-direct") # Core is handled separately
78+
79+
# Initialize an array to hold package-specific commands
80+
COMMANDS=()
81+
82+
# Ensure "core" package runs first
83+
CORE_PACKAGE="$PACKAGES_DIR/core"
84+
if [ -d "$CORE_PACKAGE" ]; then
85+
COMMANDS+=("pnpm --dir $CORE_PACKAGE dev -- $*")
86+
else
87+
echo "Warning: 'core' package not found in $PACKAGES_DIR."
88+
fi
89+
90+
# Process remaining working folders
91+
for FOLDER in "${WORKING_FOLDERS[@]}"; do
92+
PACKAGE="$PACKAGES_DIR/$FOLDER"
93+
94+
# Check if the folder exists and add the command
95+
if [ -d "$PACKAGE" ]; then
96+
COMMANDS+=("pnpm --dir $PACKAGE dev -- $*")
97+
else
98+
echo "Warning: '$FOLDER' folder not found in $PACKAGES_DIR."
99+
fi
100+
done
101+
102+
# Add specific commands for other directories or cases
103+
if [ -d "./client" ]; then
104+
COMMANDS+=("pnpm --dir client dev -- $*")
105+
else
106+
echo "Warning: 'client' directory not found."
107+
fi
108+
109+
if [ -d "./agent" ]; then
110+
# Build the watch paths dynamically from WORKING_FOLDERS
111+
WATCH_PATHS=()
112+
for FOLDER in "${WORKING_FOLDERS[@]}"; do
113+
WATCH_PATHS+=("--watch './packages/$FOLDER/dist'")
114+
done
115+
116+
COMMANDS+=("nodemon ${WATCH_PATHS[@]} -e js,json,map --delay 2 --exec 'pnpm --dir agent dev -- $*'")
117+
else
118+
echo "Warning: 'agent' directory not found."
119+
fi
120+
121+
# Run build command first
122+
if ! pnpm build; then
123+
echo "Build failed. Exiting."
124+
exit 1
125+
fi
126+
127+
# Run all commands concurrently
128+
if [ ${#COMMANDS[@]} -gt 0 ]; then
129+
npx concurrently --raw "${COMMANDS[@]}"
130+
else
131+
echo "No valid packages to run."
132+
fi

0 commit comments

Comments
 (0)