Add Hermes WebUI and Athena operator skill

This commit is contained in:
Mikei386 committed 2026-08-24 21:50:23 +02:00
1 parent 335c9a8501
commit 71775891b4
15 files changed
+446

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
FROM ghcr.io/nesquena/hermes-webui@sha256:48ba6ee4a837079955c00e997b751065cc0324ae6eaa0f2fec592c8f4b2a746e
COPY hermes_requirements.py /usr/local/bin/hermes_requirements.py
COPY patch_entrypoint.py /tmp/patch_entrypoint.py
RUN python3 /tmp/patch_entrypoint.py /hermeswebui_init.bash \
&& python3 /tmp/patch_entrypoint.py /apptoo/docker_init.bash \
&& rm /tmp/patch_entrypoint.py \
&& chmod 0555 /usr/local/bin/hermes_requirements.py
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
"""Export Hermes dependencies without attempting to build Hermes itself."""
from __future__ import annotations
import re
import sys
import tomllib
from pathlib import Path
def main() -> None:
document = tomllib.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
project = document["project"]
optional = project.get("optional-dependencies", {})
pending = list(project.get("dependencies", [])) + list(optional.get("all", []))
emitted: set[str] = set()
while pending:
requirement = pending.pop(0)
match = re.fullmatch(r"hermes-agent(?:\[([^]]+)\])?", requirement.strip())
if match:
extras = [item.strip() for item in (match.group(1) or "").split(",") if item.strip()]
for extra in extras:
if extra not in optional:
raise SystemExit(f"Unknown Hermes extra: {extra}")
pending[:0] = optional[extra]
continue
if requirement not in emitted:
print(requirement)
emitted.add(requirement)
if __name__ == "__main__":
main()
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Patch WebUI dependency bootstrap for modern non-wheel Hermes releases."""
from __future__ import annotations
import sys
from pathlib import Path
path = Path(sys.argv[1])
content = path.read_text(encoding="utf-8")
old = ''' uv pip install "$_stage_src[all]" --trusted-host pypi.org --trusted-host files.pythonhosted.org \\
|| error_exit "Failed to install hermes-agent's requirements"'''
new = ''' python3 /usr/local/bin/hermes_requirements.py "$_stage_src/pyproject.toml" \\
> /tmp/hermes-agent-requirements.txt \\
|| error_exit "Failed to export hermes-agent's requirements"
uv pip install -r /tmp/hermes-agent-requirements.txt \\
--trusted-host pypi.org --trusted-host files.pythonhosted.org \\
|| error_exit "Failed to install hermes-agent's requirements"'''
if content.count(old) != 1:
raise SystemExit(f"Expected dependency bootstrap exactly once in {path}")
path.write_text(content.replace(old, new), encoding="utf-8")