| 1 | # ADR 0136: Intercom — gutter номеров, явный select, namespace `/intercom` |
| 2 | |
| 3 | **Статус:** Accepted · In progress |
| 4 | **Дата:** 2026-05-20 |
| 5 | |
| 6 | ## Связанные ADR |
| 7 | |
| 8 | | ADR | Роль | |
| 9 | |-----|------| |
| 10 | | [0119](0119-chat-slash-commands-intercom-surface.md) | Слэши как CLI в composer | |
| 11 | | [0137](0137-intercom-message-code-correspondence.md) | Соответствие gutter ↔ code; infer + find / relate (Accepted) | |
| 12 | | [0126](0126-intercom-inspect-slash-and-compact-chrome-status.md) | topic/spine inspect | |
| 13 | | [0134](0134-intercom-message-prepare-pipeline-v1.md) | Attach chip, reveal | |
| 14 | | [0072](0072-chat-topic-cards-intent-melody-keyboard-contract.md) | Overview / detail | |
| 15 | |
| 16 | ## Резюме |
| 17 | |
| 18 | 1. **Номера сообщений** — gutter слева в detail-ленте (1-based в активной ветке), как line numbers в редакторе. |
| 19 | 2. **Выделение** — только **ПКМ → «Выбрать сообщение»** или `/intercom message select <n>`; **ЛКМ** не меняет `SelectedMessageIndex` (клик по attach → reveal). |
| 20 | 3. **Без фиолетовой полоски** `DrawFeedAccent` для selection; выбранная строка подсвечивается в gutter + лёгкий фон строки. |
| 21 | 4. **Слэши Intercom** — единый префикс `/intercom …`; старые `/topic`, `/spine`, `/overview`, `/attach`, `/card`, `/thread` **удаляются** (миграция не нужна). |
| 22 | |
| 23 | ## Gutter |
| 24 | |
| 25 | | Элемент | Поведение | |
| 26 | |---------|-----------| |
| 27 | | Ширина | ~36px слева от ленты | |
| 28 | | Номер | Порядковый **в активной ветке** detail-режима: 1, 2, 3… | |
| 29 | | Выбор | Подсветка ячейки gutter + фон строки при `MessageIndex == SelectedMessageIndex` | |
| 30 | | ЛКМ по gutter | Не меняет selection (как по телу) | |
| 31 | |
| 32 | ## Select |
| 33 | |
| 34 | | Способ | Действие | |
| 35 | |--------|----------| |
| 36 | | ПКМ по сообщению / gutter | Контекстное меню «Выбрать сообщение #n» | |
| 37 | | `/intercom message select <n>` | `n` или диапазон `n m` / `n:m` (как `/editor line select`); активно сообщение **m** (конец диапазона) | |
| 38 | | `/intercom message next\|prev` | Сдвиг выбора в ленте (бывш. melody / без отдельного `/thread`) | |
| 39 | | Double-click thinking | Без изменений (toggle details) | |
| 40 | |
| 41 | Attach chip: ЛКМ → только `RevealAttachment`. |
| 42 | |
| 43 | ## Namespace `/intercom` |
| 44 | |
| 45 | Примеры (канон в `intent-catalog.toml`): |
| 46 | |
| 47 | ``` |
| 48 | /intercom overview |
| 49 | /intercom show |
| 50 | /intercom topic list | list text | tree | tree text | create | open | cards |
| 51 | /intercom spine list | tree | set | show | toggle | open |
| 52 | /intercom message select | next | prev |
| 53 | /intercom attach selection | scope | file |
| 54 | ``` |
| 55 | |
| 56 | Парсер: `head=intercom`, хвост делегируется во внутренний verb; `ChatSlashCommandCatalog.TryResolve` строит полный путь через `IntercomSlashPathBuilder`. Канонический путь и args для UI/execute — [0150](0150-slash-line-canonical-resolution.md) (`SlashLineResolver`). |
| 57 | |
| 58 | ## MCP и координаты выбора |
| 59 | |
| 60 | | Канал | Параметр | Смысл | |
| 61 | |-------|----------|--------| |
| 62 | | Gutter, slash, MCP `ordinal` | 1-based | Порядок в **активной detail-ветке** (как в UI) | |
| 63 | | MCP `index` (legacy) | 0-based | Позиция в полном `ChatMessages` сессии | |
| 64 | | `chat_get_selected_message` | `selected_index` + `feed_ordinal?` | Глобальный индекс и номер gutter, если ветка открыта | |
| 65 | |
| 66 | Предпочтение для агента: `ordinal` (или `message_id` из ответа), не путать с `index`. Диапазон: `end_ordinal` (как `n:m` в slash). |
| 67 | |
| 68 | ## Последствия |
| 69 | |
| 70 | - Тесты и подсказки autocomplete — `/intercom *`. |
| 71 | - Справка: `Intercom/intercom-help.ru.md`, `MCP-PROTOCOL.md`. |
| 72 | |