hermes-gpt 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0 - 2026-07-09
4
+
5
+ - Added env-gated Hermes tool wrappers: `hermes_vision_analyze` (HERMES_GPT_ENABLE_VISION), `hermes_web_search` / `hermes_web_extract` (HERMES_GPT_ENABLE_WEB).
6
+ - Added `hermes_cron_create` operator tool with full field support: schedule, prompt, script, skills, deliver, repeat, workdir, no_agent, model, context_from, enabled_toolsets.
7
+ - Fixed gateway status PID fallback on macOS — falls back to gateway_state.json when gateway.pid is missing or unparsable.
8
+ - Expanded gateway status diagnostics: exposes gateway_state, gateway_kind, gateway_pid_source, gateway_updated_at, gateway_exit_reason, gateway_active_agents.
9
+ - Fixed Vercel static site deployment configuration.
10
+ - Updated landing page with v0.3.0 and v0.4.0 feature summaries.
11
+ - Fixed flaky HTTP smoke test — now skips by default unless HERMES_HTTP_TEST=1 is set.
12
+ - Consolidated duplicate exception handling in `_is_pid_alive`.
13
+
14
+ ## 0.3.0 - 2026-06-25
15
+
16
+ - Added operator diagnostics and recovery tools: `hermes_operator_doctor`, `hermes_operator_snapshot`, `hermes_release_doctor`, and `hermes_operator_recover`.
17
+ - Introduced a structured error envelope (`success`, `ok`, `error`, `layer`, `code`, `safe_message`, `suggested_action`, `trace_id`) for all operator-facing failures.
18
+ - Converted operator exception handlers in `operator_config`, `operator_cron`, `operator_skills`, `operator_workspace`, and `server` to the new envelope while preserving legacy `success:false` and `error` fields.
19
+ - Added PASS/WARN/FAIL/UNSUPPORTED status vocabulary across diagnostic tools.
20
+ - Implemented conservative recovery with dry-run default and `apply=true` gating; connector re-registration is explicitly reported as unsupported.
21
+ - Added secret-value and absolute-path redaction in structured error messages.
22
+ - Added comprehensive tests for diagnostics, recovery, release readiness, and error-envelope safety.
23
+ - Updated operator-mode docs, README, release checklist, and release notes for v0.3.0.
24
+
25
+ ## 0.2.0 - 2026-06-21
26
+
27
+ - Added tiered Operator / Owner Mode tooling for trusted MCP clients.
28
+ - Kept the default posture read-only or dry-run, with direct mutation gated by explicit server and per-call opt-in.
29
+ - Added operator policy, status, audit, cron, config, env, gateway, workspace, and owner-scope tools.
30
+ - Fixed data-root normalization so operator profile operations resolve back to the Hermes data root.
31
+ - Updated packaging to include operator modules and release docs.
32
+ - Added a new Operator Mode guide, quickstart, and troubleshooting for new users.
33
+
34
+ ## 0.1.0 - 2026-06-18
35
+
36
+ - Initial local-dev release.
37
+ - Added FastMCP stdio and streamable HTTP server.
38
+ - Added Hermes file read/search, memory search, skill list/view, and optional gated write/patch/session/terminal capabilities.
39
+ - Added release safety gates for write tools, memory writes, session search, terminal execution, and remote no-auth mode.
40
+ - Added pytest coverage for default tool surface, auth metadata, safety gates, timeout capping, remote profile blocking, and HTTP initialize.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hermes-gpt contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ include README.md
2
+ include pyproject.toml
3
+ include CHANGELOG.md
4
+ recursive-include docs *.md
5
+ recursive-include examples *.ps1
6
+ prune logs
7
+ prune dist
8
+ prune build
9
+ prune tmp-operator-test
10
+ prune __pycache__
11
+ prune .pytest_cache
12
+ global-exclude *.py[cod] *.log *.err.log .env .env.* *.pem
@@ -0,0 +1,374 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-gpt
3
+ Version: 0.4.0
4
+ Summary: Local-dev MCP sidecar for exposing selected Hermes Agent capabilities.
5
+ Author: hermes-gpt contributors
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: mcp[cli]
11
+ Requires-Dist: uvicorn
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest; extra == "dev"
14
+ Dynamic: license-file
15
+
16
+ # hermes-gpt
17
+
18
+ ![Hermes GPT branding](assets/hermes-gpt-branding.jpg)
19
+
20
+ `hermes-gpt` is a standalone MCP sidecar for Hermes Agent. It imports selected local Hermes Agent internals at runtime and exposes them to MCP clients without modifying Hermes Agent source files.
21
+
22
+ This is a **local-dev release**. It is not a hosted service, not a fork of Hermes Agent, not a generic remote dev container, and not a replacement for DevSpace.
23
+
24
+ ## What’s New in v0.3.0
25
+
26
+ v0.3.0 is the Operator Reliability Release. It makes Hermes GPT self-diagnosing, safely recoverable, and release-checkable.
27
+
28
+ - New operator diagnostics tools:
29
+ - `hermes_operator_doctor` — read-only deep health check across operator, gateway, config, env, cron, skills, policy, audit, and connector surfaces.
30
+ - `hermes_operator_snapshot` — single current-state summary.
31
+ - `hermes_release_doctor` — release readiness checks with PASS / WARN / BLOCKED classification.
32
+ - `hermes_operator_recover` — conservative dry-run-first recovery sequence.
33
+ - All operator-facing failures now return a structured error envelope:
34
+ `{success, ok, error, layer, code, safe_message, suggested_action, trace_id}`.
35
+ - Diagnostic and recovery statuses use PASS / WARN / FAIL / UNSUPPORTED.
36
+ - Connector re-registration is explicitly reported as unsupported unless a real supported command/API exists.
37
+ - `hermes_operator_recover` is dry-run by default and requires `apply=true` for mutations.
38
+
39
+ ## What’s New in v0.2.0
40
+
41
+ v0.2.0 adds tiered Operator / Owner Mode so trusted MCP clients can see the full Hermes GPT surface while the default posture stays safe.
42
+
43
+ - Default mode remains read-only.
44
+ - Recommended always-on connector/tunnel mode is `dry_run`.
45
+ - Direct mutation requires both:
46
+ - `HERMES_GPT_OPERATOR_APPLY_MODE=direct`
47
+ - the mutating tool call sets `dry_run=false`
48
+ - Owner Mode requires the exact break-glass acknowledgement:
49
+ - `HERMES_GPT_OWNER_ACK=I_UNDERSTAND_THIS_CAN_MUTATE_MY_MACHINE`
50
+ - Operator Mode is not a sandbox.
51
+ - Do not expose publicly without real auth, VPN, Tailscale, or an equivalent private boundary.
52
+
53
+ What v0.2.0 adds:
54
+
55
+ - operator policy, status, and audit tools
56
+ - cron tools
57
+ - skill tools
58
+ - config and env tools
59
+ - gateway tools
60
+ - workspace tools
61
+ - owner tools behind explicit acknowledgement
62
+ - audit logging with hashes and lengths instead of raw prompt/content
63
+ - Hermes data-root normalization for operator profile operations
64
+ - packaging fixes so operator modules ship in the release
65
+
66
+ | Mode | Env posture | What happens |
67
+ | --- | --- | --- |
68
+ | Read-only | no operator env vars | read/list/status tools only; mutations refuse |
69
+ | Dry-run Operator | operator enabled + apply_mode=dry_run | mutation tools return plans/previews only |
70
+ | Direct Operator | operator enabled + apply_mode=direct | writes allowed only when tool call also sets `dry_run=false` |
71
+ | Owner Mode | level=owner + exact owner ack | break-glass local owner tools; still denies secret paths |
72
+
73
+ For the full Operator Mode guide, new-user quickstart, and tunnel safety model, see `docs/operator-mode.md`.
74
+
75
+ ## Security posture
76
+
77
+ By default, `hermes-gpt` is designed for a trusted local machine:
78
+
79
+ - HTTP binds to `127.0.0.1` by default.
80
+ - Tools advertise `noauth` only for local-dev MCP clients.
81
+ - Write, patch, terminal execution, memory writes, and session search are disabled or hidden by default.
82
+ - Remote/public release is not supported until real OAuth or another ChatGPT-compatible authentication layer is added.
83
+
84
+ Do not expose this server publicly without authentication. A temporary tunnel is acceptable only for short local testing when you understand that any enabled tool is reachable through that URL.
85
+
86
+ ## Prerequisites
87
+
88
+ - Python 3.10+
89
+ - A local Hermes Agent install
90
+ - MCP Python SDK and Uvicorn
91
+
92
+ Install dependencies:
93
+
94
+ ```bash
95
+ cd ~/hermes-gpt
96
+ python -m pip install -r requirements.txt
97
+ ```
98
+
99
+ ## Local MCP clients
100
+
101
+ Stdio mode is for local MCP clients that support subprocess MCP servers:
102
+
103
+ ```bash
104
+ cd ~/hermes-gpt
105
+ python server.py
106
+ ```
107
+
108
+ Example client command:
109
+
110
+ ```json
111
+ {
112
+ "command": "python",
113
+ "args": ["C:\\Users\\<YOU>\\hermes-gpt\\server.py"]
114
+ }
115
+ ```
116
+
117
+ ## Local HTTP
118
+
119
+ HTTP mode uses FastMCP streamable HTTP:
120
+
121
+ ```bash
122
+ cd ~/hermes-gpt
123
+ python server.py --http --host 127.0.0.1 --port 7677
124
+ ```
125
+
126
+ Local endpoint:
127
+
128
+ ```text
129
+ http://127.0.0.1:7677/mcp
130
+ ```
131
+
132
+ If you bind to anything other than loopback in the default `local-dev` profile, the server prints a warning. This warning means the configuration is not release-safe.
133
+
134
+ ## ChatGPT local testing
135
+
136
+ ChatGPT developer mode expects a remote MCP endpoint. Do not enter a localhost URL such as `http://127.0.0.1:4750`; ChatGPT fetches the MCP configuration through its connector path, where `127.0.0.1` is not your machine.
137
+
138
+ For short local testing only:
139
+
140
+ ```powershell
141
+ cd C:\Users\<YOU>\hermes-gpt
142
+ python server.py --http --host 127.0.0.1 --port 4750
143
+ ```
144
+
145
+ In another terminal:
146
+
147
+ ```powershell
148
+ & "C:\Program Files (x86)\cloudflared\cloudflared.exe" tunnel --url http://127.0.0.1:4750 --http-host-header 127.0.0.1:4750
149
+ ```
150
+
151
+ In ChatGPT, configure:
152
+
153
+ - Protocol: Streaming HTTP
154
+ - MCP server URL: `https://<your-trycloudflare-host>/mcp`
155
+ - Authentication: No Authentication
156
+
157
+ If ChatGPT only shows the old 5-tool surface, reconnect or recreate the connector and follow the workflow in `docs/operator-mode.md`.
158
+
159
+ Example scripts for local setup live under `examples/`.
160
+
161
+ ## Tool gates
162
+
163
+ Default visible tools:
164
+
165
+ - `hermes_read_file(path, offset=1, limit=500)`
166
+ - `hermes_search_files(pattern, target="content", path=".", file_glob=None, limit=50)`
167
+ - `hermes_memory(action="search", target="memory", content=None, old_text=None)`
168
+ - `hermes_skill_list()`
169
+ - `hermes_skill_view(name)`
170
+
171
+ Opt-in tools and actions:
172
+
173
+ | Capability | Env var | Default |
174
+ | --- | --- | --- |
175
+ | Write file and patch tools | `HERMES_GPT_ENABLE_WRITE=1` | Hidden |
176
+ | Memory `add`, `replace`, `remove` | `HERMES_GPT_ENABLE_MEMORY_WRITE=1` | Disabled |
177
+ | Session search | `HERMES_GPT_ENABLE_SESSION_SEARCH=1` | Hidden |
178
+ | Terminal command execution | `HERMES_GPT_ENABLE_TERMINAL=1` | Hidden |
179
+
180
+ Terminal timeout is capped at 120 seconds even when enabled.
181
+
182
+ The broad `HERMES_GPT_ENABLE_*` flags still work for backward compatibility,
183
+ but for tiered, safe operation prefer the **Operator / Owner Mode** tools
184
+ documented below.
185
+
186
+ ## Hermes GPT Operator Mode
187
+
188
+ Operator / Owner Mode is a tiered control plane that lets trusted MCP
189
+ clients (like ChatGPT) operate Hermes safely: cron jobs, skills, profile
190
+ config wiring, safe non-secret env keys, gateway/runtime status and restart,
191
+ scoped workspace edits, and (with explicit acknowledgement) owner-level
192
+ command and file access.
193
+
194
+ ### Safety model
195
+
196
+ - **Default behavior is read-only.** Mutating operator tools refuse unless
197
+ operator mode is explicitly enabled.
198
+ - **Dry-run is the default.** Even when operator mode is enabled, every
199
+ mutating tool defaults to `dry_run=True` and returns a plan instead of
200
+ mutating. To actually mutate, you must set
201
+ `HERMES_GPT_OPERATOR_APPLY_MODE=direct` AND pass `dry_run=False` to the
202
+ tool call.
203
+ - **Direct mutation requires explicit opt-in.** `HERMES_GPT_OPERATOR_APPLY_MODE=direct`
204
+ is required for any write to happen.
205
+ - **Owner Mode requires an additional explicit acknowledgement.** Setting
206
+ `HERMES_GPT_OPERATOR_LEVEL=owner` alone is not enough; you must also set
207
+ `HERMES_GPT_OWNER_ACK=I_UNDERSTAND_THIS_CAN_MUTATE_MY_MACHINE`. Without
208
+ the exact ack string, owner tools refuse.
209
+ - **No secrets exposed.** Config `get` redacts secret-looking keys; `env`
210
+ tools never return values; skill/cron prompts are logged and surfaced
211
+ only as `prompt_len` + `prompt_sha256`.
212
+ - **No `.env` raw read/write.** The denied-path policy refuses `.env`,
213
+ `auth.json`, `mcp-tokens/`, `.ssh/`, `.aws/`, `vault/`, and any
214
+ secret-looking filename.
215
+ - **No `shell=True` anywhere.** Every subprocess invocation uses
216
+ `shell=False` with a fixed argv.
217
+ - **No `git add -A`, no `git push`, no destructive filesystem operations.**
218
+ Workspace `run_test` only allows a conservative allowlist (pytest, ruff,
219
+ mypy, npm test/lint, git status/diff). Owner `run_command` blocks
220
+ catastrophic patterns (`rm -rf /`, `del /s`, `format`, `curl | bash`,
221
+ `git push --force`, `git add -A`, `git add .`, anything touching
222
+ `.env`/`vault`/`token`/`.ssh`).
223
+ - **Operator Mode is not a sandbox.** Use OS-level isolation (container,
224
+ VM, or a tool like OpenShell) for untrusted input. The operator gates
225
+ are defense-in-depth, not a security boundary — same stance as Hermes
226
+ Agent's own SECURITY.md.
227
+ - **Do not expose remote without real auth.** Operator Mode does not add
228
+ any authentication. Bind to loopback only, or put a real auth layer
229
+ (VPN, Tailscale, OAuth) in front before exposing on a network.
230
+
231
+ ### Operator levels
232
+
233
+ Levels are ordered; each level includes all capabilities of the levels
234
+ above it in this list.
235
+
236
+ | Level | Capabilities |
237
+ | --- | --- |
238
+ | `read_only` | status, policy, audit tail, cron list/status, skill diff/list/view, config get, env status, gateway status, git status/diff |
239
+ | `cron` | + cron run, cron pause, cron copy, cron move |
240
+ | `skills` | + skill create, edit, patch, write_file, copy, sync_to_default, delete |
241
+ | `skills_config` | + config set/patch, env set/copy (non-secret keys only) |
242
+ | `workspace` | + scoped workspace patch/write, test/lint allowlist, gateway restart |
243
+ | `owner` | + raw command, raw file patch/write — still gated by explicit owner ack and still denies secret paths |
244
+
245
+ ### Env flags
246
+
247
+ | Env var | Default | Purpose |
248
+ | --- | --- | --- |
249
+ | `HERMES_GPT_OPERATOR_ENABLED` | unset (false) | Enable operator mode |
250
+ | `HERMES_GPT_OPERATOR_LEVEL` | `read_only` | Operator level (see table above) |
251
+ | `HERMES_GPT_OPERATOR_APPLY_MODE` | `dry_run` | `dry_run` returns plans; `direct` allows mutation |
252
+ | `HERMES_GPT_OPERATOR_ALLOWED_PROFILES` | `default` | Comma-separated profile names, or `*` for all existing |
253
+ | `HERMES_GPT_OPERATOR_ALLOWED_PATHS` | empty | Comma-separated workspace root paths; empty disables workspace writes |
254
+ | `HERMES_GPT_OPERATOR_DENIED_PATHS` | built-in defaults | Extra denied paths (additions only; cannot weaken defaults) |
255
+ | `HERMES_GPT_OWNER_ACK` | unset | Must equal `I_UNDERSTAND_THIS_CAN_MUTATE_MY_MACHINE` for owner tools |
256
+
257
+ ### Examples
258
+
259
+ Read-only default (no env vars needed):
260
+
261
+ ```powershell
262
+ hermes-gpt
263
+ ```
264
+
265
+ Cron dry-run:
266
+
267
+ ```powershell
268
+ $env:HERMES_GPT_OPERATOR_ENABLED="1"
269
+ $env:HERMES_GPT_OPERATOR_LEVEL="cron"
270
+ $env:HERMES_GPT_OPERATOR_APPLY_MODE="dry_run"
271
+ $env:HERMES_GPT_OPERATOR_ALLOWED_PROFILES="default,hermes-researcher"
272
+ hermes-gpt
273
+ ```
274
+
275
+ Skills/config dry-run:
276
+
277
+ ```powershell
278
+ $env:HERMES_GPT_OPERATOR_ENABLED="1"
279
+ $env:HERMES_GPT_OPERATOR_LEVEL="skills_config"
280
+ $env:HERMES_GPT_OPERATOR_APPLY_MODE="dry_run"
281
+ $env:HERMES_GPT_OPERATOR_ALLOWED_PROFILES="default,hermes-researcher,hermes-trt-manager,hermes-nexus-wiki"
282
+ hermes-gpt
283
+ ```
284
+
285
+ Workspace direct with allowed path:
286
+
287
+ ```powershell
288
+ $env:HERMES_GPT_OPERATOR_ENABLED="1"
289
+ $env:HERMES_GPT_OPERATOR_LEVEL="workspace"
290
+ $env:HERMES_GPT_OPERATOR_APPLY_MODE="direct"
291
+ $env:HERMES_GPT_OPERATOR_ALLOWED_PATHS="C:\Users\<YOU>\hermes-gpt,C:\Users\<YOU>\AppData\Local\hermes\hermes-agent"
292
+ hermes-gpt
293
+ ```
294
+
295
+ Owner Mode (WARNING: can mutate your machine):
296
+
297
+ ```powershell
298
+ $env:HERMES_GPT_OPERATOR_ENABLED="1"
299
+ $env:HERMES_GPT_OPERATOR_LEVEL="owner"
300
+ $env:HERMES_GPT_OPERATOR_APPLY_MODE="direct"
301
+ $env:HERMES_GPT_OWNER_ACK="I_UNDERSTAND_THIS_CAN_MUTATE_MY_MACHINE"
302
+ hermes-gpt
303
+ ```
304
+
305
+ ### Audit log
306
+
307
+ Every mutating tool call appends a JSONL record to:
308
+
309
+ - `%USERPROFILE%\AppData\Local\hermes\logs\hermes_gpt_operator_audit.jsonl` (preferred), or
310
+ - `<hermes-gpt>\logs\hermes_gpt_operator_audit.jsonl` (fallback)
311
+
312
+ Each record contains: `timestamp`, `tool`, `level`, `apply_mode`, `dry_run`,
313
+ `success`, `changed`, `summary`, `error`, profile(s), path summary, job_id /
314
+ skill_name / key (when relevant), and `prompt_len` + `prompt_sha256` /
315
+ `content_len` + `content_sha256` for skill/cron content. The audit log
316
+ **never** records full prompts, full config values, raw `.env` contents,
317
+ vault contents, or command output likely to contain secrets. Read it with
318
+ the `hermes_operator_audit_tail` tool.
319
+
320
+ ### Owner Mode warning
321
+
322
+ Owner Mode can mutate your machine. Use it only on a trusted local
323
+ machine. It is **not a sandbox** — it is the explicit break-glass path
324
+ for the local owner. Even in Owner Mode, secret paths (`.env`, `auth.json`,
325
+ `.ssh/`, `mcp-tokens/`, etc.) remain denied; no secret override is
326
+ shipped in this release.
327
+
328
+ ## Remote profile
329
+
330
+ `--profile remote` is intentionally blocked because authentication is not implemented:
331
+
332
+ ```bash
333
+ python server.py --http --profile remote
334
+ ```
335
+
336
+ For temporary experiments only, you can bypass this block with both:
337
+
338
+ ```bash
339
+ HERMES_GPT_UNSAFE_REMOTE_NOAUTH=1
340
+ python server.py --http --profile remote --i-understand-this-is-unsafe
341
+ ```
342
+
343
+ Do not use this bypass for release.
344
+
345
+ ## Release checklist
346
+
347
+ Before publishing:
348
+
349
+ - No `*.pem` files.
350
+ - No `*.log` or `*.err.log` files.
351
+ - No `__pycache__/` or `*.pyc`.
352
+ - `python -m py_compile server.py` passes.
353
+ - `pytest` passes.
354
+ - Server binds to loopback by default.
355
+ - Terminal, write tools, memory writes, and session search are disabled by default.
356
+
357
+ ## Current capability notes
358
+
359
+ The feasibility probe passed in this environment:
360
+
361
+ - Hermes source root: `C:\Users\<YOU>\AppData\Local\hermes\hermes-agent`
362
+ - File tools: available
363
+ - Terminal tool: available, gated by `HERMES_GPT_ENABLE_TERMINAL=1`
364
+ - Memory tool: available
365
+ - Skill discovery: available through local and bundled skill directories
366
+ - Session search: available through `SessionDB.search_messages`
367
+ - FastMCP stdio: available
368
+ - FastMCP streamable HTTP: available
369
+
370
+ See `FEASIBILITY.md` for probe details and exact signatures.
371
+
372
+ ## License
373
+
374
+ MIT. See `LICENSE`.