@tanstack/ai-client 0.22.1 → 0.23.1
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 +15 -1
- package/dist/esm/audio-recorder.js +190 -213
- package/dist/esm/audio-recorder.js.map +1 -1
- package/dist/esm/chat-client.d.ts +172 -3
- package/dist/esm/chat-client.js +1656 -1386
- package/dist/esm/chat-client.js.map +1 -1
- package/dist/esm/cleared-stream-tracker.d.ts +23 -0
- package/dist/esm/cleared-stream-tracker.js +97 -0
- package/dist/esm/cleared-stream-tracker.js.map +1 -0
- package/dist/esm/client-persistor.d.ts +25 -12
- package/dist/esm/client-persistor.js +260 -235
- package/dist/esm/client-persistor.js.map +1 -1
- package/dist/esm/connection-adapters.d.ts +231 -10
- package/dist/esm/connection-adapters.js +989 -574
- package/dist/esm/connection-adapters.js.map +1 -1
- package/dist/esm/devtools-noop.d.ts +1 -0
- package/dist/esm/devtools-noop.js +79 -139
- package/dist/esm/devtools-noop.js.map +1 -1
- package/dist/esm/devtools.d.ts +31 -1
- package/dist/esm/devtools.js +977 -1127
- package/dist/esm/devtools.js.map +1 -1
- package/dist/esm/events.js +224 -226
- package/dist/esm/events.js.map +1 -1
- package/dist/esm/generation-client.d.ts +145 -2
- package/dist/esm/generation-client.js +659 -321
- package/dist/esm/generation-client.js.map +1 -1
- package/dist/esm/generation-reconstruct.d.ts +21 -0
- package/dist/esm/generation-reconstruct.js +85 -0
- package/dist/esm/generation-reconstruct.js.map +1 -0
- package/dist/esm/generation-types.d.ts +289 -3
- package/dist/esm/generation-types.js +356 -13
- package/dist/esm/generation-types.js.map +1 -1
- package/dist/esm/index.d.ts +9 -4
- package/dist/esm/index.js +7 -39
- package/dist/esm/interrupt-manager.d.ts +77 -0
- package/dist/esm/interrupt-manager.js +787 -0
- package/dist/esm/interrupt-manager.js.map +1 -0
- package/dist/esm/mcp-app-bridge.js +56 -64
- package/dist/esm/mcp-app-bridge.js.map +1 -1
- package/dist/esm/realtime-client.js +366 -440
- package/dist/esm/realtime-client.js.map +1 -1
- package/dist/esm/response-stream.js +19 -26
- package/dist/esm/response-stream.js.map +1 -1
- package/dist/esm/sse-parser.js +44 -47
- package/dist/esm/sse-parser.js.map +1 -1
- package/dist/esm/sse-utils.js +8 -9
- package/dist/esm/sse-utils.js.map +1 -1
- package/dist/esm/storage-adapters.d.ts +62 -0
- package/dist/esm/storage-adapters.js +174 -0
- package/dist/esm/storage-adapters.js.map +1 -0
- package/dist/esm/types.d.ts +212 -10
- package/dist/esm/types.js +38 -7
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/video-generation-client.d.ts +113 -2
- package/dist/esm/video-generation-client.js +665 -379
- package/dist/esm/video-generation-client.js.map +1 -1
- package/package.json +7 -7
- package/src/chat-client.ts +1079 -61
- package/src/cleared-stream-tracker.ts +151 -0
- package/src/client-persistor.ts +102 -33
- package/src/connection-adapters.ts +1185 -142
- package/src/devtools-noop.ts +4 -3
- package/src/devtools.ts +121 -3
- package/src/generation-client.ts +563 -13
- package/src/generation-reconstruct.ts +121 -0
- package/src/generation-types.ts +727 -3
- package/src/index.ts +56 -1
- package/src/interrupt-manager.ts +1440 -0
- package/src/storage-adapters.ts +242 -0
- package/src/types.ts +301 -9
- package/src/video-generation-client.ts +479 -13
- package/dist/esm/index.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -6,6 +6,12 @@ export type {
|
|
|
6
6
|
InferAudioRecordingOutput,
|
|
7
7
|
} from './audio-recorder'
|
|
8
8
|
export { ChatClient } from './chat-client'
|
|
9
|
+
export { InterruptManager } from './interrupt-manager'
|
|
10
|
+
export type {
|
|
11
|
+
InterruptManagerHydration,
|
|
12
|
+
InterruptManagerOptions,
|
|
13
|
+
InterruptManagerSubmission,
|
|
14
|
+
} from './interrupt-manager'
|
|
9
15
|
export { createMcpAppBridge } from './mcp-app-bridge'
|
|
10
16
|
export type { McpAppBridge, CreateMcpAppBridgeOptions } from './mcp-app-bridge'
|
|
11
17
|
export { RealtimeClient } from './realtime-client'
|
|
@@ -22,8 +28,21 @@ export type {
|
|
|
22
28
|
StructuredOutputPart,
|
|
23
29
|
// Client configuration types
|
|
24
30
|
ChatClientPersistence,
|
|
31
|
+
ChatPersistedState,
|
|
32
|
+
ChatPersistenceOption,
|
|
33
|
+
ChatStorageAdapter,
|
|
25
34
|
ChatClientOptions,
|
|
35
|
+
ChatPendingInterrupt,
|
|
36
|
+
BoundInterruptBase,
|
|
37
|
+
BoundInterrupts,
|
|
38
|
+
ChatInterrupt,
|
|
39
|
+
ChatInterruptState,
|
|
40
|
+
GenericAGUIInterrupt,
|
|
41
|
+
UnboundInterrupt,
|
|
42
|
+
InterruptItemStatus,
|
|
43
|
+
ToolApprovalInterrupt,
|
|
26
44
|
ClientContextOptionFromTools,
|
|
45
|
+
ChatResumeState,
|
|
27
46
|
ChatRequestBody,
|
|
28
47
|
InferChatMessages,
|
|
29
48
|
InferredClientContext,
|
|
@@ -48,6 +67,7 @@ export type {
|
|
|
48
67
|
InferGenerationOutput,
|
|
49
68
|
InferGenerationOutputFromReturn,
|
|
50
69
|
GenerationClientState,
|
|
70
|
+
GenerationPersistenceOptions,
|
|
51
71
|
GenerationClientOptions,
|
|
52
72
|
GenerationFetcher,
|
|
53
73
|
GenerationFetcherOptions,
|
|
@@ -61,10 +81,31 @@ export type {
|
|
|
61
81
|
TranscriptionGenerateInput,
|
|
62
82
|
SummarizeGenerateInput,
|
|
63
83
|
VideoGenerateInput,
|
|
84
|
+
GenerationRestoredResult,
|
|
64
85
|
} from './generation-types'
|
|
65
86
|
export { GENERATION_EVENTS } from './generation-types'
|
|
87
|
+
// Per-activity result reconstruction mappers (used by the framework hooks to
|
|
88
|
+
// repaint a typed `result` on restore)
|
|
89
|
+
export {
|
|
90
|
+
reconstructImageResult,
|
|
91
|
+
reconstructAudioResult,
|
|
92
|
+
reconstructSpeechResult,
|
|
93
|
+
reconstructTranscriptionResult,
|
|
94
|
+
reconstructSummarizeResult,
|
|
95
|
+
} from './generation-reconstruct'
|
|
66
96
|
export { UnsupportedResponseStreamError } from './response-stream'
|
|
67
97
|
export { clientTools, createChatClientOptions } from './types'
|
|
98
|
+
// Web storage adapters for durable chat persistence (messages + resume snapshot)
|
|
99
|
+
export {
|
|
100
|
+
localStoragePersistence,
|
|
101
|
+
sessionStoragePersistence,
|
|
102
|
+
indexedDBPersistence,
|
|
103
|
+
StorageUnavailableError,
|
|
104
|
+
} from './storage-adapters'
|
|
105
|
+
export type {
|
|
106
|
+
WebStoragePersistenceOptions,
|
|
107
|
+
IndexedDBPersistenceOptions,
|
|
108
|
+
} from './storage-adapters'
|
|
68
109
|
export {
|
|
69
110
|
createAIDevtoolsGenerationPreview,
|
|
70
111
|
type AIDevtoolsClientMetadata,
|
|
@@ -79,7 +120,15 @@ export type {
|
|
|
79
120
|
ExtractToolInput,
|
|
80
121
|
ExtractToolOutput,
|
|
81
122
|
} from './tool-types'
|
|
82
|
-
export type {
|
|
123
|
+
export type {
|
|
124
|
+
AnyClientTool,
|
|
125
|
+
Interrupt,
|
|
126
|
+
PersistedArtifactActivity,
|
|
127
|
+
PersistedArtifactRef,
|
|
128
|
+
PersistedArtifactRole,
|
|
129
|
+
RunAgentResumeItem,
|
|
130
|
+
RunFinishedOutcome,
|
|
131
|
+
} from '@tanstack/ai/client'
|
|
83
132
|
export type {
|
|
84
133
|
RealtimeAdapter,
|
|
85
134
|
RealtimeConnection,
|
|
@@ -95,10 +144,16 @@ export {
|
|
|
95
144
|
stream,
|
|
96
145
|
rpcStream,
|
|
97
146
|
StreamTruncatedError,
|
|
147
|
+
DurableStreamIncompleteError,
|
|
148
|
+
StreamReconnectLimitError,
|
|
98
149
|
type ConnectConnectionAdapter,
|
|
99
150
|
type ConnectionAdapter,
|
|
151
|
+
type GenerationHydrationResult,
|
|
100
152
|
type FetchConnectionOptions,
|
|
153
|
+
type ReconnectOptions,
|
|
154
|
+
type ResumableConnectConnectionAdapter,
|
|
101
155
|
type RunAgentInputContext,
|
|
156
|
+
type StreamConnectionHandlers,
|
|
102
157
|
type SubscribeConnectionAdapter,
|
|
103
158
|
type XhrConnectionOptions,
|
|
104
159
|
} from './connection-adapters'
|