feat: Archivar delivery + install.sh v2.2 — full function set

- Add archivar/ submodule to plugin/ (5 files, relative imports)
- Update adapter.py with relative Archivar import from .archivar.adapter_integration
- install.sh: fix --non-interactive env-var reading (Z.316-318, Bug #7)
- install.sh: recursive file copy (was 4 flat files, now entire plugin/ tree incl. submodules)
- install.sh: Ollama presence check + nomic-embed-text pull
- install.sh: write OLLAMA_BASE_URL to rocketchat.env
- install.sh: add new message keys (collama_check, nomic_pull, nomic_ok, nomic_fail, copied)

Closes: Archivar delivery gap (2026-06-03)
Reviewed-by: Bernd (Advisor)
This commit is contained in:
Hermes Agent
2026-06-03 10:12:15 +02:00
parent e6eddcd3da
commit 88b7149dd1
7 changed files with 1742 additions and 765 deletions
+58 -7
View File
@@ -42,6 +42,13 @@ load_lang() {
[copying]="📁 Copying plugin files…"
[env_written]="🔑 Credentials written to %s"
[config_updated]="⚙️ config.yaml updated"
[copied]="📁 Copied %d plugin files"
[ollama_check]="🔍 Checking Ollama..."
[ollama_missing]="⚠️ Ollama not found. Install: curl -fsSL https://ollama.com/install.sh | sh"
[nomic_pull]="📥 Pulling nomic-embed-text (274 MB)..."
[nomic_ok]="✅ nomic-embed-text ready"
[nomic_fail]="⚠️ nomic-embed-text pull failed — Archivar will use fallback mode"
[ollama_ok]="✅ Ollama ready"
[service_installed]="⚡ Gateway service installed"
[restarting]="🔄 Restarting gateway…"
[done]="✅ Rocket.Chat Plugin installed successfully!\n After the gateway restarts, check for a pairing code\n in the gateway logs and enter it in your home channel."
@@ -78,6 +85,13 @@ load_lang() {
[copying]="📁 Kopiere Plugin-Dateien…"
[env_written]="🔑 Zugangsdaten gespeichert in %s"
[config_updated]="⚙️ config.yaml aktualisiert"
[copied]="📁 %d Plugin-Dateien kopiert"
[ollama_check]="🔍 Prüfe Ollama..."
[ollama_missing]="⚠️ Ollama nicht gefunden. Installation: curl -fsSL https://ollama.com/install.sh | sh"
[nomic_pull]="📥 Lade nomic-embed-text herunter (274 MB)..."
[nomic_ok]="✅ nomic-embed-text bereit"
[nomic_fail]="⚠️ nomic-embed-text Download fehlgeschlagen — Archivar nutzt Fallback-Modus"
[ollama_ok]="✅ Ollama bereit"
[service_installed]="⚡ Gateway-Service installiert"
[restarting]="🔄 Starte Gateway neu…"
[done]="✅ Rocket.Chat Plugin erfolgreich installiert!\n Nach dem Gateway-Neustart bitte den Pairing-Code\n aus den Gateway-Logs im Home-Channel eingeben."
@@ -314,8 +328,11 @@ fi
# ─── Non-interactive mode ─────────────────────────────────
if $NONINTERACTIVE; then
RC_URL="${RC_URL:-}" RC_BOT_USER="${RC_BOT_USER:-}"
RC_BOT_PASS="${RC_BOT_PASS:-}" RC_HOME_CHANNEL="${RC_HOME_CHANNEL:-}"
# Read from environment variables (NOT local — respect what install.sh caller exports)
RC_URL="${RC_URL:-${ROCKETCHAT_BASE_URL:-}}"
RC_BOT_USER="${RC_BOT_USER:-${ROCKETCHAT_USER:-}}"
RC_BOT_PASS="${RC_BOT_PASS:-${ROCKETCHAT_PASSWORD:-}}"
RC_HOME_CHANNEL="${RC_HOME_CHANNEL:-${ROCKETCHAT_ROOM_NAME:-}}"
if [ -z "$RC_URL" ] || [ -z "$RC_BOT_USER" ] || [ -z "$RC_BOT_PASS" ] || [ -z "$RC_HOME_CHANNEL" ]; then
msg env_required; exit 1
fi
@@ -357,16 +374,50 @@ EOF
chmod 600 "$ENV_FILE"
msg env_written "$ENV_FILE"
# ─── Ollama Check ─────────────────────────────────────────
OLLAMA_BASE_URL="${OLLAMA_BASE_URL:-http://localhost:11434}"
msg ollama_check
if command -v ollama >/dev/null 2>&1; then
msg ollama_ok
# nomic-embed-text laden falls nicht vorhanden
if ! ollama list 2>/dev/null | grep -q nomic-embed-text; then
msg nomic_pull
if ollama pull nomic-embed-text 2>/dev/null; then
msg nomic_ok
else
msg nomic_fail
fi
else
msg nomic_ok
fi
else
msg ollama_missing
fi
# OLLAMA_BASE_URL in rocketchat.env ergänzen
if ! grep -q 'OLLAMA_BASE_URL' "$ENV_FILE" 2>/dev/null; then
echo "export OLLAMA_BASE_URL=\"${OLLAMA_BASE_URL}\"" >> "$ENV_FILE"
fi
# ─── Copy plugin files ────────────────────────────────────
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PLUGIN_DST="$HERMES_DIR/plugins/platforms/rocketchat"
mkdir -p "$PLUGIN_DST"
for f in plugin.yaml __init__.py adapter.py tools.py; do
if [ -f "$SCRIPT_DIR/plugin/$f" ]; then
cp "$SCRIPT_DIR/plugin/$f" "$PLUGIN_DST/$f"
fi
done
# Rekursiv kopieren (inkl. Submodule wie archivar/), __pycache__ ausschließen
if [ -d "$SCRIPT_DIR/plugin" ]; then
# Lösche vorherige Dateien NICHT — das könnte andere Submodule zerstören
# Kopiere ALLE Dateien aus plugin/ rekursiv (behält Struktur)
find "$SCRIPT_DIR/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' \
| while read -r src; do
rel="${src#$SCRIPT_DIR/plugin/}"
dst="$PLUGIN_DST/$rel"
mkdir -p "$(dirname "$dst")"
cp "$src" "$dst"
done
copied_count=$(find "$SCRIPT_DIR/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' | wc -l)
msg copied "$copied_count"
fi
# ─── Patch config.yaml ────────────────────────────────────
CONFIG="$HOME/.hermes/config.yaml"