npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dotrino/remote-agent

v0.2.1

Published

Middleware compartido del ecosistema Dotrino para apps de agente remoto cifrado punto a punto (handshake E2E, emparejamiento SAS con vault, revocación, descubrimiento). Lo consumen dotrino-terminal (PTY) y dotrino-ia (chat con IA).

Downloads

613

Readme

@dotrino/remote-agent

Middleware compartido del ecosistema Dotrino para apps de agente remoto cifrado punto a punto. Lo consumen dotrino-terminal (PTY remoto) y dotrino-ia (chat con agentes de IA), y cualquier app futura que necesite hablar con un proceso que corre en la máquina del usuario.

Provee lo común — y solo eso:

  • Canal cifrado E2E por sesión (ECDH P-256 → HKDF → AES-256-GCM, isomórfico WebCrypto).
  • Handshake anti-MITM con verifyChain + anti-replay (firmado por el vault).
  • Emparejamiento SAS del agente contra el vault (código que no viaja).
  • Revocación con auto-borrado del enlace al ser revocada la máquina.
  • Wiring de proxy + identity (identify firmado, transporte por proxy.dotrino.com).
  • Autodescubrimiento de agentes por label (listVaultDevices + filtro).
  • Auditoría (sessions.log JSONL).

No sabe nada de PTY ni de IA. Cada app define sus payloads de dominio (terminal pasa {type:'cmd',...}, ia pasa {type:'msg',...}) y su renderer.

Entry points (subpath exports)

| Import | Entorno | Qué da | |---|---|---| | @dotrino/remote-agent | isomórfico | e2e (makeEphemeral/deriveKey/seal/open) + constantes de protocolo | | @dotrino/remote-agent/agent | Node | startRemoteAgent(opts) | | @dotrino/remote-agent/client | navegador | RemoteAgentClient | | @dotrino/remote-agent/link | Node | enroll, loadLink, dataDir, parseQr | | @dotrino/remote-agent/discover | navegador | listAgentsByLabel |

Uso

Agente (Node, en tu PC)

import { startRemoteAgent } from '@dotrino/remote-agent/agent'

const ra = await startRemoteAgent({
  label: 'ia-agent',
  proxyUrl: 'wss://proxy.dotrino.com',   // opcional
  dir: '/home/yo/.local/share/dotrino-ia-agent', // opcional
  quiet: false,
  onSession (session) {
    // sesión cifrada con un dispositivo cliente. session.device = su pubkey.
    session.on('message', async (msg) => {
      // msg es un payload de dominio: la app define la forma
      if (msg.type === 'msg') {
        const reply = await runYourDriver(msg.text) // Claude / OpenCode / ...
        session.send({ type: 'done', text: reply })
      }
    })
    session.on('close', () => {})
  },
  onRevoked () { console.log('me revocaron') }
})
// ra.machine, ra.machineId, ra.master, ra.close()

Enrolar la máquina (una vez, con el QR del vault):

import { enroll } from '@dotrino/remote-agent/link'
const link = await enroll({
  qr, label: 'ia-agent',
  onChallenge: ({ deviceId, code }) => console.log(`Tipeá en el vault: ${code}`)
})

Cliente (navegador, la PWA)

import { RemoteAgentClient } from '@dotrino/remote-agent/client'
import { listAgentsByLabel } from '@dotrino/remote-agent/discover'

const agentes = await listAgentsByLabel(id, 'ia-agent')   // tarjetas en la UI
const chat = new RemoteAgentClient(link, { agentPubkey: agentes[0].sub })
await chat.connect()                                        // handshake E2E
chat.on('message', (payload) => render(payload))
chat.on('error', (e) => console.warn(e))
chat.send({ type: 'msg', text: 'arreglá el bug en auth.js' })

const online = await chat.ping()  // liveness sin abrir sesión

link (la PWA lo obtiene del vault)

Ver dotrino-terminal/src/vault.js (getLink / getSelfLink) como referencia: es el enlace del dispositivo (cert P ← maestra, iss, proxy), que se pasa al RemoteAgentClient. La terminal ya lo resuelve; cada app puede copiar ese patrón o extraerlo luego a este paquete.

Seguridad

  • Autorización = estar vinculado al vault. El agente solo atiende dispositivos cuya cadena certifica la maestra pineada (verifyChain con trustedIssuer).
  • Emparejamiento con código SAS que no viaja (anti aprobación a ciegas / vault impostor).
  • Anti-replay en el handshake (ts ±5 min).
  • Auto-borrado del link.json al recibir un revoke firmado por la maestra.
  • Auditoría local de cada sesión abierta.
  • El relay de transporte (proxy.dotrino.com) solo ve bytes cifrados.

Dependencias

  • @dotrino/identity (capabilities: verifyChain, signWithDevice, verifyDeviceSig, pubkeyId, makeDeviceKey, verifyDelegation, makePairingCode)
  • @dotrino/proxy-client (WebSocketProxyClient)
  • ws (shim de WebSocket en Node, lado agente)

Licencia

MIT.