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

@pmcollab/coworkstream-engine-http

v0.1.0

Published

Universal HTTP AgentRunner adapter for @pmcollab/coworkstream-engine. Wraps any agent reachable over HTTP — covers Python frameworks (LangChain Python, CrewAI, AutoGen, Google ADK, Semantic Kernel) and any custom backend.

Downloads

181

Readme

@pmcollab/coworkstream-engine-http

Coding agents: read packages/workstream-engine/AGENTS.md for the engine integration recipe before wiring this adapter. Migrating an existing setup? See packages/workstream-engine/MIGRATION.md.

Universal HTTP AgentRunner adapter. POSTs items to a customer-hosted endpoint and reads the response.

This is the bridge for non-JS agents. Host your Python LangChain / CrewAI / AutoGen / Google ADK / Semantic Kernel agent behind FastAPI, LiteServe, or whatever HTTP runtime you prefer; this adapter is the JS-side glue.

Install

npm install @pmcollab/coworkstream-engine-http

Use

import { createEngine } from '@pmcollab/coworkstream-engine'
import { createHttpAgent } from '@pmcollab/coworkstream-engine-http'

const agent = createHttpAgent({
  id: 'risk-py',
  url: 'https://agents.internal.example.com/risk/decide',
  headers: { authorization: `Bearer ${process.env.AGENT_TOKEN}` },
  timeoutMs: 30_000,
  retries: 1,
})

const engine = createEngine({ agents: [agent], /* ... */ })

Server contract

The endpoint must accept POST and respond with JSON:

POST /<your-endpoint>
Content-Type: application/json
X-Workstream-Trace-Id: <uuid>          # auto-set by the adapter
X-Workstream-Attempt: 1

Request body:

{
  "item": { /* WorkStreamItem */ },
  "ctx": { "trust": 0.5 }
}

Response body:

{ "position": "approve", "reasoning": "within budget", "confidence": 0.8 }

Python example (FastAPI + LangChain)

from fastapi import FastAPI
from pydantic import BaseModel
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate

app = FastAPI()
llm = ChatAnthropic(model='claude-sonnet-4-6')

class Request(BaseModel):
    item: dict
    ctx: dict

@app.post('/risk/decide')
async def decide(req: Request):
    prompt = ChatPromptTemplate.from_messages([
        ('system', 'You are a risk reviewer. Respond with JSON.'),
        ('user', f"Decide on: {req.item['title']}"),
    ])
    response = await (prompt | llm).ainvoke({})
    # parse `response.content` into { position, reasoning, confidence } and return
    return { 'position': 'approve', 'reasoning': response.content, 'confidence': 0.7 }

Options

createHttpAgent({
  id, url,                       // required
  name?, avatar?, capabilities?,
  headers?: Record<string, string>,
  timeoutMs?: number,            // default 30_000
  fetchFn?: typeof fetch,        // override global fetch
  defaultConfidence?: number,    // default 0.7
  toRequestBody?: (item, ctx) => unknown,
  fromResponse?: (json, item, ctx) => { position, reasoning, confidence },
  retries?: number,              // default 0
  retryDelayMs?: number,         // default 500 (exponential backoff)
})

License

Commercial. See LICENSE in the repository root.