* fix(codex): cleanup dead code and add to release lifecycle - Remove orphaned reflect() method from client.py (leftover from dropped auto-mode) - Remove dead retainToolCalls config default (never wired through) - Add codex to release-integration.sh valid integrations - Add settings.json version fallback to release script - Add codex CI test job in test.yml - Add codex to integrations.json registry * docs(codex): add changelog page and link from integration docs * feat(codex): add hosted installer script (get-codex) Add self-contained installer at hindsight.vectorize.io/get-codex that downloads scripts from GitHub, configures hooks, and supports local/cloud mode selection — no git clone required. Update docs and README to use the one-liner install: curl -fsSL https://hindsight.vectorize.io/get-codex | bash * chore(codex): remove install.sh in favor of hosted get-codex * fix(docs): use /next/ prefix for codex changelog link * fix(docs): use GitHub link for codex changelog back-link
160 lines
4.9 KiB
Bash
Executable file
160 lines
4.9 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
print_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
|
print_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
print_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
|
|
VALID_INTEGRATIONS=("litellm" "pydantic-ai" "crewai" "ag2" "ai-sdk" "chat" "openclaw" "langgraph" "nemoclaw" "strands" "claude-code" "codex")
|
|
|
|
usage() {
|
|
print_error "Usage: $0 <integration> <version>"
|
|
echo ""
|
|
echo " integration One of: ${VALID_INTEGRATIONS[*]}"
|
|
echo " version Semantic version (e.g. 0.2.0)"
|
|
echo ""
|
|
echo "Examples:"
|
|
echo " $0 litellm 0.2.0"
|
|
echo " $0 pydantic-ai 1.0.0"
|
|
exit 1
|
|
}
|
|
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
usage
|
|
fi
|
|
|
|
INTEGRATION=$1
|
|
VERSION=$2
|
|
|
|
# Validate integration name
|
|
VALID=false
|
|
for v in "${VALID_INTEGRATIONS[@]}"; do
|
|
if [ "$v" = "$INTEGRATION" ]; then
|
|
VALID=true
|
|
break
|
|
fi
|
|
done
|
|
if [ "$VALID" = "false" ]; then
|
|
print_error "Unknown integration '$INTEGRATION'"
|
|
print_info "Valid integrations: ${VALID_INTEGRATIONS[*]}"
|
|
exit 1
|
|
fi
|
|
|
|
# Validate version format
|
|
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
print_error "Invalid version format. Please use semantic versioning (e.g., 0.2.0)"
|
|
exit 1
|
|
fi
|
|
|
|
TAG="integrations/$INTEGRATION/v$VERSION"
|
|
|
|
print_info "Releasing $INTEGRATION v$VERSION (tag: $TAG)"
|
|
|
|
# Check if we're on main branch
|
|
CURRENT_BRANCH=$(git branch --show-current)
|
|
if [ "$CURRENT_BRANCH" != "main" ]; then
|
|
print_warn "You are not on the main branch (current: $CURRENT_BRANCH)"
|
|
read -p "Do you want to continue? (y/n) " -n 1 -r
|
|
echo
|
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
print_error "Release cancelled"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Check if working directory is clean
|
|
if [[ -n $(git status -s) ]]; then
|
|
print_error "Working directory is not clean. Please commit or stash your changes."
|
|
git status -s
|
|
exit 1
|
|
fi
|
|
|
|
# Check if tag already exists
|
|
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
|
print_error "Tag $TAG already exists"
|
|
exit 1
|
|
fi
|
|
|
|
# Load .env for OPENAI_API_KEY if needed
|
|
if [ -z "$OPENAI_API_KEY" ] && [ -f ".env" ]; then
|
|
print_info "Loading environment from .env"
|
|
set -a
|
|
source ".env"
|
|
set +a
|
|
fi
|
|
|
|
if [ -z "$OPENAI_API_KEY" ]; then
|
|
print_error "OPENAI_API_KEY is not set and no .env file found. Required for changelog generation."
|
|
exit 1
|
|
fi
|
|
|
|
# Determine integration type and update version
|
|
INTEGRATION_DIR="hindsight-integrations/$INTEGRATION"
|
|
|
|
if [ ! -d "$INTEGRATION_DIR" ]; then
|
|
print_error "Integration directory not found: $INTEGRATION_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -f "$INTEGRATION_DIR/pyproject.toml" ]; then
|
|
print_info "Updating version in $INTEGRATION_DIR/pyproject.toml"
|
|
sed -i.bak "s/^version = \".*\"/version = \"$VERSION\"/" "$INTEGRATION_DIR/pyproject.toml"
|
|
rm "$INTEGRATION_DIR/pyproject.toml.bak"
|
|
elif [ -f "$INTEGRATION_DIR/package.json" ]; then
|
|
print_info "Updating version in $INTEGRATION_DIR/package.json"
|
|
sed -i.bak "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" "$INTEGRATION_DIR/package.json"
|
|
rm "$INTEGRATION_DIR/package.json.bak"
|
|
elif [ -f "$INTEGRATION_DIR/.claude-plugin/plugin.json" ]; then
|
|
print_info "Updating version in $INTEGRATION_DIR/.claude-plugin/plugin.json"
|
|
sed -i.bak "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" "$INTEGRATION_DIR/.claude-plugin/plugin.json"
|
|
rm "$INTEGRATION_DIR/.claude-plugin/plugin.json.bak"
|
|
elif [ -f "$INTEGRATION_DIR/settings.json" ] && grep -q '"version"' "$INTEGRATION_DIR/settings.json"; then
|
|
print_info "Updating version in $INTEGRATION_DIR/settings.json"
|
|
sed -i.bak "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" "$INTEGRATION_DIR/settings.json"
|
|
rm "$INTEGRATION_DIR/settings.json.bak"
|
|
else
|
|
print_error "No pyproject.toml, package.json, plugin.json, or versioned settings.json found in $INTEGRATION_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
# Generate changelog entry using LLM
|
|
print_info "Generating changelog entry..."
|
|
if cd hindsight-dev && uv run generate-changelog "$VERSION" --integration "$INTEGRATION"; then
|
|
cd ..
|
|
print_info "Changelog generated"
|
|
else
|
|
cd ..
|
|
print_error "Changelog generation failed"
|
|
git checkout .
|
|
exit 1
|
|
fi
|
|
|
|
# Regenerate docs skill so changelog/SDK pages stay in sync
|
|
print_info "Regenerating docs skill..."
|
|
./scripts/generate-docs-skill.sh
|
|
|
|
# Commit version bump + changelog + regenerated skill together
|
|
print_info "Committing changes..."
|
|
git add "hindsight-integrations/$INTEGRATION/" "hindsight-docs/src/pages/changelog/integrations/$INTEGRATION.md" "skills/"
|
|
git commit --no-verify -m "release($INTEGRATION): v$VERSION"
|
|
|
|
# Create annotated tag
|
|
print_info "Creating tag $TAG..."
|
|
git tag -a "$TAG" -m "Release $INTEGRATION v$VERSION"
|
|
|
|
# Push commit and tag
|
|
print_info "Pushing to remote..."
|
|
git push origin "$CURRENT_BRANCH"
|
|
git push origin "$TAG"
|
|
|
|
print_info "✅ Released $INTEGRATION v$VERSION"
|
|
print_info "Tag: $TAG"
|
|
print_info "GitHub Actions will publish to the package registry."
|