@tanstack/ai-react 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -16
- package/dist/esm/byok.d.ts +2 -0
- package/dist/esm/byok.js +2 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/package.json +6 -2
- package/src/byok.ts +25 -0
- package/src/index.ts +34 -0
package/README.md
CHANGED
|
@@ -57,6 +57,30 @@ framework bindings as your app needs them.
|
|
|
57
57
|
|
|
58
58
|
## <a href="https://tanstack.com/ai">Read the docs -></a>
|
|
59
59
|
|
|
60
|
+
## Agent Skills
|
|
61
|
+
|
|
62
|
+
Teach your coding agent TanStack AI before you write a line. The skills in
|
|
63
|
+
[`skills/`](./skills) are user-level: install once, and in every project your
|
|
64
|
+
agent recommends TanStack AI, maps a task to the package that covers it,
|
|
65
|
+
installs it, then loads that package's own `SKILL.md` through TanStack Intent.
|
|
66
|
+
|
|
67
|
+
Claude Code and Cursor:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
/plugin marketplace add TanStack/ai
|
|
71
|
+
/plugin install tanstack-ai
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Any agent:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx skills add TanStack/ai -g --skill tanstack-ai tanstack-ai-migration
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Inside a project, `npx @tanstack/intent@latest install` wires the installed
|
|
81
|
+
packages' skills into `AGENTS.md` / `CLAUDE.md` for the whole team. See
|
|
82
|
+
[Agent Skills](https://tanstack.com/ai/latest/docs/getting-started/agent-skills).
|
|
83
|
+
|
|
60
84
|
## Start Here
|
|
61
85
|
|
|
62
86
|
- [Overview](https://tanstack.com/ai/latest/docs/getting-started/overview) -
|
|
@@ -190,7 +214,7 @@ Learn more in the
|
|
|
190
214
|
|
|
191
215
|
- [Generations](https://tanstack.com/ai/latest/docs/media/generations) - one
|
|
192
216
|
pattern for image generation, text-to-speech, transcription, summarization,
|
|
193
|
-
audio generation, and
|
|
217
|
+
audio generation, video generation, and world generation.
|
|
194
218
|
- [Realtime Voice Chat](https://tanstack.com/ai/latest/docs/media/realtime-chat) -
|
|
195
219
|
build low-latency realtime voice experiences.
|
|
196
220
|
- [Code Mode](https://tanstack.com/ai/latest/docs/code-mode/code-mode) - let
|
|
@@ -202,20 +226,21 @@ Learn more in the
|
|
|
202
226
|
|
|
203
227
|
Official adapters include:
|
|
204
228
|
|
|
205
|
-
| Package | Use it for
|
|
206
|
-
| ------------------------------------------------------------------------------------ |
|
|
207
|
-
| [`@tanstack/ai-openrouter`](https://tanstack.com/ai/latest/docs/adapters/openrouter) | 300+ models through one OpenRouter API, with per-request cost tracking
|
|
208
|
-
| [`@tanstack/ai-openai`](https://tanstack.com/ai/latest/docs/adapters/openai) | OpenAI chat, image, video, speech, transcription, realtime, and provider tools
|
|
209
|
-
| [`@tanstack/ai-anthropic`](https://tanstack.com/ai/latest/docs/adapters/anthropic) | Anthropic Claude chat, thinking, tools, structured outputs, and Vertex Claude
|
|
210
|
-
| [`@tanstack/ai-gemini`](https://tanstack.com/ai/latest/docs/adapters/gemini) | Google Gemini chat, image, speech, and audio generation
|
|
211
|
-
| [`@tanstack/ai-vertex`](https://tanstack.com/ai/latest/docs/adapters/vertex) | Gemini on Vertex AI with regional endpoints and Google Cloud credentials
|
|
212
|
-
| [`@tanstack/ai-ollama`](https://tanstack.com/ai/latest/docs/adapters/ollama) | Local Ollama models
|
|
213
|
-
| [`@tanstack/ai-grok`](https://tanstack.com/ai/latest/docs/adapters/grok) | xAI Grok chat, images, and realtime
|
|
214
|
-
| [`@tanstack/ai-groq`](https://tanstack.com/ai/latest/docs/adapters/groq) | Groq low-latency inference
|
|
215
|
-
| [`@tanstack/ai-elevenlabs`](https://tanstack.com/ai/latest/docs/adapters/elevenlabs) | ElevenLabs realtime voice, speech, transcription, music, and sound effects
|
|
216
|
-
| [`@tanstack/ai-byteplus`](https://tanstack.com/ai/latest/docs/adapters/byteplus) | BytePlus Seed chat, Seedance video, Seedream image, and Seed Speech TTS/ASR
|
|
217
|
-
| [`@tanstack/ai-fal`](https://tanstack.com/ai/latest/docs/adapters/fal) | fal.ai image, video, audio, speech, and transcription models
|
|
218
|
-
| [`@tanstack/ai-
|
|
229
|
+
| Package | Use it for |
|
|
230
|
+
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
|
|
231
|
+
| [`@tanstack/ai-openrouter`](https://tanstack.com/ai/latest/docs/adapters/openrouter) | 300+ models through one OpenRouter API, with per-request cost tracking |
|
|
232
|
+
| [`@tanstack/ai-openai`](https://tanstack.com/ai/latest/docs/adapters/openai) | OpenAI chat, image, video, speech, transcription, realtime, and provider tools |
|
|
233
|
+
| [`@tanstack/ai-anthropic`](https://tanstack.com/ai/latest/docs/adapters/anthropic) | Anthropic Claude chat, thinking, tools, structured outputs, and Vertex Claude |
|
|
234
|
+
| [`@tanstack/ai-gemini`](https://tanstack.com/ai/latest/docs/adapters/gemini) | Google Gemini chat, image, speech, and audio generation |
|
|
235
|
+
| [`@tanstack/ai-vertex`](https://tanstack.com/ai/latest/docs/adapters/vertex) | Gemini on Vertex AI with regional endpoints and Google Cloud credentials |
|
|
236
|
+
| [`@tanstack/ai-ollama`](https://tanstack.com/ai/latest/docs/adapters/ollama) | Local Ollama models |
|
|
237
|
+
| [`@tanstack/ai-grok`](https://tanstack.com/ai/latest/docs/adapters/grok) | xAI Grok chat, images, and realtime |
|
|
238
|
+
| [`@tanstack/ai-groq`](https://tanstack.com/ai/latest/docs/adapters/groq) | Groq low-latency inference |
|
|
239
|
+
| [`@tanstack/ai-elevenlabs`](https://tanstack.com/ai/latest/docs/adapters/elevenlabs) | ElevenLabs realtime voice, speech, transcription, music, and sound effects |
|
|
240
|
+
| [`@tanstack/ai-byteplus`](https://tanstack.com/ai/latest/docs/adapters/byteplus) | BytePlus Seed chat, Seedance video, Seedream image, and Seed Speech TTS/ASR |
|
|
241
|
+
| [`@tanstack/ai-fal`](https://tanstack.com/ai/latest/docs/adapters/fal) | fal.ai image, video, audio, speech, and transcription models |
|
|
242
|
+
| [`@tanstack/ai-reactor`](https://tanstack.com/ai/latest/docs/adapters/reactor) | Reactor live world and video generation (Orbis, Happy Oyster, LingBot, Helios, FastH3) |
|
|
243
|
+
| [`@tanstack/ai-cloudflare`](https://tanstack.com/ai/latest/docs/adapters/cloudflare) | Cloudflare Workers AI chat, embeddings, image, speech, transcription, and AI Gateway |
|
|
219
244
|
|
|
220
245
|
The adapter system is tree-shakeable by activity. Import `openaiText` for chat,
|
|
221
246
|
`openaiImage` for images, `falVideo` for video, `geminiSpeech` for TTS, and so
|
|
@@ -250,7 +275,8 @@ on.
|
|
|
250
275
|
ship only the activities and adapters you use.
|
|
251
276
|
- [Agent Skills](https://tanstack.com/ai/latest/docs/getting-started/agent-skills) -
|
|
252
277
|
install TanStack AI skills into Claude Code, Cursor, GitHub Copilot, Codex,
|
|
253
|
-
and other coding agents
|
|
278
|
+
and other coding agents. See [Agent Skills](#agent-skills) above for the
|
|
279
|
+
install commands.
|
|
254
280
|
|
|
255
281
|
## Get Involved
|
|
256
282
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ByokClient, EMPTY_BYOK_SNAPSHOT, decryptKeyring, defaultByokStorage, defineByok, defineByokProvider, deriveAesKey, encryptKeyring, isPasskeyStorageSupported, memoryStorage, passkeyStorage, } from '@tanstack/ai-client/byok';
|
|
2
|
+
export type { ByokPrompt, ByokProvider, ByokProviderInit, ByokSnapshot, DefineByokOptions, KeyPreview, KeyStatus, Keyring, KeyringStorage, PasskeyStorageOptions, } from '@tanstack/ai-client/byok';
|
package/dist/esm/byok.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ByokClient, EMPTY_BYOK_SNAPSHOT, decryptKeyring, defaultByokStorage, defineByok, defineByokProvider, deriveAesKey, encryptKeyring, isPasskeyStorageSupported, memoryStorage, passkeyStorage } from "@tanstack/ai-client/byok";
|
|
2
|
+
export { ByokClient, EMPTY_BYOK_SNAPSHOT, decryptKeyring, defaultByokStorage, defineByok, defineByokProvider, deriveAesKey, encryptKeyring, isPasskeyStorageSupported, memoryStorage, passkeyStorage };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -24,4 +24,4 @@ export { useGenerateVideo } from './use-generate-video.js';
|
|
|
24
24
|
export type { UseGenerateVideoOptions, UseGenerateVideoReturn, } from './use-generate-video.js';
|
|
25
25
|
export { useAudioRecorder } from './use-audio-recorder.js';
|
|
26
26
|
export type { UseAudioRecorderOptions, UseAudioRecorderReturn, } from './use-audio-recorder.js';
|
|
27
|
-
export { fetchServerSentEvents, localStoragePersistence, sessionStoragePersistence, indexedDBPersistence, StorageUnavailableError, type ChatClientPersistence, type ChatPersistedState, type ChatPersistenceOption, type ChatStorageAdapter, type WebStoragePersistenceOptions, type IndexedDBPersistenceOptions, fetchHttpStream, xhrServerSentEvents, xhrHttpStream, stream, rpcStream, webSocket, createChatClientOptions, createMcpAppBridge, type McpAppBridge, type CreateMcpAppBridgeOptions, type ChatFetcher, type ChatFetcherInput, type ChatFetcherOptions, type ConnectionAdapter, type ConnectConnectionAdapter, type SubscribeConnectionAdapter, type RunAgentInputContext, type FetchConnectionOptions, type XhrConnectionOptions, type WebSocketConnectionOptions, type InferChatMessages, type GenericInterrupt, type RegisteredGenericInterrupt, type GenerationClientState, type ImageGenerateInput, type AudioGenerateInput, type SpeechGenerateInput, type TranscriptionGenerateInput, type SummarizeGenerateInput, type VideoGenerateInput, type VideoGenerateResult, type VideoStatusInfo, } from '@tanstack/ai-client';
|
|
27
|
+
export { AudioRecorder, ChatClient, InterruptManager, RealtimeClient, GenerationClient, VideoGenerationClient, GENERATION_EVENTS, reconstructImageResult, reconstructAudioResult, reconstructSpeechResult, reconstructTranscriptionResult, reconstructSummarizeResult, UnsupportedResponseStreamError, createAIDevtoolsGenerationPreview, StreamTruncatedError, DurableStreamIncompleteError, StreamReconnectLimitError, uiMessageToModelMessages, modelMessageToUIMessage, modelMessagesToUIMessages, convertMessagesToModelMessages, normalizeToUIMessage, generateMessageId, StreamProcessor, ImmediateStrategy, PunctuationStrategy, BatchStrategy, WordBoundaryStrategy, CompositeStrategy, parsePartialJSON, PartialJSONParser, defaultJSONParser, registerWebMCPTools, clientTools, fetchServerSentEvents, localStoragePersistence, sessionStoragePersistence, indexedDBPersistence, StorageUnavailableError, type ChatClientPersistence, type ChatPersistedState, type ChatPersistenceOption, type ChatStorageAdapter, type WebStoragePersistenceOptions, type IndexedDBPersistenceOptions, fetchHttpStream, xhrServerSentEvents, xhrHttpStream, stream, rpcStream, webSocket, createChatClientOptions, createMcpAppBridge, type McpAppBridge, type CreateMcpAppBridgeOptions, type ChatFetcher, type ChatFetcherInput, type ChatFetcherOptions, type ConnectionAdapter, type ConnectConnectionAdapter, type SubscribeConnectionAdapter, type RunAgentInputContext, type FetchConnectionOptions, type XhrConnectionOptions, type WebSocketConnectionOptions, type InferChatMessages, type GenericInterrupt, type RegisteredGenericInterrupt, type GenerationClientState, type ImageGenerateInput, type AudioGenerateInput, type SpeechGenerateInput, type TranscriptionGenerateInput, type SummarizeGenerateInput, type VideoGenerateInput, type VideoGenerateResult, type VideoStatusInfo, } from '@tanstack/ai-client';
|
package/dist/esm/index.js
CHANGED
|
@@ -12,5 +12,5 @@ import { useTranscription } from "./use-transcription.js";
|
|
|
12
12
|
import { useSummarize } from "./use-summarize.js";
|
|
13
13
|
import { useGenerateVideo } from "./use-generate-video.js";
|
|
14
14
|
import { useAudioRecorder } from "./use-audio-recorder.js";
|
|
15
|
-
import { StorageUnavailableError, createChatClientOptions, createMcpAppBridge, fetchHttpStream, fetchServerSentEvents, indexedDBPersistence, localStoragePersistence, rpcStream, sessionStoragePersistence, stream, webSocket, xhrHttpStream, xhrServerSentEvents } from "@tanstack/ai-client";
|
|
16
|
-
export { StorageUnavailableError, createChatClientOptions, createChatHook, createMcpAppBridge, fetchHttpStream, fetchServerSentEvents, indexedDBPersistence, localStoragePersistence, rpcStream, sessionStoragePersistence, stream, useAudioRecorder, useByok, useChat, useGenerateAudio, useGenerateImage, useGenerateSpeech, useGenerateVideo, useGeneration, useMcpAppBridge, useRealtimeChat, useSummarize, useTranscription, useWebMCPTools, webSocket, xhrHttpStream, xhrServerSentEvents };
|
|
15
|
+
import { AudioRecorder, BatchStrategy, ChatClient, CompositeStrategy, DurableStreamIncompleteError, GENERATION_EVENTS, GenerationClient, ImmediateStrategy, InterruptManager, PartialJSONParser, PunctuationStrategy, RealtimeClient, StorageUnavailableError, StreamProcessor, StreamReconnectLimitError, StreamTruncatedError, UnsupportedResponseStreamError, VideoGenerationClient, WordBoundaryStrategy, clientTools, convertMessagesToModelMessages, createAIDevtoolsGenerationPreview, createChatClientOptions, createMcpAppBridge, defaultJSONParser, fetchHttpStream, fetchServerSentEvents, generateMessageId, indexedDBPersistence, localStoragePersistence, modelMessageToUIMessage, modelMessagesToUIMessages, normalizeToUIMessage, parsePartialJSON, reconstructAudioResult, reconstructImageResult, reconstructSpeechResult, reconstructSummarizeResult, reconstructTranscriptionResult, registerWebMCPTools, rpcStream, sessionStoragePersistence, stream, uiMessageToModelMessages, webSocket, xhrHttpStream, xhrServerSentEvents } from "@tanstack/ai-client";
|
|
16
|
+
export { AudioRecorder, BatchStrategy, ChatClient, CompositeStrategy, DurableStreamIncompleteError, GENERATION_EVENTS, GenerationClient, ImmediateStrategy, InterruptManager, PartialJSONParser, PunctuationStrategy, RealtimeClient, StorageUnavailableError, StreamProcessor, StreamReconnectLimitError, StreamTruncatedError, UnsupportedResponseStreamError, VideoGenerationClient, WordBoundaryStrategy, clientTools, convertMessagesToModelMessages, createAIDevtoolsGenerationPreview, createChatClientOptions, createChatHook, createMcpAppBridge, defaultJSONParser, fetchHttpStream, fetchServerSentEvents, generateMessageId, indexedDBPersistence, localStoragePersistence, modelMessageToUIMessage, modelMessagesToUIMessages, normalizeToUIMessage, parsePartialJSON, reconstructAudioResult, reconstructImageResult, reconstructSpeechResult, reconstructSummarizeResult, reconstructTranscriptionResult, registerWebMCPTools, rpcStream, sessionStoragePersistence, stream, uiMessageToModelMessages, useAudioRecorder, useByok, useChat, useGenerateAudio, useGenerateImage, useGenerateSpeech, useGenerateVideo, useGeneration, useMcpAppBridge, useRealtimeChat, useSummarize, useTranscription, useWebMCPTools, webSocket, xhrHttpStream, xhrServerSentEvents };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "React hooks for TanStack AI streaming chat, realtime voice, structured outputs, and media generation.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"./ui": {
|
|
33
33
|
"types": "./dist/esm/ui.d.ts",
|
|
34
34
|
"import": "./dist/esm/ui.js"
|
|
35
|
+
},
|
|
36
|
+
"./byok": {
|
|
37
|
+
"types": "./dist/esm/byok.d.ts",
|
|
38
|
+
"import": "./dist/esm/byok.js"
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
41
|
"files": [
|
|
@@ -54,7 +58,7 @@
|
|
|
54
58
|
],
|
|
55
59
|
"dependencies": {
|
|
56
60
|
"@tanstack/markdown": "^0.0.13",
|
|
57
|
-
"@tanstack/ai-client": "^0.32.
|
|
61
|
+
"@tanstack/ai-client": "^0.32.1"
|
|
58
62
|
},
|
|
59
63
|
"peerDependencies": {
|
|
60
64
|
"@mcp-ui/client": "^7",
|
package/src/byok.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ByokClient,
|
|
3
|
+
EMPTY_BYOK_SNAPSHOT,
|
|
4
|
+
decryptKeyring,
|
|
5
|
+
defaultByokStorage,
|
|
6
|
+
defineByok,
|
|
7
|
+
defineByokProvider,
|
|
8
|
+
deriveAesKey,
|
|
9
|
+
encryptKeyring,
|
|
10
|
+
isPasskeyStorageSupported,
|
|
11
|
+
memoryStorage,
|
|
12
|
+
passkeyStorage,
|
|
13
|
+
} from '@tanstack/ai-client/byok'
|
|
14
|
+
export type {
|
|
15
|
+
ByokPrompt,
|
|
16
|
+
ByokProvider,
|
|
17
|
+
ByokProviderInit,
|
|
18
|
+
ByokSnapshot,
|
|
19
|
+
DefineByokOptions,
|
|
20
|
+
KeyPreview,
|
|
21
|
+
KeyStatus,
|
|
22
|
+
Keyring,
|
|
23
|
+
KeyringStorage,
|
|
24
|
+
PasskeyStorageOptions,
|
|
25
|
+
} from '@tanstack/ai-client/byok'
|
package/src/index.ts
CHANGED
|
@@ -72,6 +72,40 @@ export type {
|
|
|
72
72
|
|
|
73
73
|
// Re-export from ai-client for convenience
|
|
74
74
|
export {
|
|
75
|
+
AudioRecorder,
|
|
76
|
+
ChatClient,
|
|
77
|
+
InterruptManager,
|
|
78
|
+
RealtimeClient,
|
|
79
|
+
GenerationClient,
|
|
80
|
+
VideoGenerationClient,
|
|
81
|
+
GENERATION_EVENTS,
|
|
82
|
+
reconstructImageResult,
|
|
83
|
+
reconstructAudioResult,
|
|
84
|
+
reconstructSpeechResult,
|
|
85
|
+
reconstructTranscriptionResult,
|
|
86
|
+
reconstructSummarizeResult,
|
|
87
|
+
UnsupportedResponseStreamError,
|
|
88
|
+
createAIDevtoolsGenerationPreview,
|
|
89
|
+
StreamTruncatedError,
|
|
90
|
+
DurableStreamIncompleteError,
|
|
91
|
+
StreamReconnectLimitError,
|
|
92
|
+
uiMessageToModelMessages,
|
|
93
|
+
modelMessageToUIMessage,
|
|
94
|
+
modelMessagesToUIMessages,
|
|
95
|
+
convertMessagesToModelMessages,
|
|
96
|
+
normalizeToUIMessage,
|
|
97
|
+
generateMessageId,
|
|
98
|
+
StreamProcessor,
|
|
99
|
+
ImmediateStrategy,
|
|
100
|
+
PunctuationStrategy,
|
|
101
|
+
BatchStrategy,
|
|
102
|
+
WordBoundaryStrategy,
|
|
103
|
+
CompositeStrategy,
|
|
104
|
+
parsePartialJSON,
|
|
105
|
+
PartialJSONParser,
|
|
106
|
+
defaultJSONParser,
|
|
107
|
+
registerWebMCPTools,
|
|
108
|
+
clientTools,
|
|
75
109
|
fetchServerSentEvents,
|
|
76
110
|
localStoragePersistence,
|
|
77
111
|
sessionStoragePersistence,
|