From 1516e8835776f51216497e046ed883a400a6e545 Mon Sep 17 00:00:00 2001 From: gortium Date: Wed, 17 Jun 2026 12:11:28 -0400 Subject: [PATCH] feat: convert to pip package - Restructure repo into hermes_identity_plugin/ Python package - Add pyproject.toml with setuptools build config - Register identity entry point under hermes_agent.plugins - Include plugin.yaml, .json, .yaml as package data - Update README with pip install instructions and project layout --- README.md | 30 +++++++++++++++++-- .../__init__.py | 0 .../plugin.yaml | 0 pyproject.toml | 21 +++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) rename __init__.py => hermes_identity_plugin/__init__.py (100%) rename plugin.yaml => hermes_identity_plugin/plugin.yaml (100%) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index 03898dc..af1987d 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,29 @@ initialization — no files are changed on disk. 4. **Missing config or env** → returns None → Honcho behaves exactly as before (creates `user-default-*` peers — safe fallback). -## Installation +## Project layout + +``` +hermes-identity-plugin/ +├── pyproject.toml # pip package config +├── README.md +├── hermes_identity_plugin/ # Python package +│ ├── __init__.py # register() entry point +│ └── plugin.yaml # Hermes plugin metadata +├── config.sample.json +└── docs/ + ├── enforcement.md + └── how-it-works.md +``` + +### Option 1: pip package (recommended) ```bash -# 1. Install the plugin from Gitea -hermes plugins install ssh://git@code.lazyworkhorse.net:2222/Hermes/hermes-identity-plugin.git +# Install from Gitea (requires GITEA_PAT in environment) +pip install git+https://gortium:${GITEA_PAT}@code.lazyworkhorse.net/gortium/hermes-identity-plugin.git + +# Or install from local checkout +pip install /path/to/hermes-identity-plugin # 2. Create the config file (persistent volume) cp config.sample.json /opt/data/identity-config.json @@ -59,6 +77,12 @@ cp config.sample.json /opt/data/identity-config.json # 4. Restart gateways to pick up the plugin ``` +### Option 2: Legacy plugin install + +```bash +hermes plugins install ssh://git@code.lazyworkhorse.net:2222/gortium/hermes-identity-plugin.git +``` + ## Config file: `/opt/data/identity-config.json` ```json diff --git a/__init__.py b/hermes_identity_plugin/__init__.py similarity index 100% rename from __init__.py rename to hermes_identity_plugin/__init__.py diff --git a/plugin.yaml b/hermes_identity_plugin/plugin.yaml similarity index 100% rename from plugin.yaml rename to hermes_identity_plugin/plugin.yaml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7e0b081 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "hermes-identity-plugin" +version = "1.0.0" +description = "Identity mapping plugin for Hermes Agent" +authors = [{name = "@gortium"}] +license = {text = "MIT"} +requires-python = ">=3.11" +dependencies = [] + +[project.entry-points.'hermes_agent.plugins'] +identity = "hermes_identity_plugin:register" + +[tool.setuptools.packages.find] +include = ["hermes_identity_plugin*", "docs*"] + +[tool.setuptools.package-data] +"*" = ["*.json", "*.yaml"]