feat: Add host-based assistant avatars (Neko/Mochi)
- Add avatar field to hosts.json config for Neko and Mochi - Create HostContext to provide host config to components - Display host avatar and name in chat messages instead of generic Claude - Add user avatar and first name to user messages - Include avatar in /api/hosts endpoint response - Fix appendFileSync import for debug logging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { createServer } from 'http';
|
||||
import { spawn } from 'child_process';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import cors from 'cors';
|
||||
import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, writeFileSync } from 'fs';
|
||||
import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, writeFileSync, appendFileSync } from 'fs';
|
||||
import { join, basename, extname } from 'path';
|
||||
import multer from 'multer';
|
||||
import session from 'express-session';
|
||||
@@ -171,6 +171,7 @@ app.get('/api/hosts', requireAuth, (req, res) => {
|
||||
id,
|
||||
name: host.name,
|
||||
description: host.description,
|
||||
avatar: host.avatar,
|
||||
color: host.color,
|
||||
icon: host.icon,
|
||||
connectionType: host.connection.type,
|
||||
@@ -845,8 +846,7 @@ wss.on('connection', async (ws, req) => {
|
||||
event
|
||||
};
|
||||
try {
|
||||
const fs = await import('fs');
|
||||
fs.appendFileSync(debugLogPath, JSON.stringify(debugEntry) + '\n');
|
||||
appendFileSync(debugLogPath, JSON.stringify(debugEntry) + '\n');
|
||||
} catch (e) {
|
||||
// Ignore write errors
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user