Skip to main content

Documentation Index

Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

veryfront/chat

Chat UI components and streaming hooks.

Import

import {
  Chat,
  useChat,
  useAgent,
  AgentCard,
  Message,
  buildChatStreamChunkMessageMetadata,
} from "veryfront/chat";

Examples

Basic chat (preset)

import { Chat, useChat } from "veryfront/chat";

export default function Page() {
  const chat = useChat({ api: "/api/ag-ui" });
  return (
    <Chat
      messages={chat.messages}
      input={chat.input}
      onChange={chat.handleInputChange}
      onSubmit={chat.handleSubmit}
    />
  );
}

Custom layout (composition)

import { Chat, useChat } from "veryfront/chat";

export default function Page() {
  const chat = useChat({ api: "/api/ag-ui" });
  return (
    <Chat.Root messages={chat.messages} input={chat.input}>
      <Chat.Empty title="Ask me anything" />
      <Chat.MessageList messages={chat.messages} />
      <Chat.Composer input={chat.input} onChange={chat.handleInputChange} onSubmit={chat.handleSubmit} />
    </Chat.Root>
  );
}

Per-message control (compound)

import { Message } from "veryfront/chat";

<Message.Root message={msg}>
  <Message.Avatar />
  <Message.Content />
  <Message.Actions />
</Message.Root>

Type Reference

UseChatOptions

Options accepted by use chat.
PropertyTypeDescriptionSource
apistringChat API endpoint URLsource
transport?"ag-ui"Streaming response protocol used by the endpoint. AG-UI is the default.source
initialMessages?ChatMessage[]Pre-populated messagessource
body?Record<string, unknown>Extra body fields sent with each requestsource
headers?Record<string, string>Custom request headerssource
credentials?RequestCredentialsFetch credentials modesource
model?stringOverride model at runtime (e.g. “openai/gpt-4o”, “Anthropic/claude-sonnet-4-5-20250929”)source
systemPrompt?stringSystem prompt for browser-side inference (server uses agent config)source
browserFallback?booleanEnable/disable browser fallback when server can’t provide a runtime. Default: truesource
onResponse?(response: Response) => voidRaw response callbacksource
onFinish?(message: ChatMessage) => voidCompletion callbacksource
onError?(error: Error) => voidError callbacksource
onToolCall?(arg: OnToolCallArg) => void | Promise<void>Tool call handler for client-side executionsource

UseChatResult

