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

ajp-protocol

v0.1.0

Published

Agent Job Protocol — standard interaction layer for the agent internet

Readme

ajp-protocol

The Agent Job Protocol — standard interaction layer for the agent internet. Part of the Provenance Protocol family.

npm install ajp-protocol

What it does

AJP defines how any party — a human, an agent, or an orchestrator — hands a job to another agent, tracks its progress, and receives the result.

Three endpoints. Three message types. Runs over standard HTTP. Trust verification via provenance-protocol built in.


Quick start — receiving agent

Add three routes to your agent. AJP handles verification, trust checks, and job lifecycle automatically.

import { AJPServer } from 'ajp-protocol';
import express from 'express';

const app = express();
app.use(express.json());

const server = new AJPServer({
  provenanceId: 'provenance:github:alice/research-assistant',
  secret: process.env.AJP_SECRET,

  // Trust requirements for incoming agent senders
  trustRequirements: {
    requireDeclared: true,   // sender must have PROVENANCE.yml
    requireClean: true,      // no open incidents
    requireMinAge: 7,        // not a brand-new agent
  },

  // Your agent logic — receives the job, returns the result
  onJob: async (job) => {
    const papers = await searchPapers(job.task.instruction);
    return { papers };
  },
});

app.post('/jobs',         server.receive());
app.get('/jobs/:id',      server.status());
app.post('/jobs/:id/ack', server.ack());

app.listen(3000);

Quick start — sending agent or platform

import { AJPClient } from 'ajp-protocol';

const client = new AJPClient({
  from: {
    type: 'agent',   // 'human' | 'agent' | 'orchestrator'
    provenance_id: 'provenance:github:alice/orchestrator',
  },
  secret: process.env.AJP_SECRET,
});

const result = await client.send(
  'provenance:github:bob/research-assistant',  // who to hire
  {
    type: 'research',
    instruction: 'Find the top 3 papers on transformer attention in 2024.',
    output_format: 'json',
  },
  {
    max_usd: 0.50,       // budget cap
    max_seconds: 120,    // timeout
  }
);

console.log(result.output);
// { papers: [...] }

Three use cases, one protocol

Human hiring an agent

const client = new AJPClient({
  from: { type: 'human', id: 'user_alice_123' },
  secret: process.env.AJP_SECRET,
});
const result = await client.send(agentId, task, budget);

Agent hiring an agent

const client = new AJPClient({
  from: { type: 'agent', provenance_id: 'provenance:github:alice/pipeline' },
  secret: process.env.AJP_SECRET,
});
// Receiving agent automatically verifies sender via Provenance
const result = await client.send(agentId, task, budget);

Orchestrator delegating to sub-agents (with audit chain)

const [resultA, resultB] = await Promise.all([
  client.send(agentA, taskA, budget, { parentJobId: parentJobId }),
  client.send(agentB, taskB, budget, { parentJobId: parentJobId }),
]);
// All sub-jobs linked to parent — full execution tree is auditable

How trust works

When an agent or orchestrator sends a job, the receiving AJPServer automatically calls provenance-protocol to verify the sender:

AJPServer.receive()
  → verify signature
  → provenance.gate(offer.from.provenance_id, trustRequirements)
      → is sender in Provenance index?
      → has PROVENANCE.yml?
      → any open incidents?
      → old enough?
  → run onJob() only if all checks pass
  → return 403 with reason if any check fails

Human senders (from.type: 'human') skip Provenance verification. Platform-level auth is assumed for humans.


Declare AJP in your PROVENANCE.yml

provenance: "0.1"
name: "Research Assistant"

capabilities:
  - read:web
  - ajp:receiver      # accepts incoming AJP jobs
  - ajp:sender        # sends AJP jobs to other agents

ajp:
  endpoint: "https://alice.dev/api/agent"
  version: "0.1"

The Provenance crawler reads ajp.endpoint and indexes it. Senders can discover your endpoint without out-of-band configuration.


Next.js API route example

// app/api/agent/jobs/route.js
import { AJPServer } from 'ajp-protocol';
import { NextResponse } from 'next/server';

const server = new AJPServer({
  provenanceId: process.env.PROVENANCE_ID,
  secret: process.env.AJP_SECRET,
  onJob: async (job) => {
    // your agent logic
    return { result: '...' };
  },
});

export async function POST(req) {
  return server.receive()(req, NextResponse);
}

The protocol family

| Package | Purpose | |---|---| | provenance-protocol | Query the agent identity index | | ajp-protocol | Send and receive agent jobs (this package) | | PROVENANCE.yml | Declare your agent's identity and capabilities |


MIT License — provenance.dev/ajp