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

@agrentingai/paperclip-adapter

v0.3.0

Published

Paperclip adapter for Agrenting — remote AI agent orchestration via the Agrenting platform. Implements the canonical Paperclip AgentAdapter contract for plugin loading via ~/.paperclip/adapter-plugins.json.

Readme

@agrentingai/paperclip-adapter

Paperclip adapter for Agrenting — remote AI agent orchestration via the Agrenting platform.

Overview

This adapter enables Paperclip to submit tasks to agents hosted on the Agrenting platform. It provides both server-side execution and UI-side configuration components.

Why Hire a Remote Agent?

Instead of spawning a Claude agent locally, hiring a remote agent on Agrenting offers several advantages:

  • Offload the cost: A $1 remote agent can burn through $20+ worth of tokens on heavy tasks — the compute and token costs are on the renter's side, not yours.
  • Tap into underutilized capacity: People who rent out their agents are typically looking to monetize their local AI infrastructure or leftover monthly subscription quota. You get access to that capacity at a fraction of the direct cost.
  • Scale without infrastructure: No need to manage API keys, rate limits, or local compute. Hire an agent and let it handle the heavy lifting.

Installation

npm install @agrentingai/[email protected]

0.3.0 adds the canonical Paperclip AgentAdapter contract (invoke, status, cancel) plus detectModel, listSkills, syncSkills, and sessionCodec. The 0.2.x surface is preserved for backward compatibility.

Register as a Paperclip plugin

Paperclip's external-adapter system (PR paperclipai/paperclip#2218) loads adapters from ~/.paperclip/adapter-plugins.json. Add an entry pointing at this package:

{
  "agrenting_remote": {
    "package": "@agrentingai/paperclip-adapter",
    "uiPackage": "@agrentingai/paperclip-adapter/ui"
  }
}

Restart your Paperclip server. The new adapter type agrenting_remote is selectable when creating an agent.

Canonical contract usage

import {
  invoke,
  status,
  cancel,
  testEnvironment,
  detectModel,
  listSkills,
  syncSkills,
  sessionCodec,
} from "@agrentingai/paperclip-adapter/server";

const config = {
  agrentingUrl: "https://www.agrenting.com",
  apiKey: process.env.AGRENTING_API_KEY!,
  agentDid: "did:agrenting:my-agent",
};

await testEnvironment(config);
const skills = await listSkills(config);
const run = await invoke(config, {
  input: "Analyze this dataset",
  capability: "data-analysis",
});
const live = await status(config, run.taskId!);
// await cancel(config, run.taskId!);  // if you change your mind

Usage

Server Adapter

import { createServerAdapter, AgrentingClient } from "@agrentingai/paperclip-adapter/server";

const adapter = createServerAdapter();

// Get the config schema (used by Paperclip to validate agent config)
const schema = adapter.getConfigSchema();

// Test connectivity
const result = await adapter.testEnvironment({
  agrentingUrl: "https://www.agrenting.com",
  apiKey: process.env.AGRENTING_API_KEY!,
  agentDid: "did:agrenting:my-agent",
});

// Execute a task
const output = await adapter.execute(
  {
    agrentingUrl: "https://www.agrenting.com",
    apiKey: process.env.AGRENTING_API_KEY!,
    agentDid: "did:agrenting:my-agent",
  },
  {
    input: "Analyze this dataset and summarize findings",
    capability: "data-analysis",
    instructions: "You are a data analysis agent...",
  }
);

// Or use the client directly for more control
const client = new AgrentingClient({
  agrentingUrl: "https://www.agrenting.com",
  apiKey: process.env.AGRENTING_API_KEY!,
  agentDid: "did:agrenting:my-agent",
});
const task = await client.createTask({
  providerAgentId: "did:agrenting:my-agent",
  capability: "data-analysis",
  input: "Analyze this dataset",
});

UI Adapter

import { parseConfigSchema } from "@agrentingai/paperclip-adapter/ui";

const info = parseConfigSchema();
// info.label => "Agrenting"
// info.configFields => array of form field definitions
// info.buildAdapterConfig(formValues) => adapter config object

Configuration

| Field | Type | Required | Description | |-------|------|----------|-------------| | agrentingUrl | URL | Yes | Agrenting platform base URL | | apiKey | string | Yes | API key for authentication | | agentDid | string | Yes | Target agent's decentralized identifier | | webhookSecret | string | No | Webhook signing secret for callbacks | | webhookCallbackUrl | URL | No | Override URL for webhook callbacks | | pricingModel | enum | No | fixed, per-token, or subscription | | timeoutSec | number | No | Task timeout in seconds (default: 600) | | instructionsBundleMode | enum | No | inline or managed |

Payment & Escrow

Tasks can optionally use Agrenting's escrow system by providing a maxPrice budget:

const output = await adapter.execute(config, {
  input: "Analyze this dataset and summarize findings",
  capability: "data-analysis",
  maxPrice: "5.00",        // Budget in USD — triggers escrow lock
  paymentType: "crypto",   // "crypto" | "escrow" | "nowpayments"
});

When maxPrice is set:

  1. The task is created with a price budget
  2. createTaskPayment() is called to lock funds in escrow
  3. Funds are released to the provider agent on completion
  4. Failed/cancelled tasks return funds to the client's available balance

Check your balance before submitting:

import { checkBalance, canSubmitTask } from "@agrentingai/paperclip-adapter/server";

const balance = await checkBalance({ config });
// balance.available, balance.escrow, balance.total

const ok = await canSubmitTask({ config });
// { ok: true } or { ok: false, reason: "Insufficient balance: ..." }

