refactor(packages): consolidate 3 feedback packages into @manacore/feedback

Merged shared-feedback-types + shared-feedback-service + shared-feedback-ui
into a single @manacore/feedback package. Updated imports in all 21 apps.

Before: 3 packages (types, service, ui) with cross-dependencies
After:  1 package with direct imports, no circular refs

Note: ESLint warnings from pre-existing unused vars in chat/mukke
servers are unrelated to this change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-28 16:27:11 +01:00
parent bf4d9cb9aa
commit 1aeb987cb6
78 changed files with 617 additions and 317 deletions

View file

@ -49,8 +49,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -3,7 +3,7 @@
*/ */
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
// Get auth URL dynamically at runtime // Get auth URL dynamically at runtime

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/services/feedback'; import { feedbackService } from '$lib/services/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -0,0 +1,19 @@
{
"name": "@chat/server",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "bun run --watch src/index.ts",
"start": "bun run src/index.ts"
},
"dependencies": {
"@manacore/shared-hono": "workspace:*",
"hono": "^4.7.0",
"drizzle-orm": "^0.38.3",
"postgres": "^3.4.5"
},
"devDependencies": {
"typescript": "^5.9.3"
}
}

View file

@ -0,0 +1,136 @@
/**
* Chat Hono Server LLM completions (sync + streaming)
*
* CRUD for conversations/messages handled by mana-sync.
* This server handles AI completions via mana-llm or OpenRouter.
*/
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { streamSSE } from 'hono/streaming';
import { authMiddleware, healthRoute, errorHandler, notFoundHandler } from '@manacore/shared-hono';
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();
app.onError(errorHandler);
app.notFound(notFoundHandler);
app.use('*', cors({ origin: CORS_ORIGINS, credentials: true }));
app.route('/health', healthRoute('chat-server'));
app.use('/api/*', authMiddleware());
// ─── Chat Completion (sync) ──────────────────────────────────
app.post('/api/v1/chat/completions', async (c) => {
const userId = c.get('userId');
const { messages, model, temperature, maxTokens } = await c.req.json();
if (!messages?.length) return c.json({ error: 'messages required' }, 400);
const isLocal = !model || model.startsWith('ollama/') || model.startsWith('local/');
const cost = isLocal ? 0.1 : 5;
const validation = await validateCredits(userId, 'AI_CHAT', cost);
if (!validation.hasCredits) {
return c.json({ error: 'Insufficient credits', required: cost }, 402);
}
try {
const llmRes = await fetch(`${LLM_URL}/api/v1/chat/completions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
messages,
model: model || 'gemma3:4b',
temperature: temperature || 0.7,
max_tokens: maxTokens || 2000,
}),
});
if (!llmRes.ok) return c.json({ error: 'LLM request failed' }, 502);
const data = await llmRes.json();
await consumeCredits(userId, 'AI_CHAT', cost, `Chat: ${model || 'gemma3:4b'}`);
return c.json(data);
} catch (_err) {
return c.json({ error: 'Chat completion failed' }, 500);
}
});
// ─── Chat Completion (streaming SSE) ─────────────────────────
app.post('/api/v1/chat/completions/stream', async (c) => {
const userId = c.get('userId');
const { messages, model, temperature, maxTokens } = await c.req.json();
if (!messages?.length) return c.json({ error: 'messages required' }, 400);
const isLocal = !model || model.startsWith('ollama/') || model.startsWith('local/');
const cost = isLocal ? 0.1 : 5;
const validation = await validateCredits(userId, 'AI_CHAT', cost);
if (!validation.hasCredits) {
return c.json({ error: 'Insufficient credits' }, 402);
}
return streamSSE(c, async (stream) => {
try {
const llmRes = await fetch(`${LLM_URL}/api/v1/chat/completions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
messages,
model: model || 'gemma3:4b',
temperature: temperature || 0.7,
max_tokens: maxTokens || 2000,
stream: true,
}),
});
if (!llmRes.ok || !llmRes.body) {
await stream.writeSSE({ data: JSON.stringify({ error: 'LLM failed' }) });
return;
}
const reader = llmRes.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value, { stream: true });
// Forward SSE chunks directly
for (const line of chunk.split('\n')) {
if (line.startsWith('data: ')) {
await stream.writeSSE({ data: line.slice(6) });
}
}
}
await stream.writeSSE({ data: '[DONE]' });
consumeCredits(userId, 'AI_CHAT', cost, `Chat stream: ${model || 'gemma3:4b'}`).catch(() => {});
} catch (_err) {
await stream.writeSSE({ data: JSON.stringify({ error: 'Stream failed' }) });
}
});
});
// ─── Models List ─────────────────────────────────────────────
app.get('/api/v1/chat/models', async (c) => {
try {
const res = await fetch(`${LLM_URL}/api/v1/models`);
if (res.ok) return c.json(await res.json());
} catch {
// Fallback
}
return c.json({ models: [] });
});
export default { port: PORT, fetch: app.fetch };

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src/**/*.ts"]
}

