hermes-loop-plugin 1.0.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hermes Agent Community
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,471 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-loop-plugin
3
+ Version: 1.0.0
4
+ Summary: Continuous task execution loop plugin for Hermes Agent
5
+ Author-email: Hermes Agent Community <community@hermes-agent.dev>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/NousResearch/hermes-loop-plugin
8
+ Project-URL: Documentation, https://github.com/NousResearch/hermes-loop-plugin#readme
9
+ Project-URL: Repository, https://github.com/NousResearch/hermes-loop-plugin.git
10
+ Project-URL: Issues, https://github.com/NousResearch/hermes-loop-plugin/issues
11
+ Keywords: hermes-agent,plugin,loop,iteration,automation
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ # Hermes Loop Plugin
26
+
27
+ Continuous task execution loop that keeps the agent running until goals are completed via state file monitoring and optional completion promises.
28
+
29
+ ## Overview
30
+
31
+ This plugin enables **persistent multi-step workflows** where tasks span multiple sessions or require iterative refinement. It works similarly to Claude Code's ralph-wiggum-loop but is designed specifically for Hermes Agent's plugin architecture.
32
+
33
+ ## Features
34
+
35
+ - **State Persistence**: Tracks task progress via `.hermes-loop-state.json`
36
+ - **Completion Promises**: Define custom termination conditions (file exists, content match, task count)
37
+ - **Automatic Resumption**: Continues from where it left off across sessions
38
+ - **Blocking Detection**: Stops loop when critical issues prevent progress
39
+ - **Command-style Tools**: Intuitive tool names that work like slash commands!
40
+
41
+ ### Available Commands
42
+
43
+ | Command | Description |
44
+ |---------|-------------|
45
+ | `init_loop` | Initialize a new loop state |
46
+ | `loop_status` | Check current loop status |
47
+ | `complete_task` | Mark next task as completed |
48
+ | `set_completion_promise` | Define custom termination condition |
49
+ | `add_blocking_issue` | Add blocker that stops loop |
50
+ | `reset_loop` | Reset completed count |
51
+
52
+ ## Installation
53
+
54
+ ### From GitHub (Current) 🚀
55
+
56
+ The plugin is available for direct installation from our GitHub repository:
57
+
58
+ ```bash
59
+ pip install git+https://github.com/AshMartian/hermes-loop-plugin.git@v1.0.0
60
+ ```
61
+
62
+ After installation, the plugin will be automatically discovered when you start Hermes Agent. No additional configuration required!
63
+
64
+ ### Verify Installation
65
+
66
+ Check that the plugin is installed correctly:
67
+
68
+ ```bash
69
+ # Check if package is installed
70
+ pip show hermes-loop-plugin
71
+
72
+ # Or verify plugin location (if using local development)
73
+ ls ~/.hermes/plugins/hermes-loop/
74
+ ```
75
+
76
+ You should see:
77
+ - `plugin.yaml` - Plugin manifest
78
+ - `__init__.py` - Registration and hooks
79
+ - `schemas.py` - Tool schemas (what LLM sees)
80
+ - `tools.py` - Tool handlers (actual implementation)
81
+ - `SKILL.md` - Comprehensive usage documentation
82
+
83
+ ### Local Development Installation
84
+
85
+ For development or custom builds, install from source:
86
+
87
+ ```bash
88
+ # Clone the repository
89
+ git clone https://github.com/AshMartian/hermes-loop-plugin.git
90
+ cd hermes-loop-plugin
91
+
92
+ # Install in editable mode for development
93
+ pip install -e .
94
+
95
+ # Or build and install manually
96
+ python -m build
97
+ pip install dist/hermes_loop_plugin-*.whl
98
+ ```
99
+
100
+ ### Manual Installation (for advanced users)
101
+
102
+ If you need to install the plugin manually:
103
+
104
+ 1. Download the package from [GitHub Releases](https://github.com/AshMartian/hermes-loop-plugin/releases) or clone the repository
105
+ 2. Install using pip: `pip install dist/hermes_loop_plugin-X.X.X.tar.gz`
106
+ 3. Restart Hermes Agent to load the plugin
107
+
108
+ ### 📦 PyPI Installation (Coming Soon!)
109
+
110
+ The plugin will be available on [PyPI](https://pypi.org/) for easier installation:
111
+
112
+ ```bash
113
+ # Coming soon!
114
+ pip install hermes-loop-plugin
115
+ ```
116
+
117
+ **Track progress:** Check our [GitHub Releases](https://github.com/AshMartian/hermes-loop-plugin/releases) for updates when we publish to PyPI.
118
+
119
+ ## Quick Start
120
+
121
+ ### 1. Initialize a loop state
122
+
123
+ Create a `.hermes-loop-state.json` file in your working directory:
124
+
125
+ ```python
126
+ from pathlib import Path
127
+ import json
128
+
129
+ state_file = Path.cwd() / '.hermes-loop-state.json'
130
+
131
+ with open(state_file, 'w') as f:
132
+ json.dump({
133
+ "total_tasks": 5,
134
+ "completed_tasks": 0,
135
+ "blocking_issues": [],
136
+ "completion_promise": {
137
+ "promise_type": "file_exists",
138
+ "condition": "src/features/new-feature.tsx"
139
+ }
140
+ }, f)
141
+ ```
142
+
143
+ ### 2. Set completion promise (optional)
144
+
145
+ Use the tool to define custom termination conditions:
146
+
147
+ ```python
148
+ set_completion_promise(
149
+ promise_type="content_match",
150
+ condition="tests/feature.test.ts",
151
+ expected_value="describe('Feature'"
152
+ )
153
+ ```
154
+
155
+ ### 3. Execute tasks
156
+
157
+ Run your tasks via subagents or direct implementation, updating the state after each completion:
158
+
159
+ ```python
160
+ from pathlib import Path
161
+
162
+ # Task 1
163
+ delegate_task(goal="Implement feature step 1")
164
+
165
+ # Update state
166
+ state_file = Path.cwd() / '.hermes-loop-state.json'
167
+ with open(state_file) as f:
168
+ state = json.load(f)
169
+ state['completed_tasks'] += 1
170
+ with open(state_file, 'w') as f:
171
+ json.dump(state, f, indent=2)
172
+
173
+ # Repeat for remaining tasks...
174
+ ```
175
+
176
+ ### 4. Loop continues automatically
177
+
178
+ The plugin's stop hook monitors the state file and determines whether to continue or stop execution based on:
179
+ - Task completion count vs total
180
+ - Completion promise fulfillment status
181
+ - Blocking issues present
182
+
183
+ ## State File Format
184
+
185
+ ```json
186
+ {
187
+ "total_tasks": 5,
188
+ "completed_tasks": 2,
189
+ "blocking_issues": [],
190
+ "completion_promise": {
191
+ "promise_type": "file_exists",
192
+ "condition": "src/features/new-feature.tsx",
193
+ "expected_value": null,
194
+ "fulfilled": false
195
+ },
196
+ "created_at": "2026-03-17T09:38:00Z"
197
+ }
198
+ ```
199
+
200
+ **Fields:**
201
+ - `total_tasks`: Total number of tasks in the loop
202
+ - `completed_tasks`: Number completed so far
203
+ - `blocking_issues`: List of issues that should stop the loop
204
+ - `completion_promise`: Optional custom termination condition
205
+ - `created_at`: Timestamp when loop started
206
+
207
+ ## Completion Promise Types
208
+
209
+ ### 1. Task Count
210
+
211
+ Stop after completing a specific number of tasks:
212
+
213
+ ```json
214
+ {
215
+ "promise_type": "task_count",
216
+ "condition": null,
217
+ "expected_value": "3"
218
+ }
219
+ ```
220
+
221
+ **Use case:** Continue until I've tried at least 3 debugging approaches
222
+
223
+ ### 2. File Exists
224
+
225
+ Stop when a specific file is created:
226
+
227
+ ```json
228
+ {
229
+ "promise_type": "file_exists",
230
+ "condition": "src/features/new-feature.tsx"
231
+ }
232
+ ```
233
+
234
+ **Use case:** Keep implementing until the feature file exists
235
+
236
+ ### 3. Content Match
237
+
238
+ Stop when a file contains specific content:
239
+
240
+ ```json
241
+ {
242
+ "promise_type": "content_match",
243
+ "condition": "src/utils/validation.ts",
244
+ "expected_value": "export function validateInput("
245
+ }
246
+ ```
247
+
248
+ **Use case:** Continue until validation logic is implemented
249
+
250
+ ### 4. Custom
251
+
252
+ Define your own condition via tool implementation:
253
+
254
+ ```json
255
+ {
256
+ "promise_type": "custom",
257
+ "condition": "my_custom_condition"
258
+ }
259
+ ```
260
+
261
+ **Use case:** Complex conditions requiring custom logic (extend the plugin)
262
+
263
+ ## Tools Provided
264
+
265
+ ### `loop_status`
266
+
267
+ Check current loop state and whether continuation is needed.
268
+
269
+ **Parameters:** None
270
+
271
+ **Returns:** JSON with:
272
+ - `has_remaining_tasks`: true if tasks remain
273
+ - `tasks_completed`: number completed so far
274
+ - `total_tasks`: total tasks in loop
275
+ - `completion_reached`: true if all conditions met
276
+ - `blocking_issues`: list of blocking issues (if any)
277
+
278
+ ### `set_completion_promise`
279
+
280
+ Set custom termination condition for the loop.
281
+
282
+ **Parameters:**
283
+ - `promise_type`: Type of condition (`task_count`, `file_exists`, `content_match`, `custom`)
284
+ - `condition`: Specific condition to check (e.g., file path, content pattern)
285
+ - `expected_value`: Expected value for condition (optional)
286
+
287
+ ## Integration Patterns
288
+
289
+ ### With subagent-driven-development
290
+
291
+ Use the loop to keep subagents running across sessions:
292
+
293
+ ```python
294
+ # Initialize state
295
+ state_file = Path.cwd() / '.hermes-loop-state.json'
296
+ with open(state_file, 'w') as f:
297
+ json.dump({"total_tasks": 5, "completed_tasks": 0}, f)
298
+
299
+ # Dispatch tasks via subagents (loop continues automatically)
300
+ delegate_task(goal="Implement Task 1")
301
+ mark_task_complete(state_file)
302
+
303
+ delegate_task(goal="Implement Task 2")
304
+ mark_task_complete(state_file)
305
+
306
+ # Loop will continue until all 5 tasks complete
307
+ ```
308
+
309
+ ### With writing-plans
310
+
311
+ Use loop for plans requiring iteration:
312
+
313
+ ```python
314
+ plan = read_file("docs/plans/feature-plan.md")
315
+ tasks = parse_plan_tasks(plan)
316
+
317
+ state_file = Path.cwd() / '.hermes-loop-state.json'
318
+ with open(state_file, 'w') as f:
319
+ json.dump({"total_tasks": len(tasks), "completed_tasks": 0}, f)
320
+
321
+ # Execute tasks (loop continues automatically across sessions)
322
+ ```
323
+
324
+ ### With systematic-debugging
325
+
326
+ Loop works seamlessly with debugging workflows:
327
+
328
+ ```python
329
+ state_file = Path.cwd() / '.hermes-loop-state.json'
330
+ with open(state_file, 'w') as f:
331
+ json.dump({
332
+ "total_tasks": 10,
333
+ "completed_tasks": 0,
334
+ "blocking_issues": [],
335
+ "completion_promise": {
336
+ "promise_type": "content_match",
337
+ "condition": "src/app.tsx",
338
+ "expected_value": "// Bug fixed"
339
+ }
340
+ }, f)
341
+
342
+ # Follow systematic-debugging process:
343
+ # 1. Identify symptoms
344
+ # 2. Form hypothesis
345
+ # 3. Test hypothesis
346
+ # 4. Update state if test fails
347
+ # 5. Loop continues until bug fixed or max iterations
348
+ ```
349
+
350
+ ## Debugging
351
+
352
+ ### Check loop status
353
+
354
+ ```python
355
+ status = loop_status()
356
+ print(f"Remaining: {status['has_remaining_tasks']}")
357
+ print(f"Completed: {status['tasks_completed']}/{status['total_tasks']}")
358
+ ```
359
+
360
+ ### Inspect state file directly
361
+
362
+ ```bash
363
+ cat .hermes-loop-state.json
364
+ ```
365
+
366
+ ### Force stop the loop
367
+
368
+ If loop is stuck, remove or rename the state file:
369
+
370
+ ```bash
371
+ mv .hermes-loop-state.json .hermes-loop-state.json.backup
372
+ # Loop will detect missing state and stop
373
+ ```
374
+
375
+ ## Extending the Plugin
376
+
377
+ To add new promise types or customize behavior:
378
+
379
+ 1. **Update `schemas.py`** - Add new enum values to tool parameters
380
+ 2. **Modify `tools.py`** - Implement handler logic for new features
381
+ 3. **Edit `__init__.py`** - Update `_on_stop_hook()` to evaluate new conditions
382
+
383
+ Example: Add HTTP status promise type:
384
+
385
+ ```python
386
+ # In __init__.py, add to _on_stop_hook:
387
+ elif promise_type == 'http_status':
388
+ import requests
389
+ url = completion_promise.get('condition', '')
390
+ response = requests.get(url)
391
+ expected_status = int(completion_promise.get('expected_value', 200))
392
+ promise_fulfilled = (response.status_code == expected_status)
393
+ ```
394
+
395
+ ## Security Considerations
396
+
397
+ ### State file permissions
398
+
399
+ Ensure state files are not world-readable if they contain sensitive data:
400
+
401
+ ```bash
402
+ chmod 600 .hermes-loop-state.json
403
+ ```
404
+
405
+ ### Validate promise conditions
406
+
407
+ Prevent path traversal attacks by validating promise conditions:
408
+
409
+ ```python
410
+ def validate_promise_condition(condition: str) -> bool:
411
+ """Prevent path traversal attacks."""
412
+ if '..' in condition or condition.startswith('/'):
413
+ return False # Reject absolute paths and path traversal
414
+ return True
415
+ ```
416
+
417
+ ## Comparison with Claude Code's ralph-wiggum-loop
418
+
419
+ | Feature | Hermes Loop | Ralph Wiggum Loop |
420
+ |---------|-------------|-------------------|
421
+ | Platform | Hermes Agent | Claude Code |
422
+ | State file format | JSON | JSON (similar) |
423
+ | Promise types | 4 built-in (task_count, file_exists, content_match, custom) | Similar |
424
+ | Hook integration | post_tool_call, on_session_start, stop_hook | Similar pattern |
425
+ | Tool interface | Explicit tools (loop_status, set_completion_promise) | Implicit via commands |
426
+ | Installation | ~/.hermes/plugins/ | .claude-plugin/ |
427
+
428
+ The Hermes Loop plugin follows the same conceptual model as ralph-wiggum but is adapted for Hermes Agent's tool-based architecture.
429
+
430
+ ## License
431
+
432
+ MIT License - see LICENSE file in repository root
433
+
434
+ **Repository:** [https://github.com/AshMartian/hermes-loop-plugin](https://github.com/AshMartian/hermes-loop-plugin)
435
+
436
+ ## Contributing
437
+
438
+ Contributions welcome! To contribute:
439
+
440
+ 1. Fork the repository
441
+ 2. Create a feature branch
442
+ 3. Make your changes
443
+ 4. Update documentation
444
+ 5. Submit a pull request
445
+
446
+ ### Plugin structure for contributors
447
+
448
+ ```
449
+ hermes-loop/
450
+ ├── plugin.yaml # Plugin manifest
451
+ ├── __init__.py # Registration and hooks
452
+ ├── schemas.py # Tool schemas (LLM-facing)
453
+ ├── tools.py # Tool handlers (implementation)
454
+ ├── SKILL.md # Usage documentation
455
+ └── README.md # This file
456
+ ```
457
+
458
+ ## Resources
459
+
460
+ - [Hermes Agent Plugin Documentation](https://github.com/NousResearch/hermes-agent/blob/main/website/docs/guides/build-a-hermes-plugin.md)
461
+ - [Subagent-Driven Development Skill](~/.hermes/skills/software-development/subagent-driven-development/SKILL.md)
462
+ - [Writing Plans Skill](~/.hermes/skills/software-development/writing-plans/SKILL.md)
463
+
464
+ ## Version History
465
+
466
+ ### v1.0.0 (2026-03-17)
467
+
468
+ - Initial release with core loop functionality
469
+ - Support for task_count, file_exists, content_match promise types
470
+ - Automatic state persistence and resumption
471
+ - Stop hook integration for loop continuation control