-
Notifications
You must be signed in to change notification settings - Fork 21
Node.js client wrapper for TokenOps #122
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfestApproved for Hacktoberfest 2026Approved for Hacktoberfest 2026help wantedExtra attention is neededExtra attention is needed
Description
Activity
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfestApproved for Hacktoberfest 2026Approved for Hacktoberfest 2026help wantedExtra attention is neededExtra attention is needed
Summary
We'd like an official Node.js/TypeScript wrapper for TokenOps, mirroring the ergonomics of the Python SDK (
tokenops_run,wrap_complete,register_run, crossing hooks, control-plane integration viaTOKENOPS_URL).Motivation
TokenOps currently ships a Python integration. A Node.js wrapper would let JS/TS-based agent frameworks (LangChain.js, Vercel AI SDK, custom Node agents, etc.) get the same run-aware spend caps, halt/steer hooks, and per-agent cost attribution without reimplementing the protocol from scratch.
Rough scope
@tokenops/node(or similar) publishable to npmtokenops_runcontext manager (likely an async-friendly wrapper/decorator)wrap_complete-style helper for wrapping LLM call sites (OpenAI/Anthropic SDKs, etc.)register_runand crossing-hook support talking to the same control-plane HTTP API used by the Python clientTOKENOPS_URLenv var / config for pointing at a control plane instanceNotes
Happy to point contributors at the Python implementation and control-plane API as reference. This is a good "help wanted" item if anyone in the Node ecosystem wants to drive the wrapper design — open to discussion on API shape before implementation starts.