Привяжите свой Telegram в Настройках: бот присылает вопросы агентов из ваших и общих проектов и «готово к ревью» с кнопками; ответ реплаем уходит прямо в сессию агента. Новые ошибки из прода приходят туда же — по политике - проекта: сообщением, стори или с кнопками «В бэклог / В работу / Игнорировать». + проекта: сообщением, стори или с кнопками «В бэклог / В работу / Игнорировать». Команды бота: /status — что + сейчас происходит, /digest — сводка за сутки. +
+ + ++ В Настройках → Уведомления для каждого события (вопросы агентов, + готово к ревью, сбои и лимиты, релизы, ошибки из прода, дайджест) выбирается, куда присылать: Telegram и/или + браузер. Тихие часы: Telegram приходит без звука, push не показываются. Снятые проекты не присылают ничего — + вопросы остаются в вебе. Push в браузере включаются там же кнопкой (Chrome спросит разрешение) и работают при + закрытой вкладке; клик открывает стори. Во вкладке Пеппы в заголовке и на значке приложения — сколько ждёт вас, + при новом вопросе звучит сигнал (если звук включён). Ежедневный дайджест приходит в выбранное время (по умолчанию + 09:00): сделано за сутки, в работе, на ревью, ждёт вас, зависло, лимиты; пустой не приходит.
+ Push приходят и при закрытой вкладке; клик открывает стори или проект. Подписано браузеров: {pushSubs.length}. Пеппу можно установить как приложение (Chrome → «Установить»). +
+Адрес сервера — подключите его как MCP-коннектор с авторизацией OAuth. Клиент зарегистрируется сам, вы подтвердите доступ на экране Пеппы.
{origin}/mcp
diff --git a/apps/web/app/api/attention/route.ts b/apps/web/app/api/attention/route.ts
new file mode 100644
index 00000000..105ad5cd
--- /dev/null
+++ b/apps/web/app/api/attention/route.ts
@@ -0,0 +1,15 @@
+import { getNotifyPrefs } from "@peppa/core";
+import { currentUser } from "@/lib/auth";
+import { db } from "@/lib/db";
+import { navCounts } from "@/lib/queries";
+
+export const dynamic = "force-dynamic";
+
+/** What waits for the signed-in user (tab title counter and app badge, PEP-55). */
+export async function GET() {
+ const user = await currentUser();
+ if (!user) return Response.json({ error: "unauthorized" }, { status: 401 });
+ const c = await navCounts(user.id);
+ const { sound } = await getNotifyPrefs(db, user.id);
+ return Response.json({ count: c.questions + c.waitingRunners, sound }, { headers: { "Cache-Control": "no-store" } });
+}
diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx
index 368ed35a..5259483f 100644
--- a/apps/web/app/layout.tsx
+++ b/apps/web/app/layout.tsx
@@ -6,7 +6,7 @@ import { cn } from "@/lib/utils";
import { THEME_COOKIE } from "@/lib/theme";
import "./app.css";
-export const metadata = { title: "Peppa", description: "Софтвейр-фабрика: проекты, стори и агенты" };
+export const metadata = { title: "Peppa", description: "Софтвейр-фабрика: проекты, стори и агенты", icons: { icon: "/icon.svg" } };
export default async function RootLayout({ children }: { children: ReactNode }) {
// Dark by default; the cookie is read on the server so a light choice renders without a dark flash.
diff --git a/apps/web/app/manifest.ts b/apps/web/app/manifest.ts
new file mode 100644
index 00000000..9a0fba3c
--- /dev/null
+++ b/apps/web/app/manifest.ts
@@ -0,0 +1,16 @@
+import type { MetadataRoute } from "next";
+
+/** Installable as an app (PEP-55): Chrome «Установить Пеппу», badge on the app icon. */
+export default function manifest(): MetadataRoute.Manifest {
+ return {
+ name: "Peppa — софтвейр-фабрика",
+ short_name: "Peppa",
+ description: "Проекты, стори и агенты",
+ start_url: "/",
+ scope: "/",
+ display: "standalone",
+ background_color: "#0a0a0a",
+ theme_color: "#0a0a0a",
+ icons: [{ src: "/icon.svg", sizes: "any", type: "image/svg+xml", purpose: "any" }],
+ };
+}
diff --git a/apps/web/components/AttentionBadge.tsx b/apps/web/components/AttentionBadge.tsx
new file mode 100644
index 00000000..b17effab
--- /dev/null
+++ b/apps/web/components/AttentionBadge.tsx
@@ -0,0 +1,78 @@
+"use client";
+
+import { useEffect, useRef } from "react";
+
+const PREFIX = /^\(\d+\) /;
+
+/** Short two-tone chime (WebAudio, no asset). Browsers allow it after any click on the page. */
+function chime() {
+ try {
+ const ctx = new AudioContext();
+ [880, 660].forEach((f, i) => {
+ const o = ctx.createOscillator();
+ const g = ctx.createGain();
+ o.frequency.value = f;
+ const t = ctx.currentTime + i * 0.16;
+ g.gain.setValueAtTime(0.0001, t);
+ g.gain.exponentialRampToValueAtTime(0.2, t + 0.02);
+ g.gain.exponentialRampToValueAtTime(0.0001, t + 0.15);
+ o.connect(g).connect(ctx.destination);
+ o.start(t);
+ o.stop(t + 0.16);
+ });
+ setTimeout(() => ctx.close(), 600);
+ } catch {}
+}
+
+/**
+ * «(N) …» in the tab title and the app badge (PEP-55): what waits for the user. Polls
+ * /api/attention; a growing count plays a chime if sound is on in the settings.
+ */
+export function AttentionBadge({ count: initial, sound: initialSound, everyMs = 20_000 }: { count: number; sound: boolean; everyMs?: number }) {
+ const count = useRef(initial);
+ const sound = useRef(initialSound);
+
+ useEffect(() => {
+ const apply = () => {
+ const base = document.title.replace(PREFIX, "");
+ const want = count.current > 0 ? `(${count.current}) ${base}` : base;
+ if (document.title !== want) document.title = want;
+ const nav = navigator as Navigator & { setAppBadge?: (n?: number) => Promise{msg}
} +