Open History to see the last commit
1// Store contracts + named chat shapes
2export {
3 composePersistence,
4 defineAIPersistence,
5 defineMessageStore,
6 defineRunStore,
7 defineInterruptStore,
8 defineMetadataStore,
9 defineGenerationRunStore,
10 defineArtifactStore,
11 defineBlobStore,
12 // Run lifecycle helpers owned by @tanstack/ai, transiting through ./types so
13 // this package's public surface stays a single import for backend authors.
14 isTerminalRunStatus,
15} from './types'
16export type {
17 MessageStore,
18 MessagePage,
19 RunStatus,
20 TerminalRunStatus,
21 RunRecord,
22 RunStore,
23 InterruptCommitEntry,
24 InterruptRecord,
25 InterruptStatus,
26 InterruptStore,
27 MetadataStore,
28 // Named product shapes (prefer these over a sparse bag)
29 ChatTranscriptStores,
30 ChatPersistenceStores,
31 ChatWithInterruptsStores,
32 ChatTranscriptPersistence,
33 ChatPersistence,
34 ChatWithInterruptsPersistence,
35 // Generation run store contract
36 GenerationRunStatus,
37 GenerationRunRecord,
38 GenerationRunStore,
39 // Generation artifact + blob store contracts
40 ArtifactRecord,
41 ArtifactStore,
42 BlobBody,
43 BlobRecord,
44 BlobObject,
45 BlobListPage,
46 BlobPutOptions,
47 BlobGetOptions,
48 BlobRange,
49 BlobListOptions,
50 BlobStore,
51 AIPersistence,
52 AIPersistenceOverrides,
53 ComposedAIPersistenceStores,
54 // Shared conversation identity from @tanstack/ai. Stores key on
55 // Scope.threadId; authorize multi-user access with Scope.userId/tenantId.
56 Scope,
57} from './types'
58export type { PersistenceCompletion } from './capabilities'
59// AIPersistenceStores is intentionally NOT re-exported — use a named chat
60// shape or AIPersistence<{ messages: MessageStore, … }>.
61
62// Core artifact wire types (re-exported for convenience)
63export type {
64 PersistedArtifactActivity,
65 PersistedArtifactRef,
66 PersistedArtifactRole,
67} from '@tanstack/ai'
68
69// Middleware (chat state — locks live in @tanstack/ai as withLocks)
70export { withPersistence, withGenerationPersistence } from './middleware'
71export type {
72 WithPersistenceOptions,
73 WithGenerationPersistenceOptions,
74 ArtifactPersistenceOptions,
75 GenerationArtifactDescriptor,
76 GenerationArtifactExtractionInput,
77 GenerationArtifactNameInput,
78} from './middleware'
79
80// Server helper: rehydrate a thread's messages for a client load
81export { reconstructChat } from './reconstruct'
82export type { ReconstructChatOptions } from './reconstruct'
83
84// Server helper: rehydrate the last generation job for a client load
85export {
86 reconstructGeneration,
87 getGenerationHydration,
88} from './reconstruct-generation'
89export type {
90 ReconstructedGeneration,
91 ReconstructGenerationOptions,
92 GetGenerationHydrationOptions,
93} from './reconstruct-generation'
94
95// Server helpers: retrieve a persisted generation artifact + its bytes
96export {
97 retrieveArtifact,
98 retrieveBlob,
99 resolveArtifactBlobKey,
100} from './retrieve'
101
102// Byte-range helpers: parse a `Range` header (routes), clamp a range to an
103// object's real size (store authors)
104export { parseRangeHeader, resolveBlobRange } from './blob-range'
105
106// Reference in-memory implementation
107export { memoryPersistence } from './memory'
108
109// Persistence-owned capabilities only. Locks: @tanstack/ai.
110export {
111 PersistenceCapability,
112 InterruptsCapability,
113 getPersistence,
114 providePersistence,
115 getInterrupts,
116 provideInterrupts,
117 PersistenceCompletionCapability,
118 getPersistenceCompletion,
119 providePersistenceCompletion,
120} from './capabilities'