Чат руководителя (chat_kind = ceo, промт p-ceo-assistant, ответ в разделе «Ответ Arthur»); блоки входа и правило про todo - всем версиям, необязательные фрагменты; тесты; docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ export function rowToManager(r: Record<string, unknown>): ManagerInfo {
|
||||
slackChannelId: (r.slack_channel_id as string | null) ?? null,
|
||||
replyMode: isReplyMode(r.reply_mode) ? r.reply_mode : "text",
|
||||
ttsVoice: (r.tts_voice as string | null) ?? null,
|
||||
chatKind: r.chat_kind === "ceo" ? "ceo" : "manager",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ export class SlackIntake {
|
||||
|
||||
async findManagerBySlackUser(slackUserId: string): Promise<ManagerInfo | null> {
|
||||
const { rows } = await this.pool.query(
|
||||
`select cm.person_id, p.display_name, cm.slack_user_id, cm.slack_channel_id, cm.reply_mode, cm.tts_voice
|
||||
`select cm.person_id, p.display_name, cm.slack_user_id, cm.slack_channel_id, cm.reply_mode, cm.tts_voice, cm.chat_kind
|
||||
from construction_manager cm join person p on p.id = cm.person_id
|
||||
where cm.slack_user_id = $1 and cm.is_active and p.is_active`,
|
||||
[slackUserId],
|
||||
@@ -119,7 +120,7 @@ export class SlackIntake {
|
||||
|
||||
async findManagerByPerson(personId: string): Promise<ManagerInfo | null> {
|
||||
const { rows } = await this.pool.query(
|
||||
`select cm.person_id, p.display_name, cm.slack_user_id, cm.slack_channel_id, cm.reply_mode, cm.tts_voice
|
||||
`select cm.person_id, p.display_name, cm.slack_user_id, cm.slack_channel_id, cm.reply_mode, cm.tts_voice, cm.chat_kind
|
||||
from construction_manager cm join person p on p.id = cm.person_id where cm.person_id = $1 limit 1`,
|
||||
[personId],
|
||||
);
|
||||
@@ -129,7 +130,7 @@ export class SlackIntake {
|
||||
/** Менеджер чата (по slack_channel_id или единственный активный менеджер для каналов из настроек). */
|
||||
async findManagerByChannel(channel: string): Promise<ManagerInfo | null> {
|
||||
const { rows } = await this.pool.query(
|
||||
`select cm.person_id, p.display_name, cm.slack_user_id, cm.slack_channel_id, cm.reply_mode, cm.tts_voice
|
||||
`select cm.person_id, p.display_name, cm.slack_user_id, cm.slack_channel_id, cm.reply_mode, cm.tts_voice, cm.chat_kind
|
||||
from construction_manager cm join person p on p.id = cm.person_id
|
||||
where cm.slack_channel_id = $1 and cm.is_active and p.is_active order by cm.person_id limit 1`,
|
||||
[channel],
|
||||
|
||||
Reference in New Issue
Block a user