Result returned from use chat.
PropertyTypeDescriptionSource
messagesChatMessage[]All messages in the conversationsource
inputstringCurrent input valuesource
isLoadingbooleanWhether a request is in flightsource
errorError | nullLast error (if any)source
modelstring | undefinedCurrent model override (undefined = use agent default)source
activeModelstring | undefinedThe actual model being used after auto-upgrade (e.g. “Anthropic/claude-sonnet-4-20250514”)source
inferenceModeInferenceModeWhere inference is currently happeningsource
browserStatusBrowserInferenceStatus | nullBrowser-side model loading/inference status (null when not using browser fallback)source
setInput(input: string) => voidSet input valuesource
setModel(model: string | undefined) => voidChange the model for subsequent requestssource
sendMessage(message: { text: string }) => Promise<void>Send a message programmaticallysource
editMessage(messageId: string, newText: string) => Promise<void>Edit a user message and resubmit - truncates history to that pointsource
getBranches(messageId: string) => BranchInfoGet branch info for a message (returns ; total=1 if no branches)source
switchBranch(messageId: string, branchIndex: number) => voidSwitch to a different branch at a given messagesource
reload() => Promise<void>Re-send last user messagesource
stop() => voidAbort current requestsource
setMessages(messages: ChatMessage[]) => voidReplace message historysource
addToolOutput(output: ToolOutput) => voidSubmit client-side tool resultsource
data?unknownExtra data from server responsesource
handleInputChange(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => voidBind to input onChangesource
handleSubmit(e: React.FormEvent) => Promise<void>Submit current inputsource
onChange(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => voidAlias for handleInputChange - matches ChatProps.onChange for easy spreadingsource
onSubmit(e: React.FormEvent) => Promise<void>Alias for handleSubmit - matches ChatProps.onSubmit for easy spreadingsource
onModelChange(model: string | undefined) => voidAlias for setModel - matches ChatProps.onModelChange for easy spreadingsource

UseAgentOptions

Options accepted by use agent.
PropertyTypeDescriptionSource
agentstringAgent ID or endpointsource
onToolCall?(toolCall: ToolCall) => voidCallback when tool is calledsource
onToolResult?(toolCall: ToolCall, result: unknown) => voidCallback when tool result receivedsource
onError?(error: Error) => voidCallback when error occurssource

UseAgentResult

Result returned from use agent.
PropertyTypeDescriptionSource
messagesAgentMessage[]Message historysource
toolCallsToolCall[]Active tool callssource
statusAgentStatusAgent statussource
thinking?stringThinking/reasoning textsource
invoke(input: string) => Promise<void>Invoke the agentsource
stop() => voidStop agent executionsource
isLoadingbooleanLoading statesource
errorError | nullError statesource

Exports

Components

NameDescriptionSource
AgentCardRender agent card.source
AttachmentPillRender attachment pill.source
BranchPickerRender branch picker.source
ChatRender chat.source
ChatComponentsRender chat components.source
ChatComposerRender chat composer.source
ChatContextProviderRender chat context provider.source
ChatEmptyRender chat empty.source
ChatIfRender chat if.source
ChatMessageListRender chat message list.source
ChatRootRender chat root.source
ChatSidebarRender chat sidebar.source
ChatWithSidebarRender chat with sidebar.source
ComposerContextProviderRender composer context provider.source
ConversationEmptyStateState for conversation empty.source
ConversationScrollButtonRender conversation scroll button.source
DEFAULT_CHAT_STREAM_IDLE_TIMEOUT_MSDefault value for chat stream idle timeout ms.source
DEFAULT_CHAT_STREAM_TOOL_RUNNING_TIMEOUT_MSDefault value for chat stream tool running timeout ms.source
DropZoneOverlayRender drop zone overlay.source
ErrorBannerRender error banner.source
FadeInRender fade in.source
InferenceBadgeRender inference badge.source
InlineCitationRender inline citation.source
LoaderRender loader.source
MessageMessage shape for message.source
MessageActionsRender message actions.source
MessageContextProviderRender message context provider.source
MessageEditFormRender message edit form.source
MessageFeedbackRender message feedback.source
ModelAvatarRender model avatar.source
ModelSelectorRender model selector.source
QuickActionsRender quick actions.source
ReasoningCardRender reasoning card.source
RichCodeBlockRender rich code block.source
ShimmerRender shimmer.source
SkillBadgeRender skill badge.source
SourcesRender sources.source
StandaloneMessageRender a standalone chat message.source
StepIndicatorRender step indicator.source
StreamingMessageMessage shape for streaming.source
SuggestionRender suggestion.source
SuggestionsRender suggestions.source
TabSwitcherRender tab switcher.source
ThreadListContextProviderRender thread list context provider.source
ToolCallCardTool call card component - renders tool invocations with parameters and results Styled to match AI Elements (https://ai-sdk.dev/elements)source
ToolStatusBadgeRender tool status badge.source
UpgradeCTARender upgrade CTA.source
UploadsPanelRender uploads panel.source

Functions

NameDescriptionSource
buildChatStreamChunkMessageMetadataBuilds chat stream chunk message metadata.source
createChatStreamWatchdogCreate chat stream watchdog.source
createChatStreamWatchdogStateState for create chat stream watchdog.source
dedupeChatUiMessageChunksDedupe chat UI message chunks.source
downloadMarkdownDownload messages as a .md file.source
exportAsMarkdownConvert chat messages to a markdown string.source
extractChatMessageMetadataExtract chat message metadata.source
extractSourcesFromPartsExtract sources from tool result parts. Looks for documents arrays in tool outputs and maps them to Source[].source
getNextChatStreamWatchdogStateState for get next chat stream watchdog.source
getTextContentGet text content from chat message partssource
groupPartsInOrderGroup consecutive parts for ordered rendering Returns an array of groups, each containing either consecutive text parts, a tool part, or a reasoning partsource
isHeartbeatOnlyMetadataChunkCheck whether a chunk only carries heartbeat metadata.source
isLongRunningToolRunningCheck whether a long-running tool is active.source
isReasoningPartCheck if a part is a reasoning partsource
isSkillToolPartCheck if a tool part is a skill-related tool (load-skill, load-skill-reference, execute-skill-script)source
isToolPartCheck if a part is a tool partsource
mapHostedStreamPartToChatUiChunksMap hosted stream part to chat UI chunks.source
normalizeChatMessageMetadataNormalizes chat message metadata.source
normalizeChatUiMessageChunkNormalizes chat UI message chunk.source
normalizeChatUiMessageStreamNormalizes chat UI message stream.source
useAgentReact hook for agent.source
useChatuseChat hook for managing chat state with veryfront stream events.source
useChatContextContext for use chat.source
useChatContextOptionalReact hook for chat context optional.source
useChatErrorHandlerHandler for use chat error.source
useCompletionuseCompletion hook for single text generationsource
useComposerContextContext for use composer.source
useComposerContextOptionalReact hook for composer context optional.source
useMessageContextContext for use message.source
useMessageContextOptionalReact hook for message context optional.source
useStreamingReact hook for streaming.source
useThreadListContextContext for use thread list.source
useThreadListContextOptionalReact hook for thread list context optional.source
useThreadsReact hook for threads.source
useVoiceInputInput payload for use voice.source

Classes

NameDescriptionSource
ChatErrorBoundaryImplement chat error boundary.source
ChatStreamIdleTimeoutErrorError shape for chat stream idle timeout.source

Types

NameDescriptionSource
AgentCardPropsProps accepted by agent card.source
AgentThemePublic API contract for agent theme.source
AttachmentInfoPublic API contract for attachment info.source
AttachmentPillPropsProps accepted by attachment pill.source
BranchInfoPublic API contract for branch info.source
BranchPickerPropsProps accepted by branch picker.source
BrowserInferenceStatusBrowser-side model loading and inference statussource
BuildChatStreamChunkMessageMetadataInputInput payload for build chat stream chunk message metadata.source
ChatComposerPropsProps accepted by chat composer.source
ChatContextValuePublic API contract for chat context value.source
ChatDynamicToolPartPublic API contract for chat dynamic tool part.source
ChatEmptyPropsProps accepted by chat empty.source
ChatErrorBoundaryPropsProps accepted by chat error boundary.source
ChatFinishReasonPublic API contract for chat finish reason.source
ChatIfPropsProps accepted by chat if.source
ChatMessageMessage shape for chat.source
ChatMessageListPropsProps accepted by chat message list.source
ChatMessageMetadataPublic API contract for chat message metadata.source
ChatMessageMetadataUsagePublic API contract for chat message metadata usage.source
ChatMessagePartPublic API contract for chat message part.source
ChatPropsProps accepted by chat.source
ChatReasoningPartChat message part that carries reasoning text.source
ChatRootPropsProps accepted by chat root.source
ChatSidebarPropsProps accepted by chat sidebar.source
ChatStepPartPublic API contract for chat step part.source
ChatStreamEventEvent emitted for chat stream.source
ChatStreamWatchdogOptionsOptions accepted by chat stream watchdog.source
ChatStreamWatchdogPhasePublic API contract for chat stream watchdog phase.source
ChatStreamWatchdogStateState for chat stream watchdog.source
ChatTabPublic API contract for chat tab.source
ChatTextPartChat message part that carries text.source
ChatThemePublic API contract for chat theme.source
ChatToolPartPublic API contract for chat tool part.source
ChatToolResultPartChat message part that carries a tool result.source
ChatToolStateState for chat tool.source
ChatUiMessageChunkPublic API contract for chat UI message chunk.source
ChatWithSidebarAttachmentConfigConfiguration used by chat with sidebar attachment.source
ChatWithSidebarChatControllerPublic API contract for chat with sidebar chat controller.source
ChatWithSidebarFeatureConfigConfiguration used by chat with sidebar feature.source
ChatWithSidebarGroupedPropsProps accepted by chat with sidebar grouped.source
ChatWithSidebarMessageConfigConfiguration used by chat with sidebar message.source
ChatWithSidebarModelConfigConfiguration used by chat with sidebar model.source
ChatWithSidebarPropsProps accepted by chat with sidebar.source
ChatWithSidebarQuickActionsConfigConfiguration used by chat with sidebar quick actions.source
ChatWithSidebarSidebarConfigConfiguration used by chat with sidebar sidebar.source
ChatWithSidebarTabsConfigConfiguration used by chat with sidebar tabs.source
ChatWithSidebarVoiceConfigConfiguration used by chat with sidebar voice.source
ChildRunAuditPublic API contract for child run audit.source
ChildRunAuditToolCallPublic API contract for child run audit tool call.source
ChildRunAuditToolResultResult returned from child run audit tool.source
CodeBlockPropsProps accepted by code block.source
ComposerContextValuePublic API contract for composer context value.source
ConversationEmptyStatePropsProps accepted by conversation empty state.source
ConversationScrollButtonPropsProps accepted by conversation scroll button.source
DropZoneOverlayPropsProps accepted by drop zone overlay.source
ErrorBannerPropsProps accepted by error banner.source
FeedbackValuePublic API contract for feedback value.source
HostedStreamPartForUiChunkMappingPublic API contract for hosted stream part for UI chunk mapping.source
HostedUiChunkMappingOptionsOptions accepted by hosted UI chunk mapping.source
InferenceBadgePropsProps accepted by inference badge.source
InferenceModeWhere inference is happeningsource
InlineCitationPropsProps accepted by inline citation.source
MessageActionsPropsProps accepted by message actions.source
MessageContextValuePublic API contract for message context value.source
MessageEditFormPropsProps accepted by message edit form.source
MessageFeedbackPropsProps accepted by message feedback.source
MessagePropsProps accepted by message.source
MessageRootPropsProps accepted by message root.source
ModelAvatarPropsProps accepted by model avatar.source
ModelOptionA “provider/model” value and its display label.source
ModelSelectorPropsProps accepted by <ModelSelector>.source
OnToolCallArgPublic API contract for on tool call arg.source
PartGroupPart group types for ordered renderingsource
QuickActionPublic API contract for quick action.source
QuickActionsPropsProps accepted by quick actions.source
SkillBadgePropsProps accepted by skill badge.source
SourcePublic API contract for source.source
SourcesPropsProps accepted by sources.source
StepIndicatorPropsProps accepted by step indicator.source
StreamingMessagePropsProps accepted by streaming message.source
SuggestionPropsProps accepted by suggestion.source
SuggestionsPropsProps accepted by suggestions.source
TabSwitcherPropsProps accepted by tab switcher.source
ThreadPublic API contract for thread.source
ThreadListContextValuePublic API contract for thread list context value.source
ToolOutputOutput from tool.source
UpgradeCTAPropsProps accepted by the upgrade CTA.source
UploadedFilePublic API contract for uploaded file.source
UploadsPanelPropsProps accepted by uploads panel.source
UseAgentOptionsOptions accepted by use agent.source
UseAgentResultResult returned from use agent.source
UseChatOptionsOptions accepted by use chat.source
UseChatResultResult returned from use chat.source
UseCompletionOptionsOptions accepted by use completion.source
UseCompletionResultResult returned from use completion.source
UseStreamingOptionsOptions accepted by use streaming.source
UseStreamingResultResult returned from use streaming.source
UseThreadsOptionsOptions accepted by use threads.source
UseThreadsResultResult returned from use threads.source
UseVoiceInputOptionsOptions accepted by use voice input.source
UseVoiceInputResultResult returned from use voice input.source

Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

veryfront/chat/ag-ui

import { createAgUiChatEventDecoderState, decodeAgUiSseChunk, flushAgUiSseChunk } from "veryfront/chat/ag-ui";

Components

NameDescriptionSource
AgUiRunFinishedMetadataSchemaSchema for AG-UI run finished metadata.source
AgUiSnapshotMessageSchemaSchema for AG-UI snapshot message.source
AgUiSnapshotToolCallSchemaSchema for AG-UI snapshot tool call.source
AgUiWireEventNameSchemaSchema for AG-UI wire event name.source
AgUiWireEventSchemaSchema for AG-UI wire event.source

Functions

NameDescriptionSource
createAgUiChatEventDecoderStateState for create AG-UI chat event decoder.source
decodeAgUiSseChunkDecode AG-UI SSE chunk.source
flushAgUiSseChunkFlush AG-UI SSE chunk.source
mapAgUiRuntimeMessagesToChatUiMessagesMap AG-UI runtime messages to chat UI messages.source
parseSseEventEvent emitted for parse sse.source

Types

NameDescriptionSource
AgUiChatEventDecoderStateState for AG-UI chat event decoder.source
AgUiDecodedChunkPublic API contract for AG-UI decoded chunk.source
AgUiDecodedEventEvent emitted for AG-UI decoded.source
AgUiDecoderValidationModePublic API contract for AG-UI decoder validation mode.source
AgUiRunFinishedMetadataPublic API contract for AG-UI run finished metadata.source
AgUiRuntimeMessageMessage shape for AG-UI runtime.source
AgUiRuntimeToolCallPublic API contract for AG-UI runtime tool call.source
AgUiSnapshotMessageMessage shape for AG-UI snapshot.source
AgUiWireEventEvent emitted for AG-UI wire.source
AgUiWireEventNamePublic API contract for AG-UI wire event name.source
ParsedSseEventEvent emitted for parsed sse.source
ToolCallStateState for tool call.source

Constants

NameDescriptionSource
getAgUiRunFinishedMetadataSchemaZod schema for get AG-UI run finished metadata.source
getAgUiSnapshotMessageSchemaZod schema for get AG-UI snapshot message.source
getAgUiSnapshotToolCallSchemaZod schema for get AG-UI snapshot tool call.source
getAgUiWireEventNameSchemaZod schema for get AG-UI wire event name.source
getAgUiWireEventSchemaZod schema for get AG-UI wire event.source

veryfront/chat/conversation

import { convertUiMessagesToProviderModelMessages, extractTextFromMessage, extractUploadId } from "veryfront/chat/conversation";

Components

NameDescriptionSource
UUID_PATTERNShared UUID pattern value.source

Functions

NameDescriptionSource
convertUiMessagesToProviderModelMessagesConvert UI messages to provider model messages.source
extractTextFromMessageMessage shape for extract text from.source
extractUploadIdExtract upload ID.source
getStringFieldReturn string field.source
getUiToolNameReturn UI tool name.source
hasIncompleteToolPartsCheck whether incomplete tool parts is present.source
isDataUiPartCheck whether a chat part is a custom data part.source
isReasoningPartCheck whether a value is a reasoning part.source
isRecordRecord shape for is.source
isTextPartCheck whether a value is a text part.source
isToolCallPartCheck whether a value is a tool-call part.source
isToolResultPartCheck whether a value is a tool-result part.source
isToolUiPartCheck whether a chat part is a tool UI part.source
isUuidCheck whether a value is a UUID.source
mapToolStateState for map tool.source
markIncompleteToolPartsAsErroredMark incomplete tool parts as errored.source
markIncompleteToolPartsAsStoppedMark incomplete tool parts as stopped.source
pushToolPartsPush tool parts.source
stringifyUnknownStringify unknown helper.source
toConversationPartsFromUiMessageMessage shape for to conversation parts from UI.source

Types

NameDescriptionSource
ApiConversationPublic API contract for API conversation.source
ApiMessageMessage shape for API.source
ConversationTypePublic API contract for conversation type.source
MessagePartPublic API contract for message part.source
MessageStatusPublic API contract for message status.source
ReasoningPartLikeReasoning-like provider message part.source
TextPartLikeText-like provider message part.source
ToolCallLikePublic API contract for tool call like.source
ToolResultLikePublic API contract for tool result like.source
ToolUiPartChat UI tool part with a call ID and state.source

Constants

NameDescriptionSource
apiConversationSchemaSchema for API conversation.source
apiMessageSchemaSchema for API message.source
conversationTypeSchemaSchema for conversation type.source
convertUiMessagesToModelMessagesShared convert UI messages to model messages value.source
getApiConversationSchemaZod schema for get API conversation.source
getApiMessageSchemaZod schema for get API message.source
getConversationTypeSchemaZod schema for get conversation type.source
getMessagePartSchemaZod schema for get message part.source
getMessageStatusSchemaZod schema for get message status.source
messagePartSchemaSchema for message part.source
messageStatusSchemaSchema for message status.source

veryfront/chat/final-step-fallback

import { appendMissingFallbackTextPart, buildFallbackUiMessageChunks, buildFallbackUiMessageParts } from "veryfront/chat/final-step-fallback";

Components

NameDescriptionSource
DEFAULT_STREAM_PROMISE_TIMEOUT_MSDefault value for stream promise timeout ms.source

Functions

NameDescriptionSource
appendMissingFallbackTextPartAppend missing fallback text part.source
buildFallbackUiMessageChunksBuilds fallback UI message chunks.source
buildFallbackUiMessagePartsBuilds fallback UI message parts.source
buildMissingFallbackTextChunksBuilds missing fallback text chunks.source
buildMissingFallbackToolChunksBuilds missing fallback tool chunks.source
buildMissingFallbackToolChunksFromPartsBuilds missing fallback tool chunks from parts.source
extractFinalStepFinishReasonExtract final step finish reason.source
extractFinalStepTerminalErrorError shape for extract final step terminal.source
extractFinalStepTextExtract final step text.source
extractFinalStepToolCallsExtract final step tool calls.source
extractFinalStepToolResultsExtract final step tool results.source
getLastStreamStepReturn last stream step.source
getStreamStepsReturn stream steps.source

Types

NameDescriptionSource
ChatFallbackPartPublic API contract for chat fallback part.source
ChatPartPublic API contract for chat part.source
FallbackToolChunkStateState for fallback tool chunk.source
FinalStepTerminalErrorError shape for final step terminal.source
FinalStepToolCallPublic API contract for final step tool call.source
FinalStepToolResultResult returned from final step tool.source

veryfront/chat/message-prep

import { compactForStep, compressTurn, dedupeToolHistory } from "veryfront/chat/message-prep";

Functions

NameDescriptionSource
compactForStepCompact for step.source
compressTurnCompress turn.source
dedupeToolHistoryDedupe tool history.source
enforceTokenBudgetEnforce token budget.source
enforceTokenBudgetWithTurnCompressionEnforce token budget with turn compression.source
ensureToolCallInputsEnsure tool call inputs helper.source
estimateOverheadEstimate overhead.source
estimateTokensEstimate tokens.source
isModelSupportedFileMediaTypeCheck whether the model supports the file media type.source
maskOldToolOutputsMask old tool outputs.source
normalizeMessageFilePartMediaTypesNormalizes message file part media types.source
prepareProviderModelMessagesFromUiMessagesPrepare provider model messages from UI messages.source
repairToolPairsRepair tool pairs.source
rewriteUnsupportedFilePartsAsAnnotationsRewrite unsupported file parts as annotations.source
sanitizeProviderModelMessagesSanitize provider model messages.source
stripPendingToolPartsStrip pending tool parts.source

Constants

NameDescriptionSource
prepareModelMessagesFromUiMessagesShared prepare model messages from UI messages value.source
sanitizeModelMessagesShared sanitize model messages value.source

veryfront/chat/protocol

Canonical chat message and stream protocol for Veryfront chat surfaces. These types describe the framework-owned message parts and stream events used by AG-UI-aligned chat clients, hooks, and adapters.
import "veryfront/chat/protocol";

Types

NameDescriptionSource
ChatDynamicToolPartPublic API contract for chat dynamic tool part.source
ChatFinishReasonPublic API contract for chat finish reason.source
ChatMessageMessage shape for chat.source
ChatMessageMetadataPublic API contract for chat message metadata.source
ChatMessageMetadataUsagePublic API contract for chat message metadata usage.source
ChatMessagePartPublic API contract for chat message part.source
ChatPartStateCanonical chat message and stream protocol for Veryfront chat surfaces.source
ChatReasoningPartChat message part that carries reasoning text.source
ChatStepPartPublic API contract for chat step part.source
ChatStreamEventEvent emitted for chat stream.source
ChatStreamEventBasePublic API contract for chat stream event base.source
ChatTextPartChat message part that carries text.source
ChatToolPartPublic API contract for chat tool part.source
ChatToolResultPartChat message part that carries a tool result.source
ChatToolStateState for chat tool.source
ChatUiMessageChunkPublic API contract for chat UI message chunk.source
ChildRunAuditPublic API contract for child run audit.source
ChildRunAuditToolCallPublic API contract for child run audit tool call.source
ChildRunAuditToolResultResult returned from child run audit tool.source
IdChunkPublic API contract for ID chunk.source
IdDeltaChunkPublic API contract for ID delta chunk.source
MessageLifecycleChunkPublic API contract for message lifecycle chunk.source
NamedToolCallChunkPublic API contract for named tool call chunk.source
ToolCallChunkPublic API contract for tool call chunk.source
ToolErrorChunkPublic API contract for tool error chunk.source
ToolInputChunkPublic API contract for tool input chunk.source

veryfront/chat/provider-errors

Error shape for parsed provider.
import { isCreditLimitMessage, parseKnownProblemBody, parseProviderError } from "veryfront/chat/provider-errors";

Functions

NameDescriptionSource
isCreditLimitMessageMessage shape for is credit limit.source
parseKnownProblemBodyParses known problem body.source
parseProviderErrorError shape for parse provider.source
safeJsonParseParse JSON safely without throwing.source

Types

NameDescriptionSource
ParsedProviderErrorError shape for parsed provider.source
SafeJsonParseResultResult returned from safe JSON parse.source

veryfront/chat/stream-watchdog

import { createChatStreamWatchdog, createChatStreamWatchdogState, getNextChatStreamWatchdogState } from "veryfront/chat/stream-watchdog";

Components

NameDescriptionSource
DEFAULT_CHAT_STREAM_IDLE_TIMEOUT_MSDefault value for chat stream idle timeout ms.source
DEFAULT_CHAT_STREAM_TOOL_RUNNING_TIMEOUT_MSDefault value for chat stream tool running timeout ms.source

Functions

NameDescriptionSource
createChatStreamWatchdogCreate chat stream watchdog.source
createChatStreamWatchdogStateState for create chat stream watchdog.source
getNextChatStreamWatchdogStateState for get next chat stream watchdog.source
isHeartbeatOnlyMetadataChunkCheck whether a chunk only carries heartbeat metadata.source
isLongRunningToolRunningCheck whether a long-running tool is active.source

Classes

NameDescriptionSource
ChatStreamIdleTimeoutErrorError shape for chat stream idle timeout.source

Types

NameDescriptionSource
ChatStreamWatchdogOptionsOptions accepted by chat stream watchdog.source
ChatStreamWatchdogPhasePublic API contract for chat stream watchdog phase.source
ChatStreamWatchdogStateState for chat stream watchdog.source

veryfront/chat/types

import { buildDataFileAnnotation, isImageFile, isTextPreviewFile } from "veryfront/chat/types";

Functions

NameDescriptionSource
buildDataFileAnnotationBuilds data file annotation.source
isImageFileCheck whether a file is an image.source
isTextPreviewFileCheck whether a file supports text preview.source
isValidImageFileCheck whether a file is a supported image upload.source
normalizeInlineAttachmentMediaTypeNormalizes inline attachment media type.source

Types

NameDescriptionSource
ChatAssistantContentPartPublic API contract for chat assistant content part.source
ChatAssistantMessageMessage shape for chat assistant.source
ChatDataUiPartChat UI part that carries custom data chunks.source
ChatDynamicToolUiPartTool UI part for a runtime-selected tool name.source
ChatFileUiPartPublic API contract for chat file UI part.source
ChatMessageMetadataPublic API contract for chat message metadata.source
ChatMessageMetadataUsagePublic API contract for chat message metadata usage.source
ChatModelFilePartPublic API contract for chat model file part.source
ChatModelMessageMessage shape for chat model.source
ChatModelReasoningPartProvider model message part that carries reasoning text.source
ChatModelTextPartProvider model message part that carries text.source
ChatNamedToolUiPartTool UI part keyed by a static tool type.source
ChatReasoningUiPartPublic API contract for chat reasoning UI part.source
ChatRequestContextContext for chat request.source
ChatRuntimeOverridesPublic API contract for chat runtime overrides.source
ChatSourceDocumentUiPartPublic API contract for chat source document UI part.source
ChatSourceUrlUiPartPublic API contract for chat source URL UI part.source
ChatStepStartUiPartPublic API contract for chat step start UI part.source
ChatSystemMessageMessage shape for chat system.source
ChatTextUiPartPublic API contract for chat text UI part.source
ChatToolCallPartProvider model message part that carries a tool call.source
ChatToolMessageMessage shape for chat tool.source
ChatToolPartBasePublic API contract for chat tool part base.source
ChatToolPartStateState for chat tool part.source
ChatToolResultOutputOutput from chat tool result.source
ChatToolResultPartProvider model message part that carries a tool result.source
ChatUiMessageMessage shape for chat UI.source
ChatUiMessageChunkPublic API contract for chat UI message chunk.source
ChatUiMessagePartPublic API contract for chat UI message part.source
ChatUiMessageRolePublic API contract for chat UI message role.source
ChatUserContentPartPublic API contract for chat user content part.source
ChatUserMessageMessage shape for chat user.source
ChildRunAuditPublic API contract for child run audit.source
ChildRunAuditToolCallPublic API contract for child run audit tool call.source
ChildRunAuditToolResultResult returned from child run audit tool.source
DurableRootRunDescriptorPublic API contract for durable root run descriptor.source
FileUIPartWithUploadFile UI part enriched with upload metadata.source
JsonValueJSON-compatible value used in chat tool output.source
ProjectFilePublic API contract for project file.source
ProjectFileListItemPublic API contract for project file list item.source
ProviderModelMessageMessage shape for provider model.source
UploadedFileReferencePublic API contract for uploaded file reference.source

Constants

NameDescriptionSource
chatRequestContextSchemaSchema for chat request context.source
chatToolPartStateSchemaSchema for chat tool part state.source
chatUiMessagePartSchemaSchema for chat ui message part.source
chatUiMessageRoleSchemaSchema for chat ui message role.source
chatUiMessageSchemaSchema for chat ui message.source
chatUiMessagesSchemaSchema for chat ui messages.source
getChatRequestContextSchemaZod schema for get chat request context.source
getChatToolPartStateSchemaZod schema for get chat tool part state.source
getChatUiMessagePartSchemaZod schema for get chat UI message part.source
getChatUiMessageRoleSchemaZod schema for get chat UI message role.source
getChatUiMessageSchemaZod schema for get chat UI message.source
getChatUiMessagesSchemaZod schema for get chat UI messages.source
getMessageMetadataSchemaZod schema for get message metadata.source
imageFileTypesImage media types that chat uploads can display natively.source
messageMetadataSchemaSchema for message metadata.source
textFileExtensionsFile extensions that chat uploads can inline as text.source
Reference modules: User guides: Architecture: