Skip to content
Pilotoo
v0.1

@pilotoo/chat-core

@pilotoo/chat-core is the client brain. It holds the view model, the pure reducers, the React chat session, the catalogs (conversations, agents, usage, schedules, presentations), the stores and the transport port. It renders nothing, so it sits under both @pilotoo/ui (web) and @pilotoo/chat-ui (React Native). Use it directly when you build your own screen.

@pilotoo/chat-core is at version 0.1.0 and is not published to a registry yet. A host gets it today by packing the tarballs from the kit repository:

Terminal window
pnpm install
pnpm release:check

release:check builds the release packages and writes one .tgz per package to node_modules/.cache/release-check/. Copy the tarballs you need into your project (for example vendor/) and depend on them as files:

package.json
{
"dependencies": {
"@pilotoo/chat-core": "file:vendor/pilotoo-chat-core-0.1.0.tgz"
}
}

The release set (chat-protocol, chat-core, chat-ui, ui, agent-runtime, server, local-server) is versioned together: install every kit package you use at the same version. See Installation for the full setup.

This is how the demo web app opens a session (apps/web/src/features/chat/chat-session.tsx):

import { ChatSessionProvider } from '@pilotoo/chat-core';
import { createSocketIoTransport } from '@pilotoo/chat-core/socket-io';
const [transport] = useState(() => createSocketIoTransport(apiUrl, { credentials }));
return <ChatSessionProvider transport={transport}>{children}</ChatSessionProvider>;

Create the transport in useState, not useMemo: it opens a socket.

Import Provides
@pilotoo/chat-core ChatSessionProvider, useChatSession, the ChatTransport port, the catalog factories (createConversationCatalog, createAgentCatalog, createUsageReader, createScheduleClient, createPresentationSource), createAttachmentUploader, useConversations, useAgents, KeyValueStorage.
@pilotoo/chat-core/socket-io createSocketIoTransport, the only place socket.io-client is imported.
@pilotoo/chat-core/test-fixtures Helpers for tests (for example streamOf). Never bundled by the main entry.
  • react >=19
  • socket.io-client ^4.8.3, optional: only needed if you use @pilotoo/chat-core/socket-io.