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

@makaio/adapter-anthropic-sdk

v1.0.0-dev-1779051654000

Published

Anthropic SDK adapter using the official @anthropic-ai/sdk streaming API.

Downloads

56

Readme

@makaio/adapter-anthropic-sdk

Anthropic SDK AI adapter for the Makaio framework. Provides direct access to Claude models via the @anthropic-ai/sdk streaming API.

Quick Start

import { createAnthropicSdkAdapter } from '@makaio/adapter-anthropic-sdk';
import { MakaioBus } from '@makaio/bus-core';
import { AdapterSubjects } from '@makaio/contracts';

const adapter = await createAnthropicSdkAdapter();

const result = await MakaioBus.request(AdapterSubjects.startAgent, {
  adapterId: adapter.adapterId,
  role: 'lead',
  initialMessage: 'Inspect this repository',
});

Architecture

Three-layer design matching the framework adapter contract:

| Layer | Class | Responsibility | |-------|-------|----------------| | Domain | AnthropicSdkAdapter | Handles adapter.* bus subjects, lifecycle | | Agent | AnthropicSdkAgent | Handles agent.* subjects, routes connector events | | Connector | AnthropicSdkConnector | Owns the SDK streaming session, tool calling |

The connector drives an AnthropicSdkSession and AnthropicSdkConnectorTurn pair for each user turn, streaming events into the framework event bus.

Configuration

Provider configuration is resolved from the ProviderContext supplied on adapter.startAgent and the canonical provider definitions in provider.ts. The public package root does not expose a config factory for callers to use directly.

Runtime discovery loads @makaio/adapter-anthropic-sdk/server, whose default export is a MakaioExtension package descriptor with an adapters[] contribution.

Tool Approval

Tool approval is wired internally by the agent layer. The connector emits the scoped tool_approval RPC, and AnthropicSdkAgent forwards it to the global AgentSubjects.toolApprove subject with the full approval context (adapterId, adapterName, agentId, adapterSessionId, and sessionId).

Capabilities

Runtime capabilities declared by the adapter:

| Capability | Meaning | |------------|---------| | tools | Tool/function calling support | | streaming | Incremental stream events | | systemPrompt:override | Replace/set the system prompt | | systemPrompt:append | Append to the adapter's default system prompt |

Conformance-test capabilities returned by createTestConfig():

| Feature | Supported | |---------|-----------| | supportsReplace | Yes — streaming replace delivery mode | | supportsInterrupt | Yes — connector.interrupt() | | supportsUsageMetrics | Yes — token usage tracked via stream events |

Conformance Testing

import { createTestConfig } from '@makaio/adapter-anthropic-sdk';

// Returns a ConformanceTestConfig ready for the shared adapter test suite
const config = await createTestConfig();

File Index

| File | Purpose | |------|---------| | src/adapter.ts | AnthropicSdkAdapter and createAnthropicSdkAdapter factory | | src/agent.ts | AnthropicSdkAgent — event routing layer | | src/connector.ts | AnthropicSdkConnector — SDK streaming bridge | | src/session.ts | AnthropicSdkSession — session state for a single agent run | | src/turn.ts | AnthropicSdkConnectorTurn — turn state machine for one user/assistant exchange | | src/stream-bridge.ts | Streaming event parsing bridge | | src/provider.ts | Provider presets and model configuration | | src/config.ts | Internal adapter config factory | | src/schemas.ts | AnthropicSdkProviderConfigSchema and credential schema | | src/tool-handling.ts | Tool approval bridging and tool format conversion | | src/definition.ts | Internal adapter definition consumed by the package descriptor | | src/package.ts | MakaioExtension package descriptor with adapters[] contribution | | src/server.ts | Server entrypoint that re-exports the package descriptor as default | | src/namespaces/ | Bus namespace, subjects, and event schemas | | src/types/ | Internal type definitions | | src/utils/ | Utility functions (message history, error classification, etc.) |