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

@byok-sdk/cloud

v0.18.0

Published

BYOK SDK hosted device surface: stateless frozen-v1 HTTP handlers over tenant-first @byok-sdk/core ports

Readme

@byok-sdk/cloud

Stateless hosted BYOK HTTP handlers and an in-memory reference composition over tenant-first @byok-sdk/core ports. It owns device-facing protocol/auth/policy logic but no durable database or object-storage driver.

Pair it with @byok-sdk/cloud-dataplane for Postgres + R2 production storage.

authenticateHostedDeviceAssertion() is the hosted connector-binding auth composition. It adapts the current DeviceDirectory row and CloudCrypto to core's single-use authenticator; callers must inject a replay authority and trusted deployment bindings. Create durable connector state only after it returns a principal. OAuth refresh tokens and the resulting long-lived profile remain host-owned and are never stored by this API.

const authenticated = await authenticateHostedDeviceAssertion(assertion, {
  devices,
  crypto,
  replay,
  clock,
  expected: { issuer, productId, audience: 'connector-binding' },
});
if (authenticated === undefined) throw new Error('unauthorized');
await connectorProfiles.bind(authenticated.device, providerLogin);

Hosted compositions enqueue the distinct toolset offer message explicitly:

await cloud.enqueueToolsetOffer(tenantId, deviceId, {
  taskId,
  payload: {
    instruction: 'Research the account and prepare the next sales action.',
    runtime: 'claude',
    policy: { mode: 'auto' },
    requiredToolsets: ['salesko.prospecting'],
  },
});

Unlike the live self-hosted coordinator, this stateless enqueue API cannot infer current device capabilities; the host must route to a device known to advertise toolset-selection. listPresence(tenant) includes the optional configuredToolsets reported by each live daemon, so the host can narrow candidate devices before enqueue. This is TTL-bounded discovery, not execution authority: the daemon still resolves every required ID locally and declines fail-closed if its configuration changed.

Reading a task's outcome goes through the same first terminal fact twice: readTerminalReceipt(tenant, taskId) returns the stored envelope raw, and readTaskResult(tenant, taskId) decodes that same receipt into a typed TerminalResult — the state, plus summary/sessionRef/artifactRefs/ document on a completion or reason/retryable on a failure — projected verbatim with no re-validation:

const result = await cloud.readTaskResult(tenantId, taskId);
if (result === undefined) {
  // No terminal fact yet. A declined task records none — read the attempt
  // status with `readTaskAttempt(tenant, taskId)` for that case.
} else if (result.state === 'failed' && result.retryable) {
  // re-offer
}

document is absent, never null, when the daemon sent none; a receipt whose stored body is not a terminal envelope throws ByokCloudError rather than returning a best-effort shape.

MIT licensed. Node.js 22.22.0 or newer.

Immutable offer readback

readTaskOffer(tenant, taskId) reads the immutable offer receipt using the TaskAttempt target and stable message identity. It validates the protocol payload, target/Agent binding and delivered marker. Corrupt receipts throw; missing attempt or missing offer receipt returns undefined. The returned recordedAt is receipt time, not transport time; no mailbox sequence is invented. A delivered=false read is not evidence that append never happened. Host-only message context is a separate authority, not part of this offer projection. The API's persistence is that of the injected receipts store: in-memory restart and Postgres generic receipt retention are not upgraded by this read method.