Files
aitbc/scripts/hybrid/aitbc_hermes_wrapper.sh
aitbc 852f2e5a8a
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled
Blockchain Synchronization Verification / sync-verification (push) Successful in 11s
Contract Performance Benchmarks / benchmark-gas-usage (push) Successful in 1m36s
Contract Performance Benchmarks / benchmark-execution-time (push) Successful in 1m24s
Contract Performance Benchmarks / benchmark-throughput (push) Successful in 1m25s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Successful in 2s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 5s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Successful in 3s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 3s
P2P Network Verification / p2p-verification (push) Successful in 2s
Smart Contract Tests / test-solidity (map[name:aitbc-contracts path:contracts]) (push) Failing after 1m28s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 21s
Smart Contract Tests / test-foundry (push) Failing after 20s
Smart Contract Tests / lint-solidity (push) Successful in 30s
Smart Contract Tests / deploy-contracts (push) Successful in 1m40s
Systemd Sync / sync-systemd (push) Successful in 26s
Contract Performance Benchmarks / compare-benchmarks (push) Successful in 4s
Rename openclaw to hermes across documentation and workflows
- Update workflow paths from docs/openclaw to docs/hermes
- Rename skill prefixes from openclaw-* to hermes-*
- Update agent skill references in refactoring and analysis docs
- Rename OPENCLAW_AITBC_MASTERY_PLAN.md to reflect hermes branding
- Update CLI examples and command references throughout documentation
2026-05-07 11:42:06 +02:00

120 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
# AITBC + Hermes Hybrid Script System
# Clean separation: Shell (execution) + Hermes (reasoning)
set -e
# Configuration
AITBC_CLI="/opt/aitbc/aitbc-cli"
HERMES_CMD="hermes agent --agent main"
LOG_DIR="/var/log/aitbc/hybrid"
mkdir -p "$LOG_DIR"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Logging function
log() {
local level="$1"
shift
local message="$@"
local timestamp=$(date -Iseconds)
echo -e "${timestamp} [${level}] ${message}" | tee -a "$LOG_DIR/hybrid.log"
}
# Execute AITBC CLI command
execute_aitbc() {
local cmd="$@"
log "INFO" "Executing AITBC: $cmd"
cd /opt/aitbc
local output
output=$(./aitbc-cli $cmd 2>&1)
local exit_code=$?
if [ $exit_code -eq 0 ]; then
log "SUCCESS" "AITBC command succeeded"
echo "$output"
return 0
else
log "ERROR" "AITBC command failed with exit code $exit_code"
echo "$output" >&2
return $exit_code
fi
}
# Analyze output with Hermes
analyze_with_hermes() {
local data="$@"
log "INFO" "Analyzing with Hermes..."
local analysis
analysis=$(echo "$data" | $HERMES_CMD --message "Analyze this AITBC output and provide insights: $data" 2>&1)
local exit_code=$?
if [ $exit_code -eq 0 ]; then
log "SUCCESS" "Hermes analysis completed"
echo "$analysis"
return 0
else
log "WARN" "Hermes analysis failed (non-critical)"
echo "$analysis" >&2
return 1
fi
}
# Hybrid execution with optional analysis
hybrid_execute() {
local cmd="$@"
local use_hermes="${USE_HERMES:-false}"
# Execute AITBC command
local aitbc_output
aitbc_output=$(execute_aitbc $cmd)
local aitbc_exit=$?
if [ $aitbc_exit -ne 0 ]; then
return $aitbc_exit
fi
# Optionally analyze with Hermes
if [ "$use_hermes" = "true" ]; then
echo -e "${BLUE}=== Hermes Analysis ===${NC}"
analyze_with_hermes "$aitbc_output"
fi
return 0
}
# Main CLI interface
main() {
local command="$1"
shift || true
case "$command" in
exec)
# Execute AITBC command only
execute_aitbc "$@"
;;
analyze)
# Analyze existing data with Hermes
local data="$@"
analyze_with_hermes "$data"
;;
hybrid)
# Execute AITBC and analyze with Hermes
USE_HERMES=true hybrid_execute "$@"
;;
*)
# Default: execute AITBC only
hybrid_execute "$command" "$@"
;;
esac
}
main "$@"