Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:25:37 +08:00
commit 13df4850f7
29 changed files with 6729 additions and 0 deletions

71
scripts/check-versions.sh Executable file
View File

@@ -0,0 +1,71 @@
#!/bin/bash
# TheSys Generative UI - Version Checker
#
# Verifies installed package versions match recommended versions
# Usage: ./scripts/check-versions.sh
set -e
echo "========================================="
echo "TheSys Generative UI - Version Checker"
echo "========================================="
echo ""
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "❌ node_modules not found. Run npm/pnpm install first."
exit 1
fi
# Recommended versions
declare -A RECOMMENDED=(
["@thesysai/genui-sdk"]="0.6.40"
["@crayonai/react-ui"]="0.8.27"
["@crayonai/react-core"]="0.7.6"
["openai"]="4.73.0"
["zod"]="3.24.1"
["react"]="19.0.0"
)
echo "Checking package versions..."
echo ""
ALL_OK=true
for package in "${!RECOMMENDED[@]}"; do
recommended="${RECOMMENDED[$package]}"
# Try to get installed version
if [ -f "node_modules/$package/package.json" ]; then
installed=$(node -p "require('./node_modules/$package/package.json').version" 2>/dev/null || echo "unknown")
# Simple version comparison (ignores patch for minor updates)
installed_major=$(echo "$installed" | cut -d. -f1)
installed_minor=$(echo "$installed" | cut -d. -f2)
recommended_major=$(echo "$recommended" | cut -d. -f1)
recommended_minor=$(echo "$recommended" | cut -d. -f2)
if [ "$installed_major" -eq "$recommended_major" ] && [ "$installed_minor" -ge "$recommended_minor" ]; then
echo "$package: $installed (recommended: ~$recommended)"
else
echo "⚠️ $package: $installed (recommended: ~$recommended)"
ALL_OK=false
fi
else
echo "$package: NOT INSTALLED (recommended: ~$recommended)"
ALL_OK=false
fi
done
echo ""
if [ "$ALL_OK" = true ]; then
echo "✅ All packages are at compatible versions!"
else
echo "⚠️ Some packages need updating. Run:"
echo " npm install @thesysai/genui-sdk@^0.6.40 @crayonai/react-ui@^0.8.27 @crayonai/react-core@^0.7.6"
fi
echo ""
echo "For version compatibility matrix, see references/common-errors.md"

75
scripts/install-dependencies.sh Executable file
View File

@@ -0,0 +1,75 @@
#!/bin/bash
# TheSys Generative UI - Dependency Installation Script
#
# Installs all required packages for TheSys C1 integration
# Usage: ./scripts/install-dependencies.sh
set -e
echo "========================================="
echo "TheSys Generative UI - Dependency Installation"
echo "========================================="
echo ""
# Detect package manager
if command -v pnpm &> /dev/null; then
PM="pnpm"
elif command -v npm &> /dev/null; then
PM="npm"
else
echo "❌ Error: No package manager found (npm or pnpm required)"
exit 1
fi
echo "📦 Using package manager: $PM"
echo ""
# Core packages
echo "Installing core TheSys packages..."
$PM install @thesysai/genui-sdk@^0.6.40 \
@crayonai/react-ui@^0.8.27 \
@crayonai/react-core@^0.7.6 \
@crayonai/stream@^0.1.0
# React dependencies (if not already installed)
echo ""
echo "Checking React dependencies..."
if ! $PM list react &> /dev/null; then
echo "Installing React..."
$PM install react@^19.0.0 react-dom@^19.0.0
fi
# Error boundary
echo ""
echo "Installing React Error Boundary..."
$PM install react-error-boundary@^5.0.0
# AI integration
echo ""
echo "Installing OpenAI SDK..."
$PM install openai@^4.73.0
# Tool calling
echo ""
echo "Installing Zod for tool calling..."
$PM install zod@^3.24.1 zod-to-json-schema@^3.24.1
# Optional dependencies
echo ""
read -p "Install optional dependencies (Tavily for web search)? [y/N]: " install_optional
if [[ $install_optional =~ ^[Yy]$ ]]; then
echo "Installing optional dependencies..."
$PM install @tavily/core@^1.0.0
fi
echo ""
echo "✅ Installation complete!"
echo ""
echo "Next steps:"
echo "1. Set THESYS_API_KEY environment variable"
echo "2. Choose a template from templates/ directory"
echo "3. Start building!"
echo ""
echo "For help, see README.md or SKILL.md"