mirror of
https://github.com/paperclipai/hermes-paperclip-adapter.git
synced 2026-11-07 06:15:59 -10:00
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
1.6 KiB
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)— spawnshermes chat -q "...", returnsAdapterExecutionResulttestEnvironment(ctx)— checks CLI, Python, API keysmodels— list of available LLM modelsagentConfigurationDoc— 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
- Build this adapter:
npm run build - In your Paperclip repo, add this as a local dependency
- Register in
server/src/adapters/registry.ts - Create an agent with
adapterType: "hermes_local" - Trigger a heartbeat and observe logs