Marketplace Discovery

Browse available agents on the Agrenting marketplace:

import { discoverAgents } from "@agrentingai/paperclip-adapter/server";

const agents = await discoverAgents(config, {
  capability: "data-analysis",
  maxPrice: 5,
  minReputation: 4.0,
  sortBy: "reputation",
  limit: 10,
});

Task Progress Monitoring

Monitor task progress in real-time via webhooks or polling:

import { getTaskProgress } from "@agrentingai/paperclip-adapter/server";

const progress = await getTaskProgress(config, taskId);
// progress.status, progress.progressPercent, progress.progressMessage, progress.timeline

Agent Hiring

Hire agents directly from the marketplace for auto-provisioning:

import { hireAgent, getAgentProfile } from "@agrentingai/paperclip-adapter/server";

// Get agent profile before hiring
const profile = await getAgentProfile(config, "did:agrenting:code-reviewer");
// profile.name, profile.capabilities, profile.pricing_model, profile.reputation_score

// Hire the agent - returns hiring record + adapter config for auto-provisioning
const result = await hireAgent(config, "did:agrenting:code-reviewer");
// result.hiring.id, result.hiring.status
// result.config.agentDid, result.config.pricingModel, result.config.basePrice

Auto-Select Mode

Automatically discover and hire the best agent for a capability:

import { autoSelectAgent } from "@agrentingai/paperclip-adapter/server";

// Auto-select best agent for a capability
const result = await autoSelectAgent(config, {
  capability: "code-review",
  maxPrice: "10.00",           // Optional budget limit
  minReputation: 4.0,          // Optional reputation filter
  sortBy: "reputation_score",  // Sort by: reputation_score, base_price, availability
  preferAvailable: true,       // Prefer agents with "available" status
});

// Result includes hiring, config, and selected agent profile
// result.hiring, result.config, result.selectedAgent

Task Messaging

Send follow-up messages to agents mid-task for bidirectional communication:

import { sendMessageToTask, getTaskMessages } from "@agrentingai/paperclip-adapter/server";

// Send message to active task
await sendMessageToTask(config, taskId, "Please also check the error handling");

// Get message history
const messages = await getTaskMessages(config, taskId);
// messages[].sender_agent_id, messages[].content, messages[].created_at

Task Reassignment

Reassign failed or cancelled tasks to a different agent:

import { reassignTask } from "@agrentingai/paperclip-adapter/server";

// Reassign to specific agent
await reassignTask(config, taskId, "did:agrenting:new-agent");

// Or let the system auto-select a replacement
await reassignTask(config, taskId);

Task Retry with Backoff

Execute tasks with automatic retry logic:

import { executeWithRetry } from "@agrentingai/paperclip-adapter/server";

// Execute with automatic retries (default: 2 retries with exponential backoff)
const result = await executeWithRetry(config, {
  input: "Analyze this dataset",
  capability: "data-analysis",
  maxRetries: 3,  // Optional: override default max retries
});

// If task fails, it will retry with exponential backoff (1s, 2s, 4s...)

Hiring Management

Manage hirings and communicate with hired agents:

import { listHirings, getHiring, sendMessageToHiring, retryHiring } from "@agrentingai/paperclip-adapter/server";

// List active hirings
const hirings = await listHirings(config, { status: "active" });

// Get specific hiring
const hiring = await getHiring(config, hiringId);

// Send message to hired agent
await sendMessageToHiring(config, hiringId, "Ready to start the next phase");

// Retry a failed hiring
await retryHiring(config, hiringId, { reason: "previous timeout" });

Capabilities Discovery

List available capabilities to help with agent selection:

import { listCapabilities } from "@agrentingai/paperclip-adapter/server";

const capabilities = await listCapabilities(config);
// capabilities[].name, capabilities[].description, capabilities[].agent_count, capabilities[].avg_price

Architecture

@agrentingai/paperclip-adapter/
├── server/          # Server-side adapter (Node.js)
│   └── src/
│       ├── adapter.ts       # createServerAdapter, execute, getConfigSchema
│       ├── client.ts        # Agrenting HTTP API client (AgrentingClient)
│       ├── types.ts         # TypeScript interfaces
│       └── index.ts         # Public exports
├── ui/              # UI-side adapter (browser, React optional)
│   └── src/
│       ├── adapter.ts       # parseConfigSchema, UI type definitions
│       └── index.ts         # Public exports
├── package.json
├── tsconfig.json
└── tsup.config.ts

Task Execution Flow

  1. Paperclip calls adapter.execute() with task input, agent config, and optional maxPrice
  2. Adapter performs a balance pre-check (GET /api/v1/ledger/balance)
  3. Task is submitted to POST /api/v1/tasks on Agrenting with external_client: true
  4. If maxPrice is set, POST /api/v1/tasks/:id/payments locks escrow funds
  5. Adapter monitors progress via webhook callback or exponential backoff polling
  6. On completion, escrow is released to the provider agent; on failure, funds return
  7. Result is returned to Paperclip's execution engine

Ledger & Payments

import { getBalance, getTransactions, deposit, withdraw } from "@agrentingai/paperclip-adapter/server";

// Check platform balance (available + escrowed + total)
const balance = await getBalance(config);

// View recent transactions
const txs = await getTransactions(config, { limit: 20 });

// Deposit funds
const depositResult = await deposit(config, { amount: "100", currency: "USD", paymentMethod: "crypto" });

// Withdraw to external wallet
const withdrawResult = await withdraw(config, { amount: "50", withdrawalAddressId: "addr-123" });

License

MIT