Add Skills browser, Cron jobs, SOUL.md editor
- Skills: categorized list with search, detail view with markdown - Cron: job list grouped by status, manual trigger button - Soul: full SOUL.md editor with save/revert - Pulse: quick link cards to Skills, Cron, Soul - All routes proxied server-side (no CORS)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { promises as fs } from "fs";
|
||||
|
||||
const SOUL_PATH = process.env.HERMES_SOUL_PATH || "/home/hermes/.hermes/SOUL.md";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const content = await fs.readFile(SOUL_PATH, "utf-8");
|
||||
return NextResponse.json({ content });
|
||||
} catch {
|
||||
return NextResponse.json({ content: "" });
|
||||
}
|
||||
}
|
||||
|
||||
export async function PUT(req: NextRequest) {
|
||||
try {
|
||||
const { content } = await req.json();
|
||||
await fs.writeFile(SOUL_PATH, content, "utf-8");
|
||||
return NextResponse.json({ ok: true });
|
||||
} catch (e) {
|
||||
return NextResponse.json({ error: String(e) }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user