Exports
@mordn/chat-widget v0.13.0 exposes explicit client and server entry points.
Server entry points are guarded by server-only.
Main client entry
import {
ChatWidget,
Message,
Sources,
ActionButton,
ActionForm,
EntityCard,
ConfirmationCard,
StatusTracker,
THEME_PRESETS,
} from '@mordn/chat-widget';The main entry exports ChatWidget, storage context helpers, message/source/tool
building blocks, action primitives, template helpers, theme presets, and their
public prop/config types. There is no exported useChatTheme hook.
./actions
import {
leadCaptureTemplate,
type MordnActionConfig,
type MordnActionDispatcher,
} from '@mordn/chat-widget/actions';Server-safe action manifests, schemas, risk/confirmation types, and the built-in vertical templates.
./styles.css
import '@mordn/chat-widget/styles.css';Precompiled and scoped; host applications do not need Tailwind.
./models
import { MODELS } from '@mordn/chat-widget/models';Exports the package's gateway model catalog. There is no default model.
./server
import {
createChatHandler,
createLlmSummarizer,
streamHealthCheck,
ConversationOwnershipError,
NamespaceAccessError,
} from '@mordn/chat-widget/server';Also exports the handler option/context types, ChatStore and StorageAdapter contracts, usage types, CORS/upload/streaming types, and retrieval/memory config shapes.
Persistence and storage
import { createDrizzleChatStore, getDrizzleDb, schema }
from '@mordn/chat-widget/server/drizzle';
import { createSupabaseStorage }
from '@mordn/chat-widget/server/supabase';
import {
createHostedChatStore,
createHostedStorage,
createHostedConfig,
createHostedFeedback,
} from '@mordn/chat-widget/server/hosted';The hosted entry also exports HostedOptions and HostedFeedbackOptions.
Knowledge
import {
ingest,
createGeminiEmbedder,
getDefaultEmbedder,
createEmbedder,
} from '@mordn/chat-widget/server/knowledge';
import { createKnowledgeDrizzleRetriever, createKnowledgeDrizzleStore }
from '@mordn/chat-widget/server/knowledge/drizzle';
import { createHostedKnowledgeRetriever }
from '@mordn/chat-widget/server/knowledge/hosted';The root knowledge entry exports ingestion/retrieval contracts, source unions, chunking helpers, default and custom embedder factories, and constants. Concrete stores live in their own subpaths.
Memory
import type { MemoryAdapter, MemoryAdapterFactory, Memory, MemoryScope }
from '@mordn/chat-widget/server/memory';
import { createDrizzleMemory }
from '@mordn/chat-widget/server/memory/drizzle';
import { createHostedMemory }
from '@mordn/chat-widget/server/memory/hosted';
import { createMem0Memory }
from '@mordn/chat-widget/server/memory/mem0';The root memory entry also exports extraction/render helpers and their types. Tier support is adapter-dependent; see Memory.
MCP
import { connectMcpTools }
from '@mordn/chat-widget/server/mcp';
import type { McpServerConfig, McpTransport, ConnectMcpOptions }
from '@mordn/chat-widget/server/mcp';Current versus legacy schema
The scaffolded Drizzle config points directly to:
'./node_modules/@mordn/chat-widget/dist/server/drizzle/index.js'That is the current chat_conversations / chat_messages schema.
Warning
@mordn/chat-widget/schema is the legacy pre-handler schema entry. Do not use it
for a new createChatHandler installation.
Legacy ./api and ./db
Deprecated raw functions now accept a caller-supplied verified userId and
perform ownership scoping, but they remain easier to misuse because every call
must supply trusted identity. Prefer the bound ChatStore, whose methods expose
no user-id parameter. The legacy entry also exposes row types and selected
Drizzle operators for existing consumers.