OpenWriterControle/update.sh
Darren Hinde bf02ad0d5c
refactor: Rename repository to OpenAgents Control (#100)
* refactor: Rename repository to OpenAgents Control

Update all project references from "OpenAgents" to "OpenAgents Control":
- Updated core config files (package.json, registry.json)
- Updated documentation (README.md, docs/)
- Updated scripts (install.sh, update.sh, test scripts)
- Updated agent and command files
- Updated integrations and packages
- Updated all GitHub URLs to use OpenAgentsControl

Naming convention:
- Display name: "OpenAgents Control"
- Repository URL: OpenAgentsControl

* feat: Enable subagent-to-subagent delegation (ContextScout integration)

Allow coding-related subagents to call ContextScout for context discovery:
- CoderAgent: Can now discover coding standards on-demand
- TestEngineer: Can now discover test coverage and TDD guidelines
- CodeReviewer: Can now discover code review and security patterns
- BuildAgent: Can now discover build validation standards
- DocWriter: Can now discover documentation formatting guidelines

Changes per subagent:
- Added `task: true` to tools section
- Added permission allowlist for ContextScout only (deny all other delegation)
- Added Context Discovery workflow section with when-to-call guidance

This enables subagents to be self-sufficient for finding relevant standards
instead of relying on orchestrator to provide all context files.

Benefits:
- Subagents can discover what they need when context isn't explicit
- Maintains security (only ContextScout allowed via task tool)
- Follows existing patterns (uses task tool like main agents)

* fix: Set OPENCODE_BRANCH in CI tests to use PR branch for downloads

- Add OPENCODE_BRANCH environment variable to E2E tests
- Add OPENCODE_BRANCH environment variable to profile smoke tests
- Ensures tests download files from the PR branch instead of main
- Fixes E2E test failures after repository rename to OpenAgentsControl
2026-01-18 09:31:35 +00:00

83 lines
2.6 KiB
Bash
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
#############################################################################
# OpenAgents Control Updater
# Updates existing OpenCode components to latest versions
#############################################################################
set -e
# Colors
GREEN='\033[0;32m'
# YELLOW='\033[1;33m' # Unused
BLUE='\033[0;34m'
CYAN='\033[0;36m'
BOLD='\033[1m'
NC='\033[0m'
REPO_URL="https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main"
INSTALL_DIR=".opencode"
print_success() { echo -e "${GREEN}✓${NC} $1"; }
print_info() { echo -e "${BLUE}ℹ${NC} $1"; }
print_step() { echo -e "\n${CYAN}${BOLD}▶${NC} $1\n"; }
print_header() {
echo -e "${CYAN}${BOLD}"
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ OpenAgents Control Updater v1.0.0 ║"
echo "║ ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo -e "${NC}"
}
update_component() {
local path=$1
local url="${REPO_URL}/${path}"
if [ ! -f "$path" ]; then
print_info "Skipping $path (not installed)"
return
fi
# Backup existing file
cp "$path" "${path}.backup"
if curl -fsSL "$url" -o "$path"; then
print_success "Updated $path"
rm "${path}.backup"
else
print_info "Failed to update $path, restoring backup"
mv "${path}.backup" "$path"
fi
}
main() {
print_header
if [ ! -d "$INSTALL_DIR" ]; then
echo "Error: $INSTALL_DIR directory not found"
echo "Run install.sh first to install components"
exit 1
fi
print_step "Updating components..."
# Update all markdown files in .opencode
while IFS= read -r -d '' file; do
update_component "$file"
done < <(find "$INSTALL_DIR" -name "*.md" -type f -print0)
# Update TypeScript files
while IFS= read -r -d '' file; do
update_component "$file"
done < <(find "$INSTALL_DIR" -name "*.ts" -type f -not -path "*/node_modules/*" -print0)
# Update config files
[ -f "env.example" ] && update_component "env.example"
print_success "Update complete!"
}
main "$@"