@tanstack/ai-acp has 8,865 recorded weekly downloads on npm, an increase of 21.4% over the past 30 days, ranking #1320 of 3,247 tracked listings.
About @tanstack/ai-acp
@tanstack/ai-acp
Shared Agent Client Protocol (ACP) plumbing for TanStack AI harness adapters — the code that turns a coding-agent CLI (grok, gemini --acp, …) into a chat() backend inside a sandbox.
Most apps should use a harness package directly (@tanstack/ai-grok-build, …). Reach for @tanstack/ai-acp when:
- you want to plug an ACP agent that has no dedicated adapter package into a sandbox — use
acpCompatible(theopenaiCompatibleof harnesses), or - you are building or extending a harness adapter and need the transport, session, permission, and stream-translation layers in one place.
Installation
npm install @tanstack/ai-acp @tanstack/ai @tanstack/ai-sandbox
Peer dependencies: @tanstack/ai, @tanstack/ai-sandbox. The package also depends on @agentclientprotocol/sdk for the JSON-RPC client.
What it does
Harness CLIs that support ACP expose a long-lived JSON-RPC session. They stream session updates (text chunks, tool calls, planning, permissions) while the orchestrator drives the turn with prompt. TanStack AI speaks AG-UI StreamChunks (RUN_STARTED, TEXT_MESSAGE_CONTENT, TOOL_CALL_*, RUN_FINISHED, …).
@tanstack/ai-acp sits in the middle:
┌─────────────────┐ ACP JSON-RPC ┌──────────────────┐
│ Harness CLI │ ◄──────────────────► │ startAcpSession │
│ (in sandbox) │ stdio or WebSocket │ (ClientSide) │
└─────────────────┘ └────────┬─────────┘
│ session updates
▼
┌──────────────────┐
│ AsyncQueue │
│ translateAcpStream │
└────────┬─────────┘
│ StreamChunk
▼
┌──────────────────┐
│ chat() stream │
└──────────────────┘
Responsibilities split roughly as:
| Layer | Module | Role |
|---|---|---|
| Transport | transport/* | Bytes ↔ JSON-RPC: stdio (NDJSON) or WebSocket |
| Session | session/acp-client | initialize → authenticate → newSession / loadSession → prompt |
| Sandbox server | session/sandbox-server | Boot an in-sandbox serve process and connect over an exposed port |
| Translation | stream/translate | ACP sessionUpdate events → TanStack StreamChunks |
| Permissions | permissions | Map harness permission prompts to allow/reject (and optional approval ids) |
Plug in any ACP agent (acpCompatible)
acpCompatible is the easy path: it builds a chat() text adapter for any
ACP-compliant agent CLI without a dedicated package — the harness equivalent of
openaiCompatible. Configure the harness once, select a model per call, pass it
into a sandbox.
import { acpCompatible } from '@tanstack/ai-acp'
import { chat } from '@tanstack/ai'
import { defineSandbox, withSandbox } from '@tanstack/ai-sandbox'
import { dockerSandbox } from '@tanstack/ai-sandbox-docker'
// Configure the "pi" agent harness once (it speaks ACP over stdio):
const pi = acpCompatible({
name: 'pi',
models: ['pi-fast', 'pi-pro'], // optional — makes pi('…') type-safe
command: ({ model, harnessCwd }) =>
`pi --acp -m ${model} --cwd ${harnessCwd}`,
authMethodId: 'pi-api-key', // when the harness advertises it
refusalMessage: 'Pi refused the request.',
})
// Then drive it like any other adapter, inside a sandbox:
const stream = chat({
adapter: pi('pi-fast'),
messages: [
{ role: 'user', content: 'Add a health check route and run the tests.' },
],
threadId: 'thread-1',
middleware: [
withSandbox(
defineSandbox({
id: 'pi-demo',
provider: dockerSandbox({ image: 'node:22' }),
// …workspace: clone source, install the `pi` CLI, inject its API key
}),
),
],
})
You get the full ACP flow for free: sandbox resolution, chat()-tool → MCP
bridging, session resume (via modelOptions.sessionId), permission modes,
abort, and AG-UI translation.
Configuration…
Description from the npm listing.
- ai
- ai-sdk
- typescript
- tanstack
- acp
- agent-client-protocol
- harness
- sandbox
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (592)Similar npm AI SDKs plugins
All 20 @tanstack/ai-acp alternativesData 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/@tanstack/ai-acp. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.