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

@orangecheck/agent-openai

v0.2.0

Published

Wrap OpenAI function-calling (Responses API + Chat Completions tool path) with OC Agent scope enforcement and emit a signed agent-action envelope per function invocation.

Readme

@orangecheck/agent-openai

Wrap OpenAI function calls with OC Agent scope enforcement and emit a signed agent-action envelope per invocation. Covers both the new Responses API (function_call items) and the legacy Chat Completions tool path (tool_calls).

Why

Function calling is the OpenAI-shaped way agents reach out to the world. Without scope enforcement and a cryptographic action receipt, "the model called this function" is the entire audit trail. With this adapter, every call carries: the agent address (BIP-322 signed), the active delegation, the exercised scope, the content hash of the inputs, and the OC Stamp anchor — replayable offline forever.

Status

v0.0.1 · in design. API shape is stable; canonicalization is locked. Production wiring (per-event streaming integration with the OpenAI SDK's responses.stream() / chat.completions.create()) lands when the first design partner names the integration.

Install

npm i @orangecheck/agent-openai
# peer deps:
npm i @orangecheck/agent-core @orangecheck/agent-signer

Quickstart

import { invokeWithStamp } from '@orangecheck/agent-openai';

// Pull a tool_call out of a Chat Completions response …
const toolCall = response.choices[0].message.tool_calls[0];

const { result, action, call } = await invokeWithStamp({
    agent,
    delegation,
    call: toolCall, // raw OpenAI shape — we normalize
    execute: async (c) => myInvoiceCreateImpl(c.arguments),
});

// `result` becomes the tool result you feed back to the model.
// `call` is the normalized OpenAiFunctionCall (id, name, arguments).
// `action` is the signed envelope; ship to your audit bundle / Nostr.

The same invokeWithStamp works on Responses-API function_call items — parseFunctionCall handles the call_id / id and string-vs-object arguments differences automatically.

What gets stamped

The stamp's content.hash is a SHA-256 of the RFC-8785-canonicalized JSON:

{
  "arguments": <canonical JSON of arguments>,
  "id":        "<call id>",
  "name":      "<function name>"
}

The action's scope_exercised defaults to openai:function(name=<name>). Override via scopeExercised.

API

  • parseFunctionCall(raw) — normalizes a Chat Completions tool_call or Responses function_call into {id, name, arguments}.
  • canonicalizeFunctionCall(call) — RFC 8785 canonical bytes.
  • functionCallHash(call)sha256:<64-hex> for content.hash.
  • stampFunctionCall(input) — sign without executing.
  • invokeWithStamp(input) — sign + execute + return both.

License

MIT.

Related