MCPcopy
hub / github.com/TanStack/ai / readInitial

Method readInitial

packages/ai-client/src/client-persistor.ts:76–86  ·  view source on GitHub ↗

* Synchronously read the persisted messages for constructor-time hydration. * Returns the raw `getItem` result (which may be a promise for async stores).

()

Source from the content-addressed store, hash-verified

74 * Returns the raw `getItem` result (which may be a promise for async stores).
75 */
76 readInitial():
77 | Array<UIMessage>
78 | null
79 | undefined
80 | Promise<Array<UIMessage> | null | undefined> {
81 try {
82 return this.adapter.getItem(this.id)
83 } catch {
84 return undefined
85 }
86 }
87
88 /**
89 * Apply messages from an async `getItem` once it resolves, unless the message

Callers 2

constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected