Skip to content
PluginStats

@corti/ai-sdk-adapter weekly downloads statistics

By corti · npm · AI SDKs

Corti AI SDK adapter for Vercel AI SDK, integrating with Corti's A2A agents API

View on npm Fresh · Oct 18, 2026

@corti/ai-sdk-adapter has 443 recorded weekly downloads on npm, a decrease of 36.6% over the past 30 days, ranking #1571 of 2,322 tracked listings.

Weekly downloads
443
Official API · Oct 18, 2026
7-day growth
-50.4%
-451 weekly downloads
30-day growth
-36.6%
-256 weekly downloads
90-day growth
+208%
+299 weekly downloads
Rank
#1571
Among tracked npm listings

About @corti/ai-sdk-adapter

@corti/ai-sdk-adapter

Adapter for integrating Corti's A2A (Agent-to-Agent) API with Vercel AI SDK. This package provides utilities to convert between AI SDK's UI message format and Corti's A2A format.

Installation

npm install @corti/ai-sdk-adapter @corti/sdk @a2a-js/sdk ai

Overview

This adapter provides three main functions:

  • convertToParams() - Converts CortiUIMessage[] to A2A MessageSendParams
  • toUIMessageStream() - Converts A2A stream to UI message stream
  • createA2AClientFactory() - Creates an A2A client factory configured with Corti authentication

Usage

Streaming Chat (Next.js API Route)
import { convertToParams, toUIMessageStream, createA2AClientFactory } from '@corti/ai-sdk-adapter';
import type { CortiUIMessage, ExpertCredential } from '@corti/ai-sdk-adapter';
import { CortiClient } from '@corti/lib';
import { createUIMessageStreamResponse } from 'ai';

export async function POST(req: Request) {
  const { messages }: { messages: CortiUIMessage[] } = await req.json();

  // Optional: Define credentials for MCP servers
  const credentials: ExpertCredential[] = [
    {
      mcp_name: 'my-server',
      token: process.env.MCP_TOKEN,
      type: 'bearer' as const,
    },
  ];

  // Build A2A params from UI messages
  const params = convertToParams(messages, credentials);

  // Create A2A client factory and send message stream
  const corti = new CortiClient({ /* ... */ });
  const factory = createA2AClientFactory(corti);
  const agentUrl = await corti.agents.getCardUrl("your-agent-id");
  const client = factory.createFromUrl(agentUrl.toString(), '');
  const a2aStream = client.sendMessageStream(params);

  // Convert to UI stream with optional callbacks
  const uiStream = toUIMessageStream(a2aStream, {
    callbacks: {
      onStart: () => console.log('Stream started'),
      onEvent: (event) => console.log('Event:', event),
      onFinish: (state) => console.log('Final state:', state),
      onError: (error) => console.error('Error:', error),
    },
  });

  return createUIMessageStreamResponse({ stream: uiStream });
}
Client-Side (React with useChat)
import { useState } from 'react';
import { useChat } from 'ai/react';
import type { CortiUIMessage } from '@corti/ai-sdk-adapter';

export default function Chat() {
  const [input, setInput] = useState('');
  const { messages, sendMessage, status } = useChat<CortiUIMessage>({
    api: '/api/chat',
  });

  const handleSubmit = (e: React.FormEvent) => {
    e.preventDefault();
    if (!input.trim() || status === "streaming" || status === "submitted") return;
    sendMessage({ message: input });
    setInput('');
  };

  return (
    <div>
      {messages.map((m) => (
        <div key={m.id}>
          <strong>{m.role}:</strong>{' '}
          {m.parts.map(p => p.type === 'text' ? p.text : '').join(' ')}
        </div>
      ))}
      <form onSubmit={handleSubmit}>
        <input value={input} onChange={(e) => setInput(e.target.value)} />
        <button type="submit">Send</button>
      </form>
    </div>
  );
}

Types

CortiUIMessage

Custom UI message type that extends the standard UIMessage with A2A-specific metadata and data parts:

import type { CortiUIMessage } from '@corti/ai-sdk-adapter';

// CortiUIMessage includes:
// - metadata: contextId, taskId, history, credits, state
// - custom data parts: text with name, json with name/content, status-update
ExpertCredential

Credentials for authenticating with MCP servers:

type ExpertCredential =
  | {
      mcp_name: string;
      token: string;
      type: 'bearer';
    }
  | {
      mcp_name: string;
      client_id: string;
      client_secret: string;
      type: 'oauth2.0';
    };

How It Works

Context and Task Continuity

The adapter automatically manages conversation context and task continuity:

  • contextId: Maintains conversation context across multiple messages. Automatically inferred from the last assistant message.
  • taskId: Continues an existing task when the agent requires more input. Only included when the last assistant message has state: 'input-required'.
  • Credentials: Only sent on the first message (when no taskId is present).

The convertToParams() function handles all of this automatically - you just pass the messages array from useChat.

Stream Callbacks

The toUIMessageStream() function accepts a StreamConversionOptions object with optional callbacks to monitor stream progress:

const uiStream = toUIMessageStream(a2aStream, {
  callbacks: {
    onStart: () => {
      // Called when streaming begins
    },
    onEvent: (event) => {
      // Called on each new event from the stream
    },
    onFinish: (state) => {
      // Called when stream completes with the final task status
    },
    onError: (error: Error) => {
      // Called if an error occurs during streaming
    },
  },
});

Runtime Support

This package supports:

  • Node.js (18+)
  • Edge runtimes (Vercel Edge, Cloudflare Workers)

Limitations

  • No tool support: This adapter does not currently support AI SDK tools/function calling
  • A2A-specific: Only works with Corti's A2A agents, not general LLM providers

License

MIT

Links

Description from the npm listing.

  • ai
  • ai-sdk
  • vercel
  • corti
  • a2a
  • agents
  • llm
  • language-model

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@corti/ai-sdk-adapter weekly downloads on npm, last 90 days: 443 weekly downloads as of Oct 18, 2026, +208% over 90 days.@corti/ai-sdk-adapterWeekly downloads on npm · Last 90 days443downloads / week+208% over 90 days02004006008001K1.2K1.4KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
@corti/ai-sdk-adapter weekly downloads on npm, last 90 days: 443 weekly downloads as of Oct 18, 2026, +208% over 90 days.

7/30/90-day growth

@corti/ai-sdk-adapter weekly downloads growth on npm: -50.4% over 7 days, -36.6% over 30 days, +208% over 90 days.@corti/ai-sdk-adapterWeekly downloads growth on npm443downloads / week now7-day growth-451 weekly downloads-50.4%30-day growth-256 weekly downloads-36.6%90-day growth+299 weekly downloads+208%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@corti/ai-sdk-adapter weekly downloads growth on npm: -50.4% over 7 days, -36.6% over 30 days, +208% over 90 days.

Ranking history

@corti/ai-sdk-adapter npm ranking history: currently #1571 (by weekly downloads).@corti/ai-sdk-adapternpm ranking · by weekly downloads · Last 90 days#1571current rank#1500#1510#1520#1530#1540#1550#1560#1570#1580Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
@corti/ai-sdk-adapter npm ranking history: currently #1571 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 79, #15 (overall #1,575)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs259 listings · 13 pages · page 10, #3 (overall #183)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for @corti/ai-sdk-adapter
Date (UTC)Weekly downloadsChange vs. previous
443+15
428-61
489+63
426-356
782-256
1,0380
1,038+144
894+60
834+27
807-169
976+52
924+170
754-240
994—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@corti/ai-sdk-adapter. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.