- Rename MCP tool `qwen3_task` → `task` in server.py and all references - Enforce direct use of `mcp__qwen3__task` (no sub-agents) in docs - Add bootstrap logic to install.sh/update_crazyclaude.sh for repo self-installation - Introduce tools-local/ directory for local tool overrides - Add test suite (test_qwen3.sh, test_qwen3.md) to validate Qwen3 file generation - Update .gitignore: ignore test_qwen3_output/, add missing .claude/ - Add system prompt to server.py for fs_write enforcement - Update agent docs (qwen3-worker, code-reviewer, delegation-rules, task-planner) to reflect new tool name and workflow - Add system instruction: always use fs_write/fs_patch, never display content in response
80 lines
2.1 KiB
Bash
Executable File
80 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Met à jour .claude depuis CrazyClaude et llm-functions depuis upstream,
|
|
# puis reconstruit les outils aichat.
|
|
#
|
|
# Usage : bash .claude/update_crazyclaude.sh [--dry-run]
|
|
|
|
set -euo pipefail
|
|
|
|
CLAUDE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
LLM_DIR="$CLAUDE_DIR/llm-functions"
|
|
|
|
# Bootstrap : si on lance depuis le repo CrazyClaude lui-même (pas depuis .claude/)
|
|
# on recopie les fichiers sources vers .claude/ puis on rebuild les outils
|
|
if [[ "$(basename "$CLAUDE_DIR")" != ".claude" ]]; then
|
|
TARGET="${1:-$(pwd)/.claude}"
|
|
echo "==> Bootstrap : synchronisation de $CLAUDE_DIR → $TARGET"
|
|
rsync -a --exclude='.git' --exclude='llm-functions' --exclude='venv' \
|
|
"$CLAUDE_DIR/" "$TARGET/"
|
|
echo "==> Rebuild des outils"
|
|
exec bash "$TARGET/update_crazyclaude.sh" "${@:2}"
|
|
fi
|
|
|
|
# On est maintenant dans .claude/, on peut continuer normalement
|
|
|
|
|
|
dry_run=0
|
|
[[ "${1:-}" == "--dry-run" ]] && dry_run=1
|
|
|
|
run() {
|
|
if [[ "$dry_run" -eq 1 ]]; then
|
|
echo "[dry-run] $*"
|
|
else
|
|
echo "» $*"
|
|
"$@"
|
|
fi
|
|
}
|
|
|
|
require() {
|
|
command -v "$1" &>/dev/null || { echo "ERREUR : '$1' introuvable dans le PATH" >&2; exit 1; }
|
|
}
|
|
|
|
require git
|
|
require argc
|
|
require jq
|
|
|
|
echo "=== Mise à jour de .claude (CrazyClaude) ==="
|
|
run git -C "$CLAUDE_DIR" pull --ff-only
|
|
|
|
echo ""
|
|
echo "=== Mise à jour de .claude/llm-functions ==="
|
|
run git -C "$LLM_DIR" pull --ff-only
|
|
|
|
echo ""
|
|
echo "=== Reconstruction des outils llm-functions ==="
|
|
if [[ "$dry_run" -eq 1 ]]; then
|
|
echo "[dry-run] argc build (dans $LLM_DIR)"
|
|
else
|
|
(cd "$LLM_DIR" && argc build)
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== Application des overrides locaux ==="
|
|
LOCAL_TOOLS_DIR="$CLAUDE_DIR/tools-local"
|
|
if [[ -d "$LOCAL_TOOLS_DIR" ]]; then
|
|
count=0
|
|
for src in "$LOCAL_TOOLS_DIR"/*; do
|
|
[[ -f "$src" ]] || continue
|
|
name="$(basename "$src")"
|
|
dest="$CLAUDE_DIR/llm-functions/bin/$name"
|
|
cp "$src" "$dest"
|
|
chmod +x "$dest"
|
|
count=$((count + 1))
|
|
done
|
|
echo " $count override(s) appliqué(s)"
|
|
else
|
|
echo " (aucun répertoire tools-local/)"
|
|
fi
|
|
|
|
echo ""
|
|
echo "OK — outils reconstruits dans $LLM_DIR/bin/" |