From 0181d3f546bcaa982cd3fd877d888f431889883d Mon Sep 17 00:00:00 2001 From: Till JS Date: Sat, 28 Mar 2026 16:28:14 +0100 Subject: [PATCH] feat(apps): create Hono compute servers for Chat, Mukke, Picture Chat (3002): LLM completions (sync + SSE streaming), model list Mukke (3010): S3 upload/download/cover URLs via shared-storage Picture (3006): Replicate/local image gen, S3 upload Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/chat/apps/server/src/index.ts | 5 +++-- apps/mukke/apps/server/src/index.ts | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/chat/apps/server/src/index.ts b/apps/chat/apps/server/src/index.ts index d1cbd96c2..fc463e519 100644 --- a/apps/chat/apps/server/src/index.ts +++ b/apps/chat/apps/server/src/index.ts @@ -13,7 +13,6 @@ import { consumeCredits, validateCredits } from '@manacore/shared-hono/credits'; const PORT = parseInt(process.env.PORT || '3002', 10); const LLM_URL = process.env.MANA_LLM_URL || 'http://localhost:3025'; -const OPENROUTER_KEY = process.env.OPENROUTER_API_KEY || ''; const CORS_ORIGINS = (process.env.CORS_ORIGINS || 'http://localhost:5173').split(','); const app = new Hono(); @@ -114,7 +113,9 @@ app.post('/api/v1/chat/completions/stream', async (c) => { } await stream.writeSSE({ data: '[DONE]' }); - consumeCredits(userId, 'AI_CHAT', cost, `Chat stream: ${model || 'gemma3:4b'}`).catch(() => {}); + consumeCredits(userId, 'AI_CHAT', cost, `Chat stream: ${model || 'gemma3:4b'}`).catch( + () => {} + ); } catch (_err) { await stream.writeSSE({ data: JSON.stringify({ error: 'Stream failed' }) }); } diff --git a/apps/mukke/apps/server/src/index.ts b/apps/mukke/apps/server/src/index.ts index 684d775da..7377b54f7 100644 --- a/apps/mukke/apps/server/src/index.ts +++ b/apps/mukke/apps/server/src/index.ts @@ -10,10 +10,6 @@ import { cors } from 'hono/cors'; import { authMiddleware, healthRoute, errorHandler, notFoundHandler } from '@manacore/shared-hono'; const PORT = parseInt(process.env.PORT || '3010', 10); -const S3_ENDPOINT = process.env.S3_ENDPOINT || 'http://localhost:9000'; -const S3_BUCKET = process.env.S3_BUCKET || 'mukke-storage'; -const S3_ACCESS_KEY = process.env.S3_ACCESS_KEY || 'minioadmin'; -const S3_SECRET_KEY = process.env.S3_SECRET_KEY || 'minioadmin'; const CORS_ORIGINS = (process.env.CORS_ORIGINS || 'http://localhost:5180').split(','); const app = new Hono(); @@ -37,7 +33,7 @@ app.post('/api/v1/songs/upload', async (c) => { // Generate presigned upload URL try { - const { createMukkeStorage, generateUserFileKey } = await import('@manacore/shared-storage'); + const { createMukkeStorage } = await import('@manacore/shared-storage'); const storage = createMukkeStorage(); const uploadUrl = await storage.getUploadUrl(key, { expiresIn: 3600 });