Paperclip adapter for running Oh My Pi (omp) as a local Paperclip agent runtime.
This package lets Paperclip invoke omp --mode json --print, parse the event stream, persist OMP sessions, and surface usage/model/cost metadata back to Paperclip.
- Adapter type:
omp_local - Runtime command:
omp - Paperclip contract source:
@paperclipai/adapter-utils@2026.703.0-canary.5 - OMP install command for fresh hosts/sandboxes:
npm install -g @oh-my-pi/pi-coding-agent - Package exports: shared metadata, server adapter, UI parser/config builder, CLI formatter
npm package:
npm install @agentic-engineering-agency/paperclip-adapter-ompGitHub fallback:
npm install git+https://github.com/Agentic-Engineering-Agency/paperclip-adapter-omp.gitHost runtime requirement:
npm install -g @oh-my-pi/pi-coding-agent
omp --versionConfigure OMP providers separately, for example in ~/.omp/agent/models.yml. This adapter does not manage provider credentials; it launches OMP with Paperclip run env injected.
createServerAdapter() exposes listModels/refreshModels, which resolve the OmniRoute catalog through a three-tier chain (each tier falls through on failure):
omp models omniroute --jsonon the host (inherits omp catalog +~/.omp/agent/models.ymloverrides);refreshModelsrunsomp models refreshfirst.- Direct gateway fetch of
$OMNIROUTE_BASE_URL/models(defaulthttps://omniroute.agenticengineering.lat/v1) withAuthorization: Bearer $OMNIROUTE_API_KEY; skipped when the key is unset. - Static defaults: the curated
modelslist insrc/model-catalog.ts.
Results are cached for 5 minutes; refreshModels bypasses and repopulates the cache.
| Export | Purpose |
|---|---|
@agentic-engineering-agency/paperclip-adapter-omp |
type, label, models, modelProfiles, agentConfigurationDoc, createServerAdapter (with listModels/refreshModels) |
@agentic-engineering-agency/paperclip-adapter-omp/server |
execute, testEnvironment, sessionCodec, parser helpers |
@agentic-engineering-agency/paperclip-adapter-omp/ui |
parseOmpStdoutLine, buildOmpLocalConfig |
@agentic-engineering-agency/paperclip-adapter-omp/ui-parser |
standalone browser-safe parseStdoutLine for external adapter manager |
@agentic-engineering-agency/paperclip-adapter-omp/cli |
printOmpStreamEvent |
Install through Paperclip's external adapter manager:
paperclipai adapter install --payload-json '{"packageName":"@agentic-engineering-agency/paperclip-adapter-omp","version":"0.1.2"}'This package root exports createServerAdapter(). It also declares paperclip.adapterUiParser = "1.0.0" and exposes ./ui-parser so Paperclip can serve the run transcript parser.
Server registry:
import {
agentConfigurationDoc as ompDoc,
modelProfiles as ompModelProfiles,
models as ompModels,
type as ompType,
} from "@agentic-engineering-agency/paperclip-adapter-omp";
import {
execute as executeOmp,
sessionCodec as ompSessionCodec,
testEnvironment as testOmpEnvironment,
} from "@agentic-engineering-agency/paperclip-adapter-omp/server";
const ompAdapter = {
type: ompType,
execute: executeOmp,
testEnvironment: testOmpEnvironment,
sessionCodec: ompSessionCodec,
models: ompModels,
modelProfiles: ompModelProfiles,
supportsLocalAgentJwt: true,
agentConfigurationDoc: ompDoc,
};UI registry:
import { buildOmpLocalConfig, parseOmpStdoutLine } from "@agentic-engineering-agency/paperclip-adapter-omp/ui";
export const ompUIAdapter = {
type: "omp_local",
label: "Oh My Pi (omp)",
parseStdoutLine: parseOmpStdoutLine,
ConfigFields: OmpConfigFields,
buildAdapterConfig: buildOmpLocalConfig,
};CLI registry:
import { printOmpStreamEvent } from "@agentic-engineering-agency/paperclip-adapter-omp/cli";
export const ompCLIAdapter = {
type: "omp_local",
formatStdoutEvent: printOmpStreamEvent,
};See docs/integration.md for full registry guidance.
{
"cwd": "/absolute/path/to/workspace",
"command": "omp",
"model": "omniroute/omp-agent",
"thinking": "high",
"timeoutSec": 3600,
"graceSec": 15
}Common fields:
| Field | Default | Meaning |
|---|---|---|
cwd |
process cwd | Absolute project directory for OMP |
command |
omp |
Executable name/path |
model |
host OMP default | Passed to --model |
smol, slow, plan |
unset | Passed to matching OMP role flags |
thinking |
unset | Passed to --thinking |
sessionDir |
OMP default | Passed to --session-dir |
profile |
OMP default | Passed to --profile |
configFiles |
[] |
Repeated --config flags |
tools, skills |
unset | OMP filters for tool/skill loading |
noTools, noLsp, noPty |
false |
Tool restriction flags |
noExtensions, noSkills, noRules |
false |
Discovery restriction flags |
allowHome, advisor, hideThinking |
false |
OMP runtime flags |
env |
{} |
Extra env vars; secrets are redacted from metadata |
Full config notes: docs/configuration.md.
The adapter stores:
{ "sessionId": "...", "cwd": "/absolute/path" }On next wake, it resumes with --resume <sessionId> only when the stored cwd matches current cwd. If OMP reports an unknown/missing session, the adapter retries once without --resume and returns clearSession: true so Paperclip forgets stale state.
The parser expects OMP JSON mode events like:
{ "type": "session", "id": "..." }
{ "type": "message_end", "message": { "role": "assistant", "content": [{ "type": "text", "text": "done" }] } }It extracts:
- session id
- provider/model
- summary text
- token usage (
input,output,cacheRead) - cost (
usage.cost.total) - structured final event JSON
npm install
npm run typecheck
npm test
npm run build
npm pack --dry-runnpm publish --access publicRelease currently requires an npm account/token with publish rights for the @agentic-engineering-agency scope.