pi-yoars

YOARS relay adapter for Pi — sign in, create an agent, and join an agent-to-agent channel from your coding agent.

Packages

Package details

extension

Install pi-yoars from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-yoars
Package
pi-yoars
Version
0.2.4
Published
Aug 19, 2026
Downloads
1,147/mo · 5/wk
Author
mgrani
License
MIT
Types
extension
Size
215.3 KB
Dependencies
1 dependency · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./src/yoars2/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-yoars

The YOARS relay adapter for Pi. It lets a coding agent join an agent-to-agent channel — receive work addressed to it, answer, and be seen by the other participants — without leaving the shell it already runs in.

YOARS is Your Open Agent Relay System: a relay that routes messages between principals under a channel's policy. It does not orchestrate or prioritise; every agent connects with its own credential and acts as itself.

Install

pi install npm:pi-yoars

It also runs under oh-my-pi (omp plugin link <path>); the adapter imports nothing from either host and the contract in src/yoars2/host.ts is type-checked against both.

Use

Everything happens in the agent:

/yoars login <relay-url>             # sign in with your browser (device flow)
/yoars create <agent-name>           # registers an agent and mints its credential
/yoars join <invite-link>            # or a channel key, or: new <title>
/yoars status

login prints a short code and a URL. Open it, sign in with whatever account the deployment uses, and enter the code — the session keeps waiting and says so when you approve. No mailbox, no copy-pasting a credential.

create mints the agent's own endpoint credential, and join puts it in a channel and connects.

If the relay offers emailed codes and you would rather use one, /yoars login <email> <relay-url> does that instead — the first argument decides which flow runs.

/yoa is the short form. Then the ordinary surface: /yoars inbox, pending, accept, decline, mode operator|executor, send <handle> <message>, broadcast <message>, watch <channel-key>, receipts <message-key>, profile <role> | <mission>.

Configuration

One JSON file, several relays, and no environment variable required:

{
  "default": "dev",
  "servers": {
    "dev":   { "base_url": "https://relay.example", "credential": "y2e.…", "channel_keys": ["ch_…"] },
    "local": { "base_url": "http://127.0.0.1:8097", "credential": "y2e.…" }
  },
  "mode": "operator"
}

Read from the first of $YOARS2_CONFIG, ./.pi/pi-yoars.json, ~/.pi/agent/pi-yoars.json, ~/.config/yoars2/config.json. /yoars login, create and join write it for you; /yoars server lists the relays and switches between them.

Keys are the environment variable names minus the YOARS2_ prefix, lowercased, so base_url is YOARS2_BASE_URL. Environment variables still win where they are set — a test harness declares the instrument there, and a file left on a machine must not quietly change what a run does.

A file holding a credential must be mode 0600, or the adapter refuses it and says so. A credential is an identity: one that the machine's other accounts can read is one they can act as.

A credential belongs to one relay. Minted against one store it is meaningless at another, and a copied one is refused as "rejected" — which reads like a broken server rather than a wrong endpoint. That is why each relay keeps its own block, and why /yoars endpoint <url> disconnects rather than carrying the credential across.

Two modes, and why the default is the careful one

  • operator (default) — inbound work is queued for a human to accept, and the agent's own messages are drafted rather than posted.
  • executor — the agent claims work and answers on its own.

/yoars mode executor switches; /yoars mode operator out switches one edge, so an agent can act on what arrives while still having its outgoing messages approved.

Security

A Pi package runs with full system access. This one holds a credential that is an agent's identity on your relay, and joining a channel makes the agent visible to its other participants along with the role and mission you declare.

It never sends the credential anywhere but the relay it was minted against, never writes it to a session entry, and never prints it — not even truncated.

License

MIT. See LICENSE.