Local-first knowledge management system with BYO API keys. Features: - 3-panel UI (Nodes | Focus | Helpers) - SQLite + sqlite-vec for vector search - Agent system (Easy/Hard mode orchestrators) - Content extraction (YouTube, PDF, web) - Integrate workflow for connection discovery - Dimension system with auto-assignment Tech stack: - Next.js 15 + TypeScript + Tailwind CSS - Anthropic (Claude) + OpenAI (GPT) via Vercel AI SDK Setup: npm install && npm rebuild better-sqlite3 scripts/dev/bootstrap-local.sh npm run dev MIT License
29 lines
928 B
TypeScript
29 lines
928 B
TypeScript
import { NextRequest } from 'next/server';
|
|
import { resultCache } from '@/services/tools/resultCache';
|
|
|
|
export async function GET(
|
|
request: NextRequest,
|
|
ctx: { params: Promise<{ id: string }> }
|
|
) {
|
|
try {
|
|
const { id } = await ctx.params; // Next.js 15: params is a Promise
|
|
const data = resultCache.get(id);
|
|
if (!data) {
|
|
return new Response(JSON.stringify({ success: false, error: 'Not found' }), {
|
|
status: 404,
|
|
headers: { 'Content-Type': 'application/json' }
|
|
});
|
|
}
|
|
return new Response(JSON.stringify({ success: true, data }), {
|
|
status: 200,
|
|
headers: { 'Content-Type': 'application/json' }
|
|
});
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
} catch (e: any) {
|
|
return new Response(JSON.stringify({ success: false, error: e?.message || 'Failed' }), {
|
|
status: 500,
|
|
headers: { 'Content-Type': 'application/json' }
|
|
});
|
|
}
|
|
}
|