How the Hermes adapter works
mainThe adapter acts as a bridge between the Paperclip orchestration platform and the Hermes Agent CLI.
Execution Lifecycle
- Trigger: Paperclip triggers a run via a heartbeat, a task assignment, or a comment wake.
- Execution: The adapter spawns the Hermes CLI in single-query mode (
-q). - Parsing: The adapter captures stdout/stderr and parses it into structured
TranscriptEntryobjects. This allows Paperclip to render tool cards with status icons. - Post-processing: Raw Hermes ASCII formatting (banners, setext headings, table borders) is converted into clean GFM markdown for the Paperclip UI.
- Error Handling: Benign stderr messages (like MCP initialization or structured logs) are reclassified so they do not appear as errors in the UI.
- Persistence: The adapter uses Hermes's
--resumeflag to maintain conversation context, memories, and tool state across heartbeats. ThesessionCodecensures session state is validated and migrated correctly between runs.
Skills Integration
The adapter provides a unified view of skills by merging two sources:
- Paperclip-managed skills: Bundled with the adapter and togglable via the UI.
- Hermes-native skills: Located in
~/.hermes/skills/(read-only).
The listSkills and syncSkills APIs allow the Paperclip UI to display both types in a single view.