Package Exports
The gecx-chat package exposes eighteen entry points. Each is a separate deep import so bundlers tree-shake unused code.
| Path | Description | Key Exports | When to Use |
|---|---|---|---|
gecx-chat | Framework-neutral core | createChatClient, ChatSession, ChatSdkError, auth providers, transports, defineClientTool, defineServerTool, createServerToolManifest, message builders and predicates, governance, identity, rich content, memory adapters/tools, signals (SignalRunner, SignalEscalator, adapters), permissions (PermissionManager, providers), agent graph (agentGraph, defineRouter, defineSpecialist, createA2AAgentClient, createAgentGraphTransport), computerUseTool | Every project — this is the primary entry point |
gecx-chat/react | React adapter | ChatProvider, useChatSession, useChatClient, useIdentity, useConversations, useClientToken, useRecaptcha, useRecaptchaToken, useImpressionRef, useMemory, useSentiment, useIntent, usePermission, usePermissionManager, MessagePart, <MemoryList>, <PermissionPrompt>, <ComputerUseSurface>, UI components, renderer registry, recipes | React apps that need hooks and prebuilt components |
gecx-chat/react/ui | Optional React UI primitives | ChatSurface, MessageList, Composer, SuggestionBar, ToolApprovalSurface, HandoffBanner, DebugDrawer, AttachmentProgressItem | React apps that want first-party primitives without growing the main adapter import |
gecx-chat/react/voice | React voice surface | <VoiceToggle>, <VoiceComposer>, <TranscriptDisplay>, <AudioMessage> | React apps using voice |
gecx-chat/server | Server-side helpers | createChatTokenHandler, createServerToolHandler, verifyAllowedOrigin, redaction utilities, Agentis handlers (createAgentisSessionHandler, createAgentisProxyHandler, createAgentisTokenHandler, createAgentisShoppingEventHandler), ComputerUseSession, MockProvider, BrowserbaseProvider | Node.js proxy / API route for token minting, server-tool execution, Agentis proxying, computer-use session handling |
gecx-chat/agentis | Agentis Platform integration | createAgentisProxyTransport, createAgentisTransport, connectAgentis, createMockAgentisBackend, Agentis normalizer utilities, createAgentisShoppingEventSink, Agentis server handlers | Agentis Platform integrations; prefer proxy-first transport in production and direct transport only with explicit token-exposure opt-ins |
gecx-chat/testing | Test utilities | createMockChatClient, createMockTransport, createMockVoiceProvider, createMockPermissionProvider, transcript, mockScenarios, scenarioCatalog, tool fakes | Unit and integration tests |
gecx-chat/testing/vitest | Vitest-only transport contract harness | runTransportContractTests, describeTransportContract | Custom transport contract tests that already run inside Vitest |
gecx-chat/voice | Voice subsystem | VoiceSession, createGeminiLiveProvider, createWebAudioMockVoiceProvider, createVoiceWebSocketTransport, createWebRTCVoiceTransport, audio utilities (parseAudioMime, encodePcmToBase64, chunkPcm20ms), BargeInArbiter | Apps wiring real-time voice |
gecx-chat/dashboards | Pre-built analytics widgets | <DeflectionTrend>, <CsatDistribution>, <AhtHistogram>, <AgentAssistRate>, <GmvBreakdown>, <MetricsDashboard> plus the aggregation primitives | React apps embedding analytics widgets. Recharts is an optional peer dependency. |
gecx-chat/eval | Evaluation runner | runEval, scorer registry, judge providers (Anthropic / OpenAI / Gemini), regression gate, reporter | Programmatic evals (the gecx eval CLI is the most common entry point) |
gecx-chat/rich-content | Rich content registry | createRichContentRegistry, buildClientCapabilityDoc, buildPartCapabilities, family constants, URL safety, downgrade utilities | Custom rich-content family registration and version negotiation |
gecx-chat/a2ui | Agent-to-UI protocol (core) | createA2UISurfaceManager, validateA2UIFrame, defaultActionPolicy, catalog validation (validateCatalogDataModel, buildCatalogActionPolicy, createCatalogManifestLookup), A2UI redaction utilities | Apps accepting generative UI frames from an agent |
gecx-chat/a2ui/react | Agent-to-UI React adapter | createA2UIRenderer, A2UISurfaceView, useA2UIActionBridge, DefaultA2UIConfirmDialog, A2UIErrorBoundary | React apps rendering A2UI surfaces |
gecx-chat/cli | CLI entry point | The gecx command dispatcher | Programmatic invocation of gecx doctor, gecx scaffold, gecx add, gecx eval, gecx lab init, gecx walkthrough, gecx validate, gecx ui:doctor, etc. |
gecx-chat/compat | Legacy widget bridge | createWidgetEventBridge | Migrating from the legacy embedded widget to the headless SDK |
gecx-chat/schemas/* | JSON Schema files | Static .schema.json files | CI validation, codegen, or agent grounding |
Which import do I need?
If you don't want to read the table top-to-bottom:
- Building a React app? Import from
gecx-chatandgecx-chat/react. Addgecx-chat/a2ui/reactif the agent will return generative UI surfaces. Addgecx-chat/react/voiceif you want the voice toggle and composer. Addgecx-chat/dashboardsif you want pre-built analytics widgets. - Running a Node.js proxy or token endpoint? Import from
gecx-chat/server. You usually pair it withgecx-chatfor shared types. Add theComputerUseSessionexports if you enable computer-use. - Wiring Agentis Platform? Import
createAgentisProxyTransportand analytics helpers fromgecx-chat/agentis, and server routes fromgecx-chat/server. - Wiring voice?
voice: 'auto'is the one-line path. For full control or non-React voice, importVoiceSessionand providers fromgecx-chat/voice. - Adding sentiment / intent signals? Import adapters from
gecx-chatand React hooks fromgecx-chat/react. - Building a multi-specialist routing layer? Import
agentGraph,defineRouter,defineSpecialist,createA2AAgentClient, andcreateAgentGraphTransportfromgecx-chat. - Adding long-term memory? Import adapters from
gecx-chat; the React surface is ingecx-chat/react. - Writing tests? Import from
gecx-chat/testing.createMockChatClientis the fastest entry point. For custom transport contract tests, importrunTransportContractTestsfromgecx-chat/testing/vitest. - Running evals in CI? Use the
gecx evalCLI (or importrunEvalfromgecx-chat/evalfor programmatic invocation). - Building a non-React UI (Vue, Svelte, vanilla)? Just
gecx-chat. The runtime is framework-neutral. - Migrating from the legacy widget? Add
gecx-chat/compatand follow the migration guide. - Doing CI validation or codegen? Pull JSON Schemas from
gecx-chat/schemas/*.
Import Examples
// Core
import { createChatClient, createServerToolManifest, tokenEndpointAuth, createProxyTransport } from 'gecx-chat';
// React
import { ChatProvider, useChatSession, MessagePart } from 'gecx-chat/react';
// Optional React UI primitives
import { AttachmentProgressItem } from 'gecx-chat/react/ui';
// Server (Node.js)
import { createChatTokenHandler, createServerToolHandler } from 'gecx-chat/server';
// Agentis Platform
import { createAgentisProxyTransport, createAgentisShoppingEventSink } from 'gecx-chat/agentis';
// Testing
import { createMockChatClient, mockScenarios, transcript } from 'gecx-chat/testing';
// Vitest-only transport contract harness
import { runTransportContractTests } from 'gecx-chat/testing/vitest';
// Rich content
import { createRichContentRegistry, CORE_FAMILIES } from 'gecx-chat/rich-content';
// A2UI core
import { createA2UISurfaceManager, validateA2UIFrame } from 'gecx-chat/a2ui';
// A2UI React
import { createA2UIRenderer, A2UISurfaceView } from 'gecx-chat/a2ui/react';
// Compat
import { createWidgetEventBridge } from 'gecx-chat/compat';
Source:
docs/reference/package-exports.md