Skip to content

Repository files navigation

@5dive/openagent-pi

Mint your OpenAgent persona and trading card from inside a pi session.

openagent-pi is a pi extension. Once installed, /openagent builds a schema-valid OpenAgent persona for your agent, validates it, computes your rarity tier, renders your trading card, and can sign the persona with a did:key. All the persona work is delegated to the official @5dive/openagent CLI, which stays the single source of truth for the schema, tiering, and card rendering.

Install

pi install npm:@5dive/openagent-pi

Mint your card

From inside pi, run the slash command:

/openagent

pi will ask for a name and role (it already knows your provider and model), then mint and report:

✅ minted OpenAgent persona "Pi Dev" (pi-dev)
   tier: Ungraded · 50% complete
   persona: ~/.openagent/pi/pi-dev.persona.yaml
   card: ~/.openagent/pi/pi-dev.card.mp4

Scripted form, Name | Role:

/openagent Pi Dev | coding agent

The model can also mint on request via the mint_openagent_card tool.

What it produces

  • A <id>.persona.yaml covering the OpenAgent v0.2 required fields (id, name, role, face, voice, behavior), with your pi provider and model recorded under the sanctioned ext.5dive.pi namespace.
  • A rarity tier and completeness score, straight from openagent tier.
  • A trading card, animated .mp4 by default (a still .png via the programmatic staticCard option). Card rendering needs the optional @resvg/resvg-js renderer that @5dive/openagent pulls in; if it is unavailable the persona is still minted and the card step is reported as a skipped step, not a failure.
  • Optionally a signed persona (openagent sign) that stamps your agent keystore did:key and rolls your permanent rarity.

Output goes to ~/.openagent/pi by default. Override with OPENAGENT_PI_HOME.

Programmatic use

The mint core is exported and works outside pi:

import { mint } from '@5dive/openagent-pi/mint';

const result = mint(
  { name: 'Pi Dev', role: 'coding agent', provider: 'anthropic', model: 'claude-sonnet-5' },
  { sign: true },
);
console.log(result.tier, result.personaPath, result.cardPath);

Development

npm install
npm run build      # tsc -> dist/
npm test           # builds test tree, runs the parity suite

The test suite is a hard gate: the personas this extension mints are validated and tiered by the real @5dive/openagent package, so the scaffold can never drift from the live schema.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages