Files
teknium1 edfb917337 feat: initial Paperclip adapter for Hermes Agent
Implements the Paperclip ServerAdapterModule interface to run Hermes Agent
as a managed employee in a Paperclip company.

Modules:
- server/execute.ts — spawns hermes CLI, handles sessions, parses output
- server/test.ts — environment checks (CLI, Python, API keys)
- ui/parse-stdout.ts — stdout → TranscriptEntry[] for run viewer
- ui/build-config.ts — UI form → adapterConfig
- cli/format-event.ts — terminal output formatting

Features:
- Session persistence across heartbeats via --resume
- Configurable model, provider, toolsets, timeout
- Conditional prompt templates (task vs heartbeat wake)
- Token usage and cost extraction from output
- Git worktree isolation mode
- Full environment test suite
2026-03-10 17:17:07 -07:00

1.6 KiB

Hermes Paperclip Adapter — Development Guide

Overview

This is a Paperclip adapter that runs Hermes Agent as a managed employee. It implements the ServerAdapterModule interface from @paperclipai/adapter-utils.

Structure

src/
├── index.ts              # Root: type, label, models, agentConfigurationDoc
├── shared/constants.ts   # Shared constants (regex, defaults)
├── server/
│   ├── index.ts          # Re-exports execute + testEnvironment
│   ├── execute.ts        # Core execution (spawn hermes CLI)
│   └── test.ts           # Environment checks (CLI, Python, API keys)
├── ui/
│   ├── index.ts          # Re-exports
│   ├── parse-stdout.ts   # Hermes stdout → TranscriptEntry[]
│   └── build-config.ts   # UI form → adapterConfig
└── cli/
    ├── index.ts          # Re-exports
    └── format-event.ts   # Terminal output formatting

Key Interfaces

The adapter implements ServerAdapterModule:

  • execute(ctx) — spawns hermes chat -q "...", returns AdapterExecutionResult
  • testEnvironment(ctx) — checks CLI, Python, API keys
  • models — list of available LLM models
  • agentConfigurationDoc — markdown docs for the config form

Build

npm install
npm run build     # tsc → dist/
npm run typecheck # type checking only

Testing against a local Paperclip instance

  1. Build this adapter: npm run build
  2. In your Paperclip repo, add this as a local dependency
  3. Register in server/src/adapters/registry.ts
  4. Create an agent with adapterType: "hermes_local"
  5. Trigger a heartbeat and observe logs