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

@xenosystem/web-context-client

v0.1.5

Published

Dependency-free typed client and contracts for XENO Web Context

Downloads

6,416

Readme

@xenosystem/web-context-client

Dependency-free typed HTTP client and request/evidence contracts for XENO Web Context.

The server runtime, providers, workers, browser renderer, PostgreSQL, and S3 dependencies are deliberately not part of this package.

Entry points

| Import | Contents | |---|---| | @xenosystem/web-context-client | WebContextClient and the job-progress contract. | | @xenosystem/web-context-client/contract | Request, budget, policy, and evidence contracts. | | @xenosystem/web-context-client/job | WebJob, WebMonitor, MonitorCheck projections. | | @xenosystem/web-context-client/progress | WebJobProgress and its derivation helpers. |

Routing through the XENO account gateway

pathPrefix replaces the leading /v1 of every route. The default is empty, which sends routes unchanged. The XENO account gateway serves Web Context at /v1/web:

const client = new WebContextClient({
  baseUrl: "https://api.xenostudio.ai",
  token: accountCredential,
  pathPrefix: "/v1/web",
});

Only routes the gateway serves are reachable under the prefix: search, scrape, extract, map, render, search-and-scrape, parse, job get and job cancel.

Provider cost intent

For account-gateway search, an unset caller limit is represented by budget: { ...limits, maxProviderCostUsd: 0, providerCostMode: "account-default" }. The gateway resolves this marker to its configured allowance and removes the marker before dispatch. Direct runtimes do not grant an allowance from this marker.

An explicit caller limit omits providerCostMode: zero forbids provider spend, a positive number narrows the server allowance, and an invalid value is refused. Legacy zero budgets are preserved as zero, not reinterpreted as permission to spend. Provider cost limits are distinct from any customer credit price.

Job progress

waitForJob and scrapeAndWait accept an optional onProgress listener. It is the one progress contract shared by Chat, the Agent SDK, ACP v2, the CLI, and the Agent Interface — do not build a second polling engine on top of job().

const document = await client.scrapeAndWait(request, {
  onProgress: (progress) => {
    // WebJobProgress: schema identity, jobId, operation, state, terminal semantics,
    // and non-negative page counters. No token, query, purpose, request body,
    // provider body, artifact bytes, or tenant/fence authority.
    ui.render(progress);
  },
});

The initial observation is always emitted, then only observations whose content changed, then the terminal observation exactly once. A timeout raises WAIT_TIMEOUT and never invents a terminal observation. Progress is fail-closed: a listener that throws or rejects stops the wait and raises PROGRESS_LISTENER_FAILED with the original error on cause; the durable job is left running and can be cancelled explicitly. Omitting onProgress preserves the previous behavior exactly.