Ассистент: сводка Daily Log по проектам из общего канала (#2-general-all)
All checks were successful
ci / test (push) Successful in 53s
ci / deploy (push) Successful in 2m52s

Разбор сводки по проектам, запись в Daily Log каждого агентом (p-daily-summary.md), ответ в тред, simulate с summary.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 08:39:46 +03:00
parent d14b424aeb
commit e716c82075
9 changed files with 312 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ import { resolveForManager, sendForManager, type MailDeps } from "./mail/service
export interface ChatApi {
/** Имитация входящего сообщения менеджера (без Slack): текст и локальные файлы; publish - слать ли ответ в Slack. */
simulate(opts: { managerId?: string; text: string; files?: string[]; publish?: boolean }): Promise<unknown>;
simulate(opts: { managerId?: string; text: string; files?: string[]; publish?: boolean; summary?: boolean }): Promise<unknown>;
/** Системное событие ассистента (напоминания 12:00/13:00/16:00 и т.п.) всем менеджерам режима. */
event(kind: string): Promise<unknown>;
/** Разовое поручение агенту менеджера от ИТ/владельца (например, применить подтверждённые изменения); ответ уходит в чат менеджера, если publish. */
@@ -129,11 +129,11 @@ export function buildApi(deps: PrepApiDeps): FastifyInstance {
);
return id;
};
app.post<{ Body: { managerId?: string; text?: string; files?: string[]; publish?: boolean } }>("/chat/simulate", async (req, reply) => {
app.post<{ Body: { managerId?: string; text?: string; files?: string[]; publish?: boolean; summary?: boolean } }>("/chat/simulate", async (req, reply) => {
if (!deps.chat) return reply.code(501).send({ error: "chat не настроен" });
const b = req.body ?? {};
if (!b.text) return reply.code(400).send({ error: "нужен text" });
return reply.code(202).send({ chatRunId: startChat(() => deps.chat!.simulate({ managerId: b.managerId, text: b.text!, files: b.files, publish: b.publish })) });
return reply.code(202).send({ chatRunId: startChat(() => deps.chat!.simulate({ managerId: b.managerId, text: b.text!, files: b.files, publish: b.publish, summary: b.summary })) });
});
app.post<{ Body: { kind?: string } }>("/chat/event", async (req, reply) => {
if (!deps.chat) return reply.code(501).send({ error: "chat не настроен" });