View file

@ -40,8 +40,7 @@
"@manacore/local-store": "workspace:*", "@manacore/local-store": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -2,7 +2,7 @@
* Feedback Service Instance for Chat Web App * Feedback Service Instance for Chat Web App
*/ */
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
// Use environment variable at runtime // Use environment variable at runtime

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/services/feedback'; import { feedbackService } from '$lib/services/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -36,8 +36,7 @@
"@manacore/local-store": "workspace:*", "@manacore/local-store": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n'; import '$lib/i18n';

View file

@ -43,8 +43,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n'; import '$lib/i18n';

View file

@ -41,8 +41,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-help-content": "workspace:*", "@manacore/shared-help-content": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -3,7 +3,7 @@
*/ */
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
// Get auth URL dynamically at runtime // Get auth URL dynamically at runtime

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/services/feedback'; import { feedbackService } from '$lib/services/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -39,8 +39,7 @@
"@manacore/local-store": "workspace:*", "@manacore/local-store": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n'; import '$lib/i18n';

View file

@ -37,7 +37,6 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-landing-ui": "workspace:*", "@manacore/shared-landing-ui": "workspace:*",
"@manacore/shared-profile-ui": "workspace:*", "@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*",
"@manacore/shared-stores": "workspace:*", "@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*", "@manacore/shared-subscription-ui": "workspace:*",
"@manacore/shared-theme": "workspace:*", "@manacore/shared-theme": "workspace:*",

View file

