mirror of
https://github.com/gnekt/My-Brain-Is-Full-Crew.git
synced 2026-09-13 09:16:46 +00:00
Implement agentic-platform adapter for Claude Code.
build(adapters): claude-code adapter skeleton with capability/event tables build(claude-code): adapter_translate_dispatcher with test build(claude-code): adapter_translate_references with test build(claude-code): adapter_translate_skills with tests build(claude-code): adapter_translate_agents with capability→tools mapping build(claude-code): hook wrapper template (CC native → neutral schema) build(claude-code): adapter_translate_hooks with wrapper generation build(claude-code): adapter_translate_mcp with hand-rolled YAML parser build(claude-code): adapter_finalize and complete adapter_build wiring build: scripts/build.sh dispatches to per-framework adapter Also fix adapter_translate_hooks and adapter_translate_agents to use while-read loops (avoiding word-splitting on paths with spaces) and guard grep calls with || true to survive set -eo pipefail when hooks have no match-tool field. Remove scripts/build.sh from .gitignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
43
scripts/build.sh
Executable file
43
scripts/build.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# =============================================================================
|
||||
# scripts/build.sh — Run the framework adapter to populate dist/<framework>/
|
||||
# =============================================================================
|
||||
# Usage: bash scripts/build.sh --framework <name>
|
||||
# Discovers available frameworks by listing adapters/ subdirectories.
|
||||
# =============================================================================
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
# shellcheck source=scripts/lib.sh
|
||||
source "$SCRIPT_DIR/lib.sh"
|
||||
|
||||
# ── Parse args ─────────────────────────────────────────────────────────────
|
||||
FRAMEWORK="claude-code"
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--framework) FRAMEWORK="$2"; shift 2 ;;
|
||||
*) die "Unknown argument: $1" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# ── Validate framework ─────────────────────────────────────────────────────
|
||||
if [[ ! -d "$REPO_ROOT/adapters/$FRAMEWORK" ]]; then
|
||||
AVAILABLE="$(ls "$REPO_ROOT/adapters/" 2>/dev/null | grep -v '^lib.sh$' | tr '\n' ' ')"
|
||||
die "Unknown framework: $FRAMEWORK. Available: $AVAILABLE"
|
||||
fi
|
||||
|
||||
# ── Check dependencies ─────────────────────────────────────────────────────
|
||||
command -v jq >/dev/null 2>&1 || die "jq is required for the build (install via brew, apt, etc.)"
|
||||
|
||||
# ── Source adapters ────────────────────────────────────────────────────────
|
||||
# shellcheck source=adapters/lib.sh
|
||||
source "$REPO_ROOT/adapters/lib.sh"
|
||||
# shellcheck source=/dev/null
|
||||
source "$REPO_ROOT/adapters/$FRAMEWORK/adapter.sh"
|
||||
|
||||
# ── Run the build ──────────────────────────────────────────────────────────
|
||||
DIST_DIR="$REPO_ROOT/dist/$FRAMEWORK"
|
||||
info "Building $FRAMEWORK → $DIST_DIR"
|
||||
adapter_build "$REPO_ROOT" "$DIST_DIR"
|
||||
success "Build complete"
|
||||
Reference in New Issue
Block a user