Files
artchat/types/chat.ts
Arthur DANJOU ff28b719de feat: enhance command palette with new "uses" feature and update chat types
- Added "View setup" command to the command palette in English, French, and Spanish.
- Removed "Tech Stack" command from the command palette.
- Updated MessageContainer to handle new "uses" message type.
- Refactored chat.ts to use a new ChatMessages function for better organization.
- Created new Uses.vue component to display a list of software and gadgets.
- Added Item.vue and List.vue components for rendering individual items and categories.
- Updated content configuration to include new skills and uses categories.
- Added new JSON files for programming languages, frontend, backend, devops, and python frameworks.
- Updated existing JSON files for homelab items with improved descriptions.
- Removed obsolete stack JSON files.
2025-09-02 21:19:32 +02:00

183 lines
5.1 KiB
TypeScript

export enum ChatType {
DUPLICATED = 'duplicated',
WEATHER = 'weather',
LOCATION = 'location',
THEME = 'theme',
LANGUAGE = 'language',
ABOUT = 'about',
PROJECTS = 'projects',
WRITINGS = 'writings',
EXPERIENCES = 'experiences',
SKILLS = 'skills',
HOBBIES = 'hobbies',
USES = 'uses',
STATUS = 'status',
CREDITS = 'credits',
CONTACT = 'contact',
STATS = 'stats',
ACTIVITY = 'activity',
RESUME = 'resume',
INIT = 'init',
}
export enum ChatState {
SENT = 'sent',
LOADING = 'loading',
}
export enum ChatSender {
USER = 'user',
ARTHUR = 'arthur',
}
export enum ChatFetchState {
THINKING = 'Thinking...',
FETCHING = 'Fetching the data...',
GENERATING = 'Generating the component...',
DONE = 'Done!',
}
export interface ChatMessage {
id: number
content: string | null
sender: ChatSender
type: ChatType
state: ChatState
fetchStates?: ChatFetchState[]
}
export function ChatMessages(t: any) {
return [
{
id: 'interface',
label: t('chat.interface'),
items: [
{
label: t('chat.theme.label'),
icon: 'i-ph-lightbulb-filament-duotone',
prompt: t('chat.theme.prompt'),
type: ChatType.THEME,
fetchStates: [ChatFetchState.THINKING, ChatFetchState.GENERATING],
},
{
label: t('chat.language.label'),
icon: 'i-ph-translate-duotone',
prompt: t('chat.language.prompt'),
type: ChatType.LANGUAGE,
fetchStates: [ChatFetchState.THINKING, ChatFetchState.GENERATING],
},
],
},
{
id: 'actions',
label: t('chat.actions'),
items: [
{
label: t('chat.location.label'),
icon: 'i-ph-map-pin-area-duotone',
prompt: t('chat.location.prompt'),
type: ChatType.LOCATION,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
{
label: t('chat.stats.label'),
icon: 'i-ph-projector-screen-chart-duotone',
prompt: t('chat.stats.prompt'),
type: ChatType.STATS,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
{
label: t('chat.weather.label'),
icon: 'i-ph-cloud-rain-duotone',
prompt: t('chat.weather.prompt'),
type: ChatType.WEATHER,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
{
label: t('chat.activity.label'),
icon: 'i-ph-activity',
prompt: t('chat.activity.prompt'),
type: ChatType.ACTIVITY,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
{
label: t('chat.status.label'),
icon: 'i-ph-warning-duotone',
prompt: t('chat.status.prompt'),
type: ChatType.STATUS,
fetchStates: [ChatFetchState.FETCHING],
},
].sort((a, b) => a.label.localeCompare(b.label)),
},
{
id: 'arthur',
label: t('chat.arthur'),
items: [
{
label: t('chat.credits.label'),
icon: 'i-ph-star-duotone',
prompt: t('chat.credits.prompt'),
type: ChatType.CREDITS,
},
{
label: t('chat.about.label'),
icon: 'i-ph-person-arms-spread-duotone',
prompt: t('chat.about.prompt'),
type: ChatType.ABOUT,
},
{
label: t('chat.projects.label'),
icon: 'i-ph-code-duotone',
prompt: t('chat.projects.prompt'),
type: ChatType.PROJECTS,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
{
label: t('chat.writings.label'),
icon: 'i-ph-books-duotone',
prompt: t('chat.writings.prompt'),
type: ChatType.WRITINGS,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
{
label: t('chat.experiences.label'),
icon: 'i-ph-briefcase-duotone',
prompt: t('chat.experiences.prompt'),
type: ChatType.EXPERIENCES,
},
{
label: t('chat.skills.label'),
icon: 'i-ph-rocket-duotone',
prompt: t('chat.skills.prompt'),
type: ChatType.SKILLS,
},
{
label: t('chat.resume.label'),
icon: 'i-ph-address-book-duotone',
prompt: t('chat.resume.prompt'),
type: ChatType.RESUME,
},
{
label: t('chat.contact.label'),
icon: 'i-ph-envelope-duotone',
prompt: t('chat.contact.prompt'),
type: ChatType.CONTACT,
},
{
label: t('chat.hobbies.label'),
icon: 'i-ph-heart-duotone',
prompt: t('chat.hobbies.prompt'),
type: ChatType.HOBBIES,
},
{
label: t('chat.uses.label'),
icon: 'i-ph-chalkboard-simple-duotone',
prompt: t('chat.uses.prompt'),
type: ChatType.USES,
fetchStates: [ChatFetchState.FETCHING, ChatFetchState.GENERATING],
},
].sort((a, b) => a.label.localeCompare(b.label)),
},
]
}