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

@acentric-cloud/client

v0.3.0

Published

Create and drive acentric-cloud agent sessions from an application

Readme

@acentric-cloud/client

Create and drive Acentric Cloud sessions from Node 20+ or a browser. Install with npm install @acentric-cloud/client. The package has no runtime dependencies.

import { Client } from '@acentric-cloud/client';
const client = new Client({ baseUrl: 'https://api.cloud.acentric.dev', token });
const created = await client.createSession({ agent_id: agentId, configuration: {} });
if ('accepted' in created.response) {
  const receipt = await client.sendInput(
    created.session_id,
    { kind: 'message', payload: { text: 'hello' } },
    { inputId: 'message-1' },
  );
  console.log(receipt.response);
}

Create waits for init's answer. Input and configuration changes wait for their step's answer, and upgrade waits for migrate. Each returns a receipt with response: { accepted: true } | { rejected: Json } | { failed: Json }. The client resends queued responses with the identical body and identity. timeoutSeconds sets each server wait from 0 through 60, default 30; signal ends the HTTP wait without cancelling the submitted operation. Inputs and configuration changes that failed may be delivered again after an operator resumes or upgrades the session. Create and upgrade failures are final.

sendInput generates one UUID or uses inputId. updateConfiguration takes { id, config } and posts to /configuration. Keep these identities to recover after a lost response; changing a body under the same identity is refused. upgradeSession accepts toRelease, toVersion, idempotencyKey and answer options. With no target it uses the deployment. A successful upgrade clears a fault and delivers migrated first.

suspendSession stops work while inputs and config changes remain queued. resumeSession reopens a suspended or faulted gate. closeSession ends the session permanently and cancels its effects. These controls return Session, including its code version. A user stop should be an input defined by the agent. getSession, listSessions, deleteSession, getStatus, getState, getConfiguration, listConfigurations and getUsage cover other session reads.

getInput reads an inbox entry with queued or answered status and its latest answer. listInputs filters statuses and kinds with paging. listEffects lists open effects by default; request settled statuses and includeArgs explicitly when needed. Timers appear as @timer effects. listJournal({ after?, limit? }) returns { entries, next_after? }.

listLog(sessionId, { after?, before?, kinds?, limit?, cursor? }) returns { entries, cursor? } oldest first. Log positions and at milliseconds are numbers. An explicit empty kinds or statuses array is encoded as an empty filter; omit it for all kinds or the default effect statuses. streamLog(sessionId, { after?, kinds?, signal?, onLive? }) yields entries, consumes heartbeats and reconnects after its last delivered seq. Use after: 0 to replay the whole log. An omitted after pins the current head once before connecting.

getView returns the stored view plus an HTTP etag. No view is null; a conditional read with ifNoneMatch returns undefined when unchanged. listConsole, listAgentConsole and streamConsole read bounded diagnostics with an org credential. Console positions, session counters and revisions remain decimal strings, so compare those with BigInt. Console paging uses afterSeq, beforeSeq, minLevel, limit, cursor and order.

The constructor takes baseUrl, token (a string or async credential function), optional login org, custom fetch and retry attempts. Credential functions run before every request and stream reconnect. AcentricError exposes status, code, message, field, retryable, retryAfter and cause. Network errors and retryable API errors retry repeatable requests, retaining their identities and honoring Retry-After. A malformed response is a nonretryable protocol error. Token minting is sent once, and a delete retry can accept not_found after a lost reply.

Mint a session token on your server with mintSessionToken. A writable token may send inputs and suspend or resume; session tokens may read the session and its journal, log, inbox, effects, state, view and configuration. The console, creation, configuration writes, upgrades, close, deletion and minting tokens require an org credential. Give browsers a session token. getPricing() reads the public rate book without credentials or org headers. All generated wire types are exported unchanged.