Skip to content

Commit

Permalink
Fix zip file generation. Fix default name state on frontend.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillevalin committed Jan 7, 2025
1 parent a44d511 commit d0e4737
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
18 changes: 7 additions & 11 deletions .github/build_tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,18 @@ for tool_dir in tools/*/; do
version=$(echo "$metadata_content" | jq -r '.version // "0.0.0"')
keywords=$(echo "$metadata_content" | jq -r '.keywords // ["tool"]')

# Request zip file from the node
response=$(curl -s -w "\n%{http_code}" --location "${SHINKAI_NODE_ADDR}/v2/export_tool?tool_key_path=${tool_router_key}" \
# Request zip file from the node.
curl -s --location "${SHINKAI_NODE_ADDR}/v2/export_tool?tool_key_path=${tool_router_key}" \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json; charset=utf-8')
--header 'Content-Type: application/json; charset=utf-8' > packages/${tool_name}.zip

http_code=$(echo "$response" | tail -n1)
zip_content=$(echo "$response" | head -n1)

if [ "$http_code" != "200" ]; then
echo "Failed to export tool from Shinkai node. HTTP status: $http_code"
echo "Response: $zip_content"
# Validate that the downloaded zip file is valid
if ! unzip -t "packages/${tool_name}.zip" > /dev/null 2>&1; then
echo "Error: Invalid zip file downloaded for ${tool_name}"
rm "packages/${tool_name}.zip"
continue
fi

echo "$zip_content" > packages/${tool_name}.zip

# Generate a blake3 hash of the .zip file
blake3_hash=$(b3sum packages/${tool_name}.zip | cut -d ' ' -f 1)

Expand Down
5 changes: 2 additions & 3 deletions registry/src/components/UserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ function UserProfile() {

const [name, setName] = useState('');
useEffect(() => {
if (user?.customMetadata?.name) {
setName(user.customMetadata.name);
}
if (user?.customMetadata?.name) setName(user.customMetadata.name);
else setName('');
}, [user]);

if (!ready || !authenticated) {
Expand Down

0 comments on commit d0e4737

Please sign in to comment.