Schemas

The schemas/ directory contains JSON Schema files that mirror the public TypeScript surface of the SDK. These schemas are committed to the repository and used for CI validation, codegen, and agent grounding.

Schema Files

FileTitleSource TypeScriptDescription
config.schema.jsonChatClientConfigsrc/core/createChatClient.tsConfiguration accepted by createChatClient.
messages.schema.jsonChatMessage and ChatMessagePartsrc/messages/types.tsMessage envelope and all part variants. Each part extends BasePart with a stable id.
events.schema.jsonTransportEventsrc/messages/types.tsDiscriminated union of SDK transport events (the wire protocol).
errors.schema.jsonChatSdkErrorsrc/errors/errorCodes.tsError taxonomy with codes, severity, retryability, and metadata.
tools.schema.jsonTool definitionsrc/tools/defineClientTool.ts, src/tools/defineServerTool.tsClient and server tool schemas. The kind discriminator selects browser (client) vs. backend (server).
transport.schema.jsonTransportContractsrc/transport/ChatTransport.ts, src/transport/recoveryPolicy.tsTransport interface, capabilities, and recovery policy.
governance.schema.jsonDataGovernancesrc/governance/types.tsData governance lifecycle: consent, retention, export, audit. Includes computer-use policy and commerce strict mode.
identity.schema.jsonChatIdentitysrc/identity/types.tsIdentity and conversation continuity primitives.
a2ui.schema.jsonA2UI v0.9 SDK envelopessrc/a2ui/types.tsAgent-to-UI envelope schemas. Component-level catalog validation belongs to A2UI catalogs/renderers.
ui-catalog-manifest.schema.jsonA2UI catalog component manifestsrc/a2ui/catalog/*Per-component manifest format (frame factory, schema, action policy, integrity hash, lifecycle).
ui-catalog-registry.schema.jsonA2UI catalog registryscripts/build-ui-catalog-registry.tsAggregated registry of all installed catalog components.
rich-content.schema.jsonRich content payloadssrc/rich-content/*Built-in rich content families and the negotiation surface (PartFamilyCapability, ClientCapabilityDoc, ServerCapabilityDoc).
product-analytics.schema.jsonProductAnalyticsEventsrc/analytics/productAnalytics.tsDiscriminated union of product analytics journey events. Includes purchase_completed, six agent_* variants, three a2ui_catalog_* variants, and signal events.
agent-graph.schema.jsonAgent graph definitionsrc/agents/types.tsRouter, specialist, intent, and graph topology types.
computer-use.schema.jsonComputer-use protocolsrc/server/computerUse/*Computer-use session state, action types, audit envelope, and stream signature scheme.
permissions.schema.jsonPermissionssrc/permissions/types.tsPermissionManager request, snapshot, and provider contract.
eval-scenario.schema.jsonEval scenariosrc/eval/types.tsScenario file format (.scenario.ts and .scenario.yaml).
eval-report.schema.jsonEval reportsrc/eval/types.tsJSON report emitted by gecx eval --json.
eval-config.schema.jsonEval configsrc/eval/types.tsScorer registry and judge provider configuration.
walkthrough.schema.jsonWalkthrough artifactsrc/cli/walkthrough/*Cross-agent "show your work" artifact format.

All source paths above are relative to packages/gecx-chat/.

CI Enforcement

CI validates that schemas stay in sync with the TypeScript source. When you change a public type, update the corresponding schema file. The build will fail if schema and source drift apart.

Accessing Schemas at Runtime

Schemas are available as a package export:

import configSchema from 'gecx-chat/schemas/config.schema.json';
Source: docs/reference/schemas.md