Ассистент: мягкий отбор сообщений Daily Log/проектов в общем канале, повтор сводки по реальному ts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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; summary?: boolean }): Promise<unknown>;
|
||||
simulate(opts: { managerId?: string; text: string; files?: string[]; publish?: boolean; summary?: boolean; summaryChannel?: string; summaryTs?: string }): 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; summary?: boolean } }>("/chat/simulate", async (req, reply) => {
|
||||
app.post<{ Body: { managerId?: string; text?: string; files?: string[]; publish?: boolean; summary?: boolean; summaryChannel?: string; summaryTs?: string } }>("/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, summary: b.summary })) });
|
||||
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, summaryChannel: b.summaryChannel, summaryTs: b.summaryTs })) });
|
||||
});
|
||||
app.post<{ Body: { kind?: string } }>("/chat/event", async (req, reply) => {
|
||||
if (!deps.chat) return reply.code(501).send({ error: "chat не настроен" });
|
||||
|
||||
Reference in New Issue
Block a user