Проектные каналы Slack и huddle: project_channel, режим проектного канала, промт, спецификация ассистента CEO
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -226,6 +226,32 @@ d("консольные агенты (временная БД, фейковый
|
||||
const log = await db.pool.query("select message_ts, status, sender_slack_user_id as sender from slack_message_log where message_ts like '1.%' order by message_ts");
|
||||
expect(log.rows).toEqual([{ message_ts: "1.2", status: "done", sender: "UOTHER" }, { message_ts: "1.5", status: "done", sender: "ULLMTEST" }, { message_ts: "1.6", status: "done", sender: "ULLMTEST" }]);
|
||||
});
|
||||
it("проектный канал: проект задан каналом, huddle принимается, чужой бот игнорируется", async () => {
|
||||
calls = [];
|
||||
const posted: string[] = [];
|
||||
script = [ok("## Ответ менеджеру\nответ проект llmtest\n## Память\nм7")];
|
||||
await db.pool.query("insert into project_channel (channel_id, jt_job_id, channel_name) values ('CPROJ1','llmtest-job','proj-llmtest') on conflict do nothing");
|
||||
const deps = {
|
||||
ctx: ctx(), timezone: "America/New_York",
|
||||
slack: { postMessage: async (_c: string, t: string) => { posted.push(t); return true; }, fileInfo: async () => null, download: async () => 0 },
|
||||
};
|
||||
const intake = new SlackIntake(deps, { channelIds: [], debounceMs: 600_000 });
|
||||
await intake.onEvent({ type: "message", channel: "CPROJ1", user: "UANY", ts: "2.1", text: "tile was ordered" });
|
||||
await intake.onEvent({ type: "message", channel: "CPROJ1", bot_id: "B1", ts: "2.2", text: "bot" }); // чужой бот
|
||||
await intake.onEvent({ type: "message", channel: "CPROJ1", bot_id: "B2", user: "USLACKBOT", subtype: "huddle_thread", ts: "2.3", text: "A huddle started" }); // без файлов
|
||||
await intake.onEvent({ type: "message", channel: "CPROJ1", bot_id: "B2", user: "USLACKBOT", ts: "2.4", text: "", files: [{ id: "F1", name: "huddle_transcript.json", mimetype: "application/json" }] });
|
||||
await intake.flush(MGR);
|
||||
await intake.idle();
|
||||
intake.stop();
|
||||
expect(calls).toHaveLength(1);
|
||||
const prompt = calls[0]!.prompt;
|
||||
expect(prompt).toContain("# Проектный канал");
|
||||
expect(prompt).toContain("llmtest-job");
|
||||
expect(prompt).toContain("tile was ordered");
|
||||
expect(prompt).toContain("Slack huddle");
|
||||
expect(prompt).not.toContain("A huddle started");
|
||||
expect(posted).toEqual(["ответ проект llmtest"]);
|
||||
});
|
||||
it("папка приёма Drive: файлы и текст из <folder>/<channel> становятся сообщениями чата", async () => {
|
||||
calls = [];
|
||||
const posted: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user