@ -1,5 +1,5 @@
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
function getAuthUrl(): string { function getAuthUrl(): string {

View file

@ -49,8 +49,7 @@
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-config": "workspace:*", "@manacore/shared-config": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -2,7 +2,7 @@
* Feedback Service Instance for ManaCore Web App * Feedback Service Instance for ManaCore Web App
*/ */
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import { getManaAuthUrl } from './config'; import { getManaAuthUrl } from './config';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/api/feedback'; import { feedbackService } from '$lib/api/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -37,8 +37,7 @@
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-config": "workspace:*", "@manacore/shared-config": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -2,7 +2,7 @@
* Feedback Service Instance for ManaDeck Web App * Feedback Service Instance for ManaDeck Web App
*/ */
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authService } from '$lib/auth'; import { authService } from '$lib/auth';
import { PUBLIC_MANA_CORE_AUTH_URL } from '$env/static/public'; import { PUBLIC_MANA_CORE_AUTH_URL } from '$env/static/public';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/api/feedback'; import { feedbackService } from '$lib/api/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -41,8 +41,7 @@
"@manacore/shared-auth": "workspace:*", "@manacore/shared-auth": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { matrixStore } from '$lib/matrix'; import { matrixStore } from '$lib/matrix';
function getAuthUrl(): string { function getAuthUrl(): string {

View file

@ -0,0 +1,18 @@
{
"name": "@mukke/server",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "bun run --watch src/index.ts",
"start": "bun run src/index.ts"
},
"dependencies": {
"@manacore/shared-hono": "workspace:*",
"@manacore/shared-storage": "workspace:*",
"hono": "^4.7.0"
},
"devDependencies": {
"typescript": "^5.9.3"
}
}

View file

@ -0,0 +1,110 @@
/**
* Mukke Hono Server Audio upload, metadata, presigned URLs
*
* CRUD for songs/playlists/projects handled by mana-sync.
* This server handles S3 operations and metadata extraction.
*/
import { Hono } from 'hono';
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();
app.onError(errorHandler);
app.notFound(notFoundHandler);
app.use('*', cors({ origin: CORS_ORIGINS, credentials: true }));
app.route('/health', healthRoute('mukke-server'));
app.use('/api/*', authMiddleware());
// ─── Song Upload (server-only: S3 presigned URL) ────────────
app.post('/api/v1/songs/upload', async (c) => {
const userId = c.get('userId');
const { filename } = await c.req.json();
if (!filename) return c.json({ error: 'filename required' }, 400);
const songId = crypto.randomUUID();
const key = `users/${userId}/songs/${songId}/${filename}`;
// Generate presigned upload URL
try {
const { createMukkeStorage, generateUserFileKey } = await import('@manacore/shared-storage');
const storage = createMukkeStorage();
const uploadUrl = await storage.getUploadUrl(key, { expiresIn: 3600 });
return c.json({
song: { id: songId, title: filename.replace(/\.[^/.]+$/, ''), storagePath: key },
uploadUrl,
});
} catch (_err) {
return c.json({ error: 'Failed to generate upload URL' }, 500);
}
});
// ─── Download URL (server-only: S3 presigned URL) ────────────
app.get('/api/v1/songs/:id/download-url', async (c) => {
const { storagePath } = c.req.query();
if (!storagePath) return c.json({ error: 'storagePath required' }, 400);
try {
const { createMukkeStorage } = await import('@manacore/shared-storage');
const storage = createMukkeStorage();
const url = await storage.getDownloadUrl(storagePath, { expiresIn: 3600 });
return c.json({ url });
} catch (_err) {
return c.json({ error: 'Failed to generate download URL' }, 500);
}
});
// ─── Cover Art URL (server-only: S3 presigned URL) ───────────
app.get('/api/v1/songs/:id/cover-url', async (c) => {
const { coverArtPath } = c.req.query();
if (!coverArtPath) return c.json({ url: null });
try {
const { createMukkeStorage } = await import('@manacore/shared-storage');
const storage = createMukkeStorage();
const url = await storage.getDownloadUrl(coverArtPath, { expiresIn: 3600 });
return c.json({ url });
} catch (_err) {
return c.json({ url: null });
}
});
// ─── Batch Cover URLs ────────────────────────────────────────
app.post('/api/v1/library/cover-urls', async (c) => {
const { paths } = await c.req.json();
if (!paths?.length) return c.json({ urls: {} });
try {
const { createMukkeStorage } = await import('@manacore/shared-storage');
const storage = createMukkeStorage();
const urls: Record<string, string> = {};
for (const path of paths.slice(0, 50)) {
try {
urls[path] = await storage.getDownloadUrl(path, { expiresIn: 3600 });
} catch {
// Skip failed URLs
}
}
return c.json({ urls });
} catch (_err) {
return c.json({ urls: {} });
}
});
export default { port: PORT, fetch: app.fetch };

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src/**/*.ts"]
}

View file

@ -42,8 +42,7 @@
"@manacore/local-store": "workspace:*", "@manacore/local-store": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:^", "@manacore/feedback": "workspace:^",
"@manacore/shared-feedback-ui": "workspace:^",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -1,5 +1,5 @@
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
function getAuthUrl(): string { function getAuthUrl(): string {

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/services/feedback'; import { feedbackService } from '$lib/services/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -44,8 +44,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -36,8 +36,7 @@
"@manacore/local-store": "workspace:*", "@manacore/local-store": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-help-content": "workspace:*", "@manacore/shared-help-content": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n'; import '$lib/i18n';

View file

@ -0,0 +1,18 @@
{
"name": "@picture/server",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "bun run --watch src/index.ts",
"start": "bun run src/index.ts"
},
"dependencies": {
"@manacore/shared-hono": "workspace:*",
"@manacore/shared-storage": "workspace:*",
"hono": "^4.7.0"
},
"devDependencies": {
"typescript": "^5.9.3"
}
}

View file

@ -0,0 +1,144 @@
/**
* Picture Hono Server AI image generation + upload
*
* CRUD for images/boards/boardItems handled by mana-sync.
* This server handles Replicate API, S3 uploads, and explore.
*/
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { authMiddleware, healthRoute, errorHandler, notFoundHandler } from '@manacore/shared-hono';
import { consumeCredits, validateCredits } from '@manacore/shared-hono/credits';
const PORT = parseInt(process.env.PORT || '3006', 10);
const REPLICATE_TOKEN = process.env.REPLICATE_API_TOKEN || '';
const IMAGE_GEN_URL = process.env.MANA_IMAGE_GEN_URL || '';
const CORS_ORIGINS = (process.env.CORS_ORIGINS || 'http://localhost:5173').split(',');
const app = new Hono();
app.onError(errorHandler);
app.notFound(notFoundHandler);
app.use('*', cors({ origin: CORS_ORIGINS, credentials: true }));
app.route('/health', healthRoute('picture-server'));
app.use('/api/*', authMiddleware());
// ─── AI Image Generation (server-only: Replicate/local) ─────
app.post('/api/v1/generate', async (c) => {
const userId = c.get('userId');
const { prompt, model, width, height, negativePrompt, steps, guidanceScale } = await c.req.json();
if (!prompt) return c.json({ error: 'prompt required' }, 400);
const cost = 10;
const validation = await validateCredits(userId, 'AI_IMAGE_GENERATION', cost);
if (!validation.hasCredits) {
return c.json({ error: 'Insufficient credits', required: cost }, 402);
}
try {
let imageUrl: string;
if (model?.startsWith('local/') && IMAGE_GEN_URL) {
// Local generation via mana-image-gen
const res = await fetch(`${IMAGE_GEN_URL}/generate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt,
negative_prompt: negativePrompt,
width: width || 1024,
height: height || 1024,
steps: steps || 20,
guidance_scale: guidanceScale || 7.5,
}),
});
if (!res.ok) return c.json({ error: 'Local generation failed' }, 502);
const data = await res.json();
imageUrl = data.image_url || data.url;
} else if (REPLICATE_TOKEN) {
// Cloud generation via Replicate
const res = await fetch('https://api.replicate.com/v1/predictions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${REPLICATE_TOKEN}`,
},
body: JSON.stringify({
model: model || 'black-forest-labs/flux-schnell',
input: {
prompt,
negative_prompt: negativePrompt,
width: width || 1024,
height: height || 1024,
num_inference_steps: steps || 4,
guidance_scale: guidanceScale || 0,
},
}),
});
if (!res.ok) return c.json({ error: 'Replicate API failed' }, 502);
const prediction = await res.json();
// Poll for completion
let output = prediction.output;
if (!output && prediction.urls?.get) {
for (let i = 0; i < 60; i++) {
await new Promise((r) => setTimeout(r, 2000));
const pollRes = await fetch(prediction.urls.get, {
headers: { Authorization: `Bearer ${REPLICATE_TOKEN}` },
});
const pollData = await pollRes.json();
if (pollData.status === 'succeeded') {
output = pollData.output;
break;
}
if (pollData.status === 'failed') {
return c.json({ error: 'Generation failed' }, 500);
}
}
}
imageUrl = Array.isArray(output) ? output[0] : output;
} else {
return c.json({ error: 'No image generation service configured' }, 503);
}
await consumeCredits(userId, 'AI_IMAGE_GENERATION', cost, `Image: ${prompt.slice(0, 50)}`);
return c.json({ imageUrl, prompt, model: model || 'flux-schnell' });
} catch (_err) {
return c.json({ error: 'Generation failed' }, 500);
}
});
// ─── Image Upload (server-only: S3) ─────────────────────────
app.post('/api/v1/upload', async (c) => {
const userId = c.get('userId');
const formData = await c.req.formData();
const file = formData.get('file') as File | null;
if (!file) return c.json({ error: 'No file' }, 400);
if (file.size > 10 * 1024 * 1024) return c.json({ error: 'Max 10MB' }, 400);
try {
const { createPictureStorage, generateUserFileKey, getContentType } =
await import('@manacore/shared-storage');
const storage = createPictureStorage();
const key = generateUserFileKey(userId, file.name);
const buffer = Buffer.from(await file.arrayBuffer());
const result = await storage.upload(key, buffer, {
contentType: getContentType(file.name),
public: true,
});
return c.json({ storagePath: key, publicUrl: result.url }, 201);
} catch (_err) {
return c.json({ error: 'Upload failed' }, 500);
}
});
export default { port: PORT, fetch: app.fetch };

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src/**/*.ts"]
}

