Bladeren bron

Add agent guidelines and align docs and dev dependencies

AGENTS.md codifies the shellcheck rule with .shellcheckrc severity,
DOCS.md gets a pointer fix, after-install.md tracks the new setup flow,
and pyproject pins pytest 9 plus connectrpc for out-of-tree testing;
the plugins entry point stays commented out until packaging settles.
Paul Klumpp 1 week geleden
bovenliggende
commit
b902b9fb5b
4 gewijzigde bestanden met toevoegingen van 59 en 17 verwijderingen
  1. 39 0
      AGENTS.md
  2. 1 1
      DOCS.md
  3. 14 12
      after-install.md
  4. 5 4
      pyproject.toml

+ 39 - 0
AGENTS.md

@@ -0,0 +1,39 @@
+# Agent Guidelines for hermes-chatto-plugin
+
+## Shell Scripts
+
+**Always run `shellcheck` after editing any shell scripts.**
+
+```bash
+shellcheck path/to/script.sh
+```
+
+Or validate all shell scripts in the project:
+
+```bash
+find . -name "*.sh" -exec shellcheck {} \;
+```
+
+### Configuration
+
+Project-specific shellcheck rules are defined in `.shellcheckrc`. Default severity is `error` to catch all issues.
+
+### Why
+
+- Prevents syntax errors and common pitfalls (e.g., missing quotes, unsafe variable expansions)
+- Ensures portability across different shell environments
+- Maintains code quality and security standards
+
+### Integration
+
+Consider adding a pre-commit hook for automatic validation:
+
+```yaml
+# .pre-commit-config.yaml
+repos:
+  - repo: https://github.com/koalaman/shellcheck-precommit
+    rev: v0.9.0
+    hooks:
+      - id: shellcheck
+        args: [--severity=error]
+```

+ 1 - 1
DOCS.md

@@ -159,7 +159,7 @@ Environment variables override `config.yaml` values. Secrets (`CHATTO_PASSWORD`)
 
 | Variable | Required | Default | Description |
 |----------|----------|---------|-------------|
-| `CHATTO_URL` | Yes | — | Base URL of the Chatto server (e.g., `https://chat.example.com`) |
+| `CHATTO_BASE_URL` | Yes | — | Base URL of the Chatto server (e.g., `https://chat.example.com`) |
 | `CHATTO_LOGIN` | Yes | — | Chatto username (login) |
 | `CHATTO_PASSWORD` | Yes | — | Chatto password |
 | `CHATTO_CHANNELS` | No | All joined rooms | Comma-separated room IDs to watch |

+ 14 - 12
after-install.md

@@ -1,29 +1,31 @@
 ## Chatto Plugin Installed ✅
 
-Next steps:
+Next steps. Edit your `~/.hermes/.env` OR `~/.hermes/config.yaml` 
 
-1. **Add credentials** to `~/.hermes/.env`:
+Environment Variables will take precedence over config.yaml entries.
+
+1. Required connection details
    ```
-   CHATTO_URL=https://chat.example.com
    CHATTO_LOGIN=your-username
    CHATTO_PASSWORD=your-password
    ```
-
-2. **Find your home channel ID** — in Chatto, right-click a room → Copy ID, or use the API:
-   ```bash
-   curl -s -X POST https://chat.example.com/auth/login \
-     -H "Content-Type: application/json" \
-     -d '{"login":"your-username","password":"your-password"}'
+   To connect to your server, set `CHATTO_BASE_URL`. Default, when not set,
+   is ChattoHQ (`https://chat.chatto.run`)
    ```
+   CHATTO_BASE_URL=https://chat.example.com
+   ```
+
+2. Home Channel
 
-3. **Set the home channel** (optional, defaults to first room):
+   Set your Home Channel using the Channel ID** (optional, defaults to first room):
    ```bash
    CHATTO_HOME_CHANNEL=ROOM_ID_HERE
    ```
 
-4. **Restart the gateway**:
+3. Restart the Hermes Gateway
    ```bash
    hermes gateway restart
    ```
 
-5. **Test** — send a message in a Chatto room mentioning your bot's username.
+4. Test
+   send a message in a Chatto room mentioning your bot's username.

+ 5 - 4
pyproject.toml

@@ -13,14 +13,15 @@ authors = [
     {name = "liv", email = "paul@klumpp.de"},
 ]
 
-[project.entry-points."hermes_agent.plugins"]
-hermes-chatto-plugin = "hermes-chatto-plugin"
+#[project.entry-points."hermes_agent.plugins"]
+#hermes-chatto-plugin = "hermes-chatto-plugin"
 
 [dependency-groups]
 dev = [
-    "pytest>=8.0",
+    "pytest>=9.0",
     "pytest-asyncio>=0.24",
-    "chattolib[realtime]>=0.4.19"
+    "chattolib[realtime]>=0.4.19",
+    "connectrpc>=0.11.1",
 ]
 
 [tool.setuptools.packages.find]