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

@call-e/core

v0.3.1

Published

Shared CALL-E runtime helpers for brokered auth, local token cache, and MCP HTTP calls.

Readme

@call-e/core

@call-e/core contains shared CALL-E runtime helpers for brokered authentication, private local token cache files, JSON HTTP requests, and MCP streamable HTTP tool calls.

This package is used by CALL-E integrations such as @call-e/cli. It is not a standalone CLI, OAuth server, or MCP server.

Modules

import { tokenCachePath } from "@call-e/core/cache";
import { createBrokerSession } from "@call-e/core/broker-client";
import { callMcpTool } from "@call-e/core/mcp-client";

Public subpaths:

  • @call-e/core/constants
  • @call-e/core/config
  • @call-e/core/cache
  • @call-e/core/http
  • @call-e/core/broker-client
  • @call-e/core/mcp-client

TypeScript declarations are included for the root export and every public subpath.

Authentication Preflight

Check the cached token before starting an MCP request when the integration needs to return its own typed authentication state:

import { currentTokenDocument } from "@call-e/core/mcp-client";

if (!currentTokenDocument(config)) {
  return { ok: false, code: "not_authenticated" };
}

currentTokenDocument applies the configured minimum token TTL and returns null when the cache is missing, malformed, or too close to expiry. tokenIsUsable is also available from @call-e/core and @call-e/core/cache for callers that already hold a token document.

Per-Request Tool Timeout

callMcpTool accepts an optional timeoutSeconds override for the tools/call request:

await callMcpTool({
  config,
  toolName: "plan_call",
  toolArguments: { to_phones: ["+15551234567"], goal: "Confirm the appointment" },
  timeoutSeconds: 150,
});

The override applies only to the tool call. MCP session initialization keeps using config.timeoutSeconds; when the override is omitted, the tool call uses that configured timeout too.

Tool Result Payloads

callMcpTool returns the MCP CallToolResult envelope and preserves its raw content, isError, and metadata fields. When structuredContent is absent but a text content block contains a JSON object, the client also exposes that object as structuredContent. Non-JSON text, arrays, and scalar JSON remain unchanged.

See the MCP tool result envelope for the direct wire shape, compatibility fallback, and Python SDK field-name differences.

Broker Login Lifetime

Broker session timing is server-directed:

  • Treat the returned expires_at as authoritative. Do not assume a fixed session lifetime.
  • loginWithBroker follows poll_after_ms, clamped to 500-10,000 ms.
  • pollTimeoutSeconds limits how long the client waits; it does not extend the login link lifetime. The fallback is 300 seconds.

Operator-facing integrations can use ensurePendingLogin when they need to show the login URL and its remaining lifetime without blocking on the full login flow.

Outbound Call Contract

CALL-E's outbound tools follow this order:

plan_call -> run_call -> get_call_run

plan_call prepares a call without placing it. Only call run_call after the plan reports ready_to_run=true, using the exact plan_id and confirm_token returned by that plan. get_call_run reads progress and results using the run_id returned by run_call.

run_call can place a real outbound phone call. Keep it behind explicit user approval and never use it as a connectivity test or auto-run tool.

See the OpenAgent OAuth MCP guide for the tool inputs, result handoffs, polling guidance, and complete safety contract. At runtime, listMcpTools remains authoritative for the server's current MCP schemas.

Development

pnpm --filter @call-e/core test
pnpm --filter @call-e/core check
pnpm --filter @call-e/core pack:dry-run