View file

@ -22,8 +22,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -2,7 +2,7 @@
* Feedback Service Instance for Picture Web App * Feedback Service Instance for Picture Web App
*/ */
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import { env } from '$env/dynamic/public'; import { env } from '$env/dynamic/public';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/api/feedback'; import { feedbackService } from '$lib/api/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -36,8 +36,7 @@
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",
"@manacore/shared-icons": "workspace:*", "@manacore/shared-icons": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n'; import '$lib/i18n';

View file

@ -36,8 +36,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -2,7 +2,7 @@
* Feedback Service Instance for Presi Web App * Feedback Service Instance for Presi Web App
*/ */
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { auth } from '$lib/stores/auth.svelte'; import { auth } from '$lib/stores/auth.svelte';
import { PUBLIC_MANA_CORE_AUTH_URL } from '$env/static/public'; import { PUBLIC_MANA_CORE_AUTH_URL } from '$env/static/public';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/api/feedback'; import { feedbackService } from '$lib/api/feedback';
import { auth } from '$lib/stores/auth.svelte'; import { auth } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -41,8 +41,7 @@
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",
"@manacore/shared-icons": "workspace:*", "@manacore/shared-icons": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n'; import '$lib/i18n';

View file

@ -43,8 +43,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -46,8 +46,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -3,7 +3,7 @@
*/ */
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
// Get auth URL dynamically at runtime // Get auth URL dynamically at runtime

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { feedbackService } from '$lib/services/feedback'; import { feedbackService } from '$lib/services/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
</script> </script>

View file

@ -38,8 +38,7 @@
"@manacore/shared-auth-ui": "workspace:*", "@manacore/shared-auth-ui": "workspace:*",
"@manacore/shared-branding": "workspace:*", "@manacore/shared-branding": "workspace:*",
"@manacore/shared-error-tracking": "workspace:*", "@manacore/shared-error-tracking": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*", "@manacore/feedback": "workspace:*",
"@manacore/shared-feedback-ui": "workspace:*",
"@manacore/shared-i18n": "workspace:*", "@manacore/shared-i18n": "workspace:*",
"@manacore/shared-help-types": "workspace:*", "@manacore/shared-help-types": "workspace:*",
"@manacore/shared-help-ui": "workspace:*", "@manacore/shared-help-ui": "workspace:*",

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import { FeedbackPage } from '@manacore/shared-feedback-ui'; import { FeedbackPage } from '@manacore/feedback';
import { createFeedbackService } from '@manacore/shared-feedback-service'; import { createFeedbackService } from '@manacore/feedback';
import { authStore } from '$lib/stores/auth.svelte'; import { authStore } from '$lib/stores/auth.svelte';
const feedbackService = createFeedbackService({ const feedbackService = createFeedbackService({

View file

@ -0,0 +1,28 @@
{
"name": "@manacore/feedback",
"version": "1.0.0",
"private": true,
"description": "Unified feedback package — types, service, and UI components",
"type": "module",
"svelte": "./src/index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"scripts": {
"type-check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"typescript": "^5.9.3"
},
"peerDependencies": {
"svelte": "^5.0.0"
}
}

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { Feedback } from '@manacore/shared-feedback-types'; import type { Feedback } from './feedback';
import StatusBadge from './StatusBadge.svelte'; import StatusBadge from './StatusBadge.svelte';
import VoteButton from './VoteButton.svelte'; import VoteButton from './VoteButton.svelte';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { CreateFeedbackInput } from '@manacore/shared-feedback-types'; import type { CreateFeedbackInput } from './feedback';
interface Props { interface Props {
onSubmit: (input: CreateFeedbackInput) => Promise<void>; onSubmit: (input: CreateFeedbackInput) => Promise<void>;

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { Feedback } from '@manacore/shared-feedback-types'; import type { Feedback } from './feedback';
import FeedbackCard from './FeedbackCard.svelte'; import FeedbackCard from './FeedbackCard.svelte';
interface Props { interface Props {

View file

@ -3,7 +3,7 @@
FeedbackService, FeedbackService,
Feedback, Feedback,
CreateFeedbackInput, CreateFeedbackInput,
} from '@manacore/shared-feedback-service'; } from './createFeedbackService';
import FeedbackForm from './FeedbackForm.svelte'; import FeedbackForm from './FeedbackForm.svelte';
import FeedbackList from './FeedbackList.svelte'; import FeedbackList from './FeedbackList.svelte';

View file

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import type { FeedbackStatus } from '@manacore/shared-feedback-types'; import type { FeedbackStatus } from './feedback';
import { FEEDBACK_STATUS_CONFIG } from '@manacore/shared-feedback-types'; import { FEEDBACK_STATUS_CONFIG } from './feedback';
interface Props { interface Props {
status: FeedbackStatus; status: FeedbackStatus;

View file

@ -6,7 +6,7 @@
* *
* @example * @example
* ```ts * ```ts
* import { createFeedbackService } from '@manacore/shared-feedback-service'; * import { createFeedbackService } from '@manacore/feedback';
* import { authStore } from '$lib/stores/auth.svelte'; * import { authStore } from '$lib/stores/auth.svelte';
* *
* export const feedbackService = createFeedbackService({ * export const feedbackService = createFeedbackService({
@ -23,7 +23,7 @@ import type {
FeedbackResponse, FeedbackResponse,
FeedbackListResponse, FeedbackListResponse,
VoteResponse, VoteResponse,
} from '@manacore/shared-feedback-types'; } from './feedback';
import type { FeedbackServiceConfig } from './types'; import type { FeedbackServiceConfig } from './types';
/** /**

View file

@ -0,0 +1,36 @@
/**
* @manacore/feedback Unified feedback package
*
* Consolidates shared-feedback-types + shared-feedback-service + shared-feedback-ui
* into a single package.
*/
// Types
export {
type FeedbackCategory,
type FeedbackStatus,
type Feedback,
type FeedbackVote,
FEEDBACK_CATEGORY_LABELS,
FEEDBACK_STATUS_CONFIG,
} from './feedback';
export {
type CreateFeedbackInput,
type FeedbackQueryParams,
type FeedbackResponse,
type FeedbackListResponse,
type VoteResponse,
} from './api';
// Service
export { createFeedbackService, type FeedbackService } from './createFeedbackService';
export type { FeedbackServiceConfig } from './types';
// UI Components
export { default as FeedbackPage } from './FeedbackPage.svelte';
export { default as FeedbackForm } from './FeedbackForm.svelte';
export { default as FeedbackList } from './FeedbackList.svelte';
export { default as FeedbackCard } from './FeedbackCard.svelte';
export { default as VoteButton } from './VoteButton.svelte';
export { default as StatusBadge } from './StatusBadge.svelte';

View file

@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "dist",
"declaration": true
},
"include": ["src/**/*.ts", "src/**/*.svelte"]
}

View file

@ -1,27 +0,0 @@
{
"name": "@manacore/shared-feedback-service",
"version": "1.0.0",
"private": true,
"type": "module",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"main": "./src/index.ts",
"types": "./src/index.ts",
"files": [
"src"
],
"scripts": {
"type-check": "tsc --noEmit",
"lint": "eslint ."
},
"dependencies": {
"@manacore/shared-feedback-types": "workspace:*"
},
"devDependencies": {
"typescript": "^5.7.3"
}
}

View file

@ -1,24 +0,0 @@
/**
* Shared feedback service for Manacore monorepo
*
* This package provides a factory function to create feedback service
* instances that can be used across all web and mobile apps.
*/
export { createFeedbackService, type FeedbackService } from './createFeedbackService';
export type { FeedbackServiceConfig } from './types';
// Re-export types from shared-feedback-types for convenience
export type {
Feedback,
FeedbackCategory,
FeedbackStatus,
FeedbackVote,
CreateFeedbackInput,
FeedbackQueryParams,
FeedbackResponse,
FeedbackListResponse,
VoteResponse,
FEEDBACK_CATEGORY_LABELS,
FEEDBACK_STATUS_CONFIG,
} from '@manacore/shared-feedback-types';

View file

@ -1,13 +0,0 @@
/**
* Configuration for creating a feedback service instance
*/
export interface FeedbackServiceConfig {
/** Base API URL for the feedback endpoints */
apiUrl: string;
/** App identifier for multi-app support */
appId: string;
/** Function to get the current auth token */
getAuthToken: () => Promise<string | null>;
/** Optional custom endpoint prefix (default: '/api/v1/feedback') */
feedbackEndpoint?: string;
}

View file

@ -1,17 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022", "DOM"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"noEmit": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View file

@ -1,20 +0,0 @@
{
"name": "@manacore/shared-feedback-types",
"version": "1.0.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": "./src/index.ts",
"./feedback": "./src/feedback.ts",
"./api": "./src/api.ts"
},
"scripts": {
"type-check": "tsc --noEmit",
"lint": "eslint ."
},
"devDependencies": {
"typescript": "^5.7.3"
}
}

View file

@ -1,25 +0,0 @@
/**
* Shared feedback types for Manacore monorepo
*
* This package contains TypeScript types for feedback submissions,
* voting, and API contracts.
*/
// Feedback types
export {
type FeedbackCategory,
type FeedbackStatus,
type Feedback,
type FeedbackVote,
FEEDBACK_CATEGORY_LABELS,
FEEDBACK_STATUS_CONFIG,
} from './feedback';
// API types
export {
type CreateFeedbackInput,
type FeedbackQueryParams,
type FeedbackResponse,
type FeedbackListResponse,
type VoteResponse,
} from './api';

View file

@ -1,17 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"noEmit": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View file

@ -1,56 +0,0 @@
{
"name": "@manacore/shared-feedback-ui",
"version": "1.0.0",
"private": true,
"type": "module",
"svelte": "./src/index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
},
"./FeedbackPage.svelte": {
"svelte": "./src/FeedbackPage.svelte",
"default": "./src/FeedbackPage.svelte"
},
"./FeedbackForm.svelte": {
"svelte": "./src/FeedbackForm.svelte",
"default": "./src/FeedbackForm.svelte"
},
"./FeedbackList.svelte": {
"svelte": "./src/FeedbackList.svelte",
"default": "./src/FeedbackList.svelte"
},
"./FeedbackCard.svelte": {
"svelte": "./src/FeedbackCard.svelte",
"default": "./src/FeedbackCard.svelte"
},
"./VoteButton.svelte": {
"svelte": "./src/VoteButton.svelte",
"default": "./src/VoteButton.svelte"
},
"./StatusBadge.svelte": {
"svelte": "./src/StatusBadge.svelte",
"default": "./src/StatusBadge.svelte"
}
},
"scripts": {
"check": "svelte-check --tsconfig ./tsconfig.json",
"lint": "eslint ."
},
"dependencies": {
"@manacore/shared-feedback-types": "workspace:*",
"@manacore/shared-feedback-service": "workspace:*"
},
"devDependencies": {
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"svelte": "^5.0.0"
}
}

View file

@ -1,20 +0,0 @@
/**
* Shared feedback UI components for Manacore monorepo
*
* This package provides Svelte 5 components for feedback functionality
* that can be used across all web apps.
*/
// Page components
export { default as FeedbackPage } from './FeedbackPage.svelte';
// Form components
export { default as FeedbackForm } from './FeedbackForm.svelte';
// List components
export { default as FeedbackList } from './FeedbackList.svelte';
export { default as FeedbackCard } from './FeedbackCard.svelte';
// Utility components
export { default as VoteButton } from './VoteButton.svelte';
export { default as StatusBadge } from './StatusBadge.svelte';

View file

@ -1,16 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": true,
"noEmit": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}