|
|
@@ -2,45 +2,42 @@
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
-`adapter.py` importiert aus `gateway.*` — das ist der Hermes Agent, nicht dieses
|
|
|
-Repo. Ohne dessen Quellcode auf dem `PYTHONPATH` bricht schon das Einsammeln der
|
|
|
-Tests mit `ModuleNotFoundError: No module named 'gateway'` ab. Also den Hermes
|
|
|
-Agent selbst herunterladen und bereitlegen, bevor du Tests ausführst:
|
|
|
+`adapter.py` imports from `gateway.*`, which lives in the Hermes Agent rather
|
|
|
+than this repo. Without its source on the `PYTHONPATH`, collection dies with
|
|
|
+`ModuleNotFoundError: No module named 'gateway'` before a single test runs. So
|
|
|
+fetch the Hermes Agent and keep it around before running the tests:
|
|
|
|
|
|
```bash
|
|
|
git clone https://github.com/NousResearch/hermes-agent.git /tmp/hermes
|
|
|
PYTHONPATH=/tmp/hermes uv run --with pyyaml pytest -q
|
|
|
```
|
|
|
|
|
|
-`pyyaml` wird von `gateway.config` gebraucht und steckt nicht in unseren
|
|
|
-Dev-Dependencies. Liegt der Checkout schon irgendwo, den Pfad einfach
|
|
|
-wiederverwenden statt neu zu klonen.
|
|
|
+`gateway.config` needs `pyyaml`, which is not among our dev dependencies. If a
|
|
|
+checkout already exists somewhere, point at that path instead of cloning again.
|
|
|
|
|
|
## Capabilities
|
|
|
|
|
|
-**Erweiterst du die Fähigkeiten des Adapters, pflege das Startup-Banner mit.**
|
|
|
-
|
|
|
-Beim Registrieren loggt `_capabilities()` (in `adapter.py`), was das Plugin kann
|
|
|
-— damit man beim Start sieht, was zur Verfügung steht, statt es aus dem Code
|
|
|
-lesen zu müssen. Ob eine Fähigkeit als vorhanden gilt, wird aus echten Overrides
|
|
|
-abgeleitet: sie zählt nur, wenn `ChattoAdapter` die Methode von
|
|
|
-`BasePlatformAdapter` ersetzt. Das Label dazu steht aber in `_CAPABILITY_LABELS`
|
|
|
-und wird *nicht* automatisch gefunden.
|
|
|
-
|
|
|
-Beim Hinzufügen einer überschriebenen `BasePlatformAdapter`-Methode also:
|
|
|
-
|
|
|
-1. Eintrag in `_CAPABILITY_LABELS` ergänzen (Methodenname → Bezeichnung, die für
|
|
|
- jemanden ohne Codekenntnis Sinn ergibt). Ohne diesen Schritt kann das Plugin
|
|
|
- die Sache zwar, sagt es aber nirgends.
|
|
|
-2. Prüfen, ob der `platform_hint` in `register()` sie erwähnen muss. Der Hint
|
|
|
- geht in den System-Prompt und ist das Einzige, woraus das Modell erfährt, was
|
|
|
- der Kanal kann — fehlt der Hinweis, behilft sich der Agent mit der Shell.
|
|
|
-3. Test in `TestRegistration` ergänzen, falls die Fähigkeit nutzerseitig sichtbar
|
|
|
- ist.
|
|
|
-
|
|
|
-Umgekehrt gilt dasselbe: fällt eine Methode weg, verschwindet ihre Zeile von
|
|
|
-selbst aus dem Log — der Eintrag in `_CAPABILITY_LABELS` sollte dann trotzdem
|
|
|
-mit raus.
|
|
|
+**When you extend what the adapter can do, keep the startup banner current.**
|
|
|
+
|
|
|
+`_capabilities()` in `adapter.py` logs what the plugin supports at registration,
|
|
|
+so starting it up tells you what is available instead of making you read the
|
|
|
+source. Whether a capability counts is derived from real overrides: it only
|
|
|
+counts when `ChattoAdapter` replaces the `BasePlatformAdapter` method. The label
|
|
|
+for it, however, lives in `_CAPABILITY_LABELS` and is *not* discovered
|
|
|
+automatically.
|
|
|
+
|
|
|
+So when you add an overridden `BasePlatformAdapter` method:
|
|
|
+
|
|
|
+1. Add an entry to `_CAPABILITY_LABELS` (method name → wording that means
|
|
|
+ something to someone who has not read the code). Skip this and the plugin can
|
|
|
+ do the thing but says so nowhere.
|
|
|
+2. Check whether the `platform_hint` in `register()` needs to mention it. That
|
|
|
+ hint goes into the system prompt and is the only way the model learns what the
|
|
|
+ channel can do — without it the agent falls back to shelling out.
|
|
|
+3. Add a test in `TestRegistration` if the capability is user-visible.
|
|
|
+
|
|
|
+The reverse holds too: drop a method and its line disappears from the log on its
|
|
|
+own, but its `_CAPABILITY_LABELS` entry should go with it.
|
|
|
|
|
|
## Shell Scripts
|
|
|
|