- web board (Backlog / In progress / Review / Done) with drag-and-drop and buttons; moveTask starts an agent on In progress, stops on Backlog/Done - routine proposals go straight to apply; request_approval/ask_pm only for architectural stoppers (RULES.md, MCP hints, template pushed to Gitea) - Stop hook keeps the agent going (decision: block, max 2 in a row, sessions.auto_nudges reset by a human answer) instead of pinging the PM - review: ready-for-review message with Accept (acceptTask → done, session stopped) in Telegram and web; a text reply goes back to the agent - mock-claude honours Stop-hook block; 6 new e2e tests (48 total, green) - OpenSpec: pep-7 archived (task-autonomy, web-workspace board) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
import Link from "next/link";
|
||
import { listUserProjects } from "@peppa/core";
|
||
import { AutoRefresh } from "@/components/AutoRefresh";
|
||
import { Flash, QuestionCard, SessionCard } from "@/components/ui";
|
||
import { requireUser } from "@/lib/auth";
|
||
import { db } from "@/lib/db";
|
||
import { activeSessions, inbox } from "@/lib/queries";
|
||
|
||
export default async function Inbox({ searchParams }: { searchParams: Promise<{ error?: string }> }) {
|
||
const user = await requireUser();
|
||
const { error } = await searchParams;
|
||
const [items, sessions, projects] = await Promise.all([inbox(user.id), activeSessions(user.id), listUserProjects(db, user.id)]);
|
||
return (
|
||
<>
|
||
<AutoRefresh />
|
||
<Flash error={error} />
|
||
<section>
|
||
<h1>Входящие {items.length > 0 && <span className="count">{items.length}</span>}</h1>
|
||
{items.length === 0 ? <p className="empty">Агентам от тебя ничего не нужно.</p> : items.map((q) => <QuestionCard key={q.id} q={q} taskKey={q.taskKey} taskStatus={q.taskStatus} back="/" />)}
|
||
</section>
|
||
<section>
|
||
<h2>Активные сессии</h2>
|
||
{sessions.length === 0 ? <p className="empty">Сейчас ничего не запущено.</p> : sessions.map((s) => <SessionCard key={s.id} s={s} back="/" />)}
|
||
</section>
|
||
<section>
|
||
<h2>Мои проекты</h2>
|
||
{projects.length === 0 ? (
|
||
<p className="empty">
|
||
Проектов пока нет. <Link href="/projects/new">Создать первый</Link>
|
||
</p>
|
||
) : (
|
||
<ul className="projects">
|
||
{projects.map((p) => (
|
||
<li key={p.id}>
|
||
<Link href={`/p/${p.key}`}>
|
||
<span className="mono">{p.key}</span> {p.name}
|
||
</Link>
|
||
<span className="muted">{p.giteaOwner}/{p.giteaRepo}</span>
|
||
</li>
|
||
))}
|
||
</ul>
|
||
)}
|
||
</section>
|
||
</>
|
||
);
|
||
}
|