packages/chat-contract/README.md
@portfolio/chat-contract
Shared TypeScript contracts for portfolio data, chat UI state, and SSE payloads.
Overview
This package defines the types used by the app, chat UI package, GitHub data package, and structured portfolio data providers:
- Project, resume, profile, and repository types
- Chat message and stream event-related types
- Generic chat UI hint types consumed by site-specific card renderers
Usage
import type { ChatMessage } from '@portfolio/chat-contract';
const message: ChatMessage = {
id: crypto.randomUUID(),
role: 'assistant',
parts: [{ kind: 'text', text: 'Ask me about a project.' }],
};
UI Hints
Agents surface renderable context with generic cards and links:
import type { ChatUiHints } from '@portfolio/chat-contract';
const ui: ChatUiHints = {
cards: [{ type: 'project', slug: 'clanky' }],
links: [{ id: 'github' }],
};
Consumers map cards[].type to their own components. This portfolio knows how to render project, experience, and education, but other sites can use their own entity types.
Related Packages
- @portfolio/chat-data - Profile/resume data schemas and search helpers
- @portfolio/chat-next-ui - Chat UI state and stream parsing
- @portfolio/github-data - GitHub repository data
