@besales/mcp 0.28.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +6 -2
  2. package/dist/instructions/server-instructions.d.ts +1 -1
  3. package/dist/instructions/server-instructions.js +14 -0
  4. package/dist/instructions/server-instructions.js.map +1 -1
  5. package/dist/resources/docs/crm-integration.md +2 -2
  6. package/dist/resources/workflows/audit-dialogues.md +12 -0
  7. package/dist/resources/workflows/compare-models.md +1 -1
  8. package/dist/schemas/mcp-tools.json +2315 -1251
  9. package/dist/tools/definitions/broadcast-analytics.d.ts +26 -0
  10. package/dist/tools/definitions/broadcast-analytics.js +89 -0
  11. package/dist/tools/definitions/broadcast-analytics.js.map +1 -0
  12. package/dist/tools/definitions/dialogue-export.js +8 -1
  13. package/dist/tools/definitions/dialogue-export.js.map +1 -1
  14. package/dist/tools/definitions/follow-up.d.ts +84 -0
  15. package/dist/tools/definitions/follow-up.js +161 -0
  16. package/dist/tools/definitions/follow-up.js.map +1 -0
  17. package/dist/tools/definitions/knowledge.d.ts +2 -2
  18. package/dist/tools/definitions/model-comparison.js +1 -1
  19. package/dist/tools/definitions/platform-setup.d.ts +74 -0
  20. package/dist/tools/definitions/platform-setup.js +286 -1
  21. package/dist/tools/definitions/platform-setup.js.map +1 -1
  22. package/dist/tools/definitions/scheduled-tasks.d.ts +24 -0
  23. package/dist/tools/definitions/scheduled-tasks.js +124 -0
  24. package/dist/tools/definitions/scheduled-tasks.js.map +1 -0
  25. package/dist/tools/definitions/shared.d.ts +9 -0
  26. package/dist/tools/definitions/shared.js +34 -0
  27. package/dist/tools/definitions/shared.js.map +1 -1
  28. package/dist/tools/definitions.d.ts +131 -2
  29. package/dist/tools/definitions.js +6 -0
  30. package/dist/tools/definitions.js.map +1 -1
  31. package/docs/host-setup.md +3 -3
  32. package/package.json +2 -2
  33. package/CHANGELOG.md +0 -531
package/CHANGELOG.md DELETED
@@ -1,531 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `@besales/mcp` are documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and the project aims to follow [Semantic Versioning](https://semver.org/).
7
-
8
- > **Versioning.** Under 0.x SemVer a breaking change bumps the minor version (not
9
- > major). Minors have carried breaking changes: `0.2.0` removed deprecated MCP tool
10
- > shapes (Phase B hard break, 2026-05-27); `0.3.0` removed the `CredentialReader` /
11
- > `CredentialStorage` exports and `ToolApiClient.getStoredWorkspaceId()`.
12
- > `package.json` tracks the latest released version.
13
-
14
- The tool counts below are derived from `src/schemas/mcp-tools.json`
15
- (`tools.length`) at each milestone commit and are asserted in
16
- `src/tools/registry.spec.ts`. The active toolset grew from 18 → 138.
17
-
18
- ## [Unreleased]
19
-
20
- ### Changed
21
-
22
- - `besales_crm_pipeline_status_update` получил optional `is_system_managed` —
23
- master-переключатель «Управляется системой» из Pipeline Builder UI. Локальные настройки
24
- статуса не вызывают пустой PATCH во внешний CRM. Tool count не изменился.
25
-
26
- - `besales_getcourse_wave_import` синхронизирован с аналитикой запусков: `funnel` теперь явно
27
- означает каноническую бизнес-воронку, а имя конкретного запуска передаётся отдельно через
28
- `cohort_label`. Добавлены `message_variant`, `found_count` и per-contact timestamps
29
- `segment_entered_at` / legacy `lead_last_active_at`; все поля валидируются и маппятся в v2 API.
30
- Tool count не изменился.
31
-
32
- ## 0.26.0
33
-
34
- - `product_code` валидируется zod-паттерном `^[^\s/]+# Changelog
35
-
36
- All notable changes to `@besales/mcp` are documented in this file.
37
-
38
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
39
- and the project aims to follow [Semantic Versioning](https://semver.org/).
40
-
41
- > **Versioning.** Under 0.x SemVer a breaking change bumps the minor version (not
42
- > major). Minors have carried breaking changes: `0.2.0` removed deprecated MCP tool
43
- > shapes (Phase B hard break, 2026-05-27); `0.3.0` removed the `CredentialReader` /
44
- > `CredentialStorage` exports and `ToolApiClient.getStoredWorkspaceId()`.
45
- > `package.json` tracks the latest released version.
46
-
47
- The tool counts below are derived from `src/schemas/mcp-tools.json`
48
- (`tools.length`) at each milestone commit and are asserted in
49
- `src/tools/registry.spec.ts`. The active toolset grew from 18 → 138.
50
-
51
- (после `.trim()`, чтобы не быть строже бэкенда на краевых пробелах); `pattern` продублирован в обеих копиях `mcp-tools.json` и в OpenAPI-контракте. Поведенческий тест в `registry.spec.ts`.
52
-
53
- - `besales_getcourse_wave_import`: новые опциональные поля `product_code` / `product_name` — привязывают воронку волны к продукту справочника «воронка → продукт» (аналитика рассылок). Правило create-if-absent: уже замапленная воронка НЕ перезаписывается, конфликты возвращаются в `productMapping` ответа. `product_code` требует `funnel`; `product_name` без кода → 400. Не путать с `preflight.product_title` (сверка оплат).
54
-
55
- ## [0.25.0] — 2026-07-09
56
-
57
- ### Added
58
-
59
- - **`output_config.response_mode` в `besales_agent_update` — «тихий режим» агента (tool count unchanged, 143).**
60
- Новое поле `response_mode: TEXT | SILENT` (backend `AgentChat.responseMode`): SILENT-агент
61
- не отправляет ответы в канал, но полностью выполняет триггеры/действия (CRM, заметки,
62
- вебхуки; исключение — `GETCOURSE_SEND_PAYMENT_LINK`, у тихого агента пропускается целиком,
63
- включая создание заказа в GetCourse). Неотправленные ответы сохраняются в истории чата
64
- с пометкой «[Тихий режим — не отправлено]». Правки: Zod `agentOutputConfigSchema` +
65
- `mapOutputConfigInput` + advertisement в `mcp-tools.json` (обе копии синхронно, codegen
66
- не запускался). Read-back — `responseMode` в `Agent` (`besales_agent_list` /
67
- `besales_platform_context_get`).
68
-
69
- ## [0.24.0] — 2026-07-06
70
-
71
- ### Added
72
-
73
- - **`besales_agent_clone` — deep-clone AgentChat на той же платформе (142 → 143 tools).**
74
- Зеркало GUI-кнопки «клонировать»: `POST /api/v2/platforms/:platformId/agents/:agentId/clone`,
75
- scope `mcp:platform-setup`. Копирует baseSystemPrompt (+prompt-линковку NULL → PromptHub
76
- bootstrap), knowledge namespaces, модель/tools/переменные, ICP-линки и ВСЕ триггеры+действия;
77
- НЕ копирует routing rules и per-platform `AgentBehavior` (клон инертен до привязки к роутеру).
78
- cross-platform не поддержан. Increment 21.
79
- - **`besales_getcourse_wave_import.check_messenger_presence` (optional, default TRUE) — 0 new tools.**
80
- На Шаге 1 отсеивает контакты без мессенджера (Telegram/Max/VK): не импортируются и не уходят в
81
- волну (число — в `contactsSkippedNoMessenger`). Проверка = API-вызов на КАЖДЫЙ контакт, запуск
82
- синхронно ждёт Шаг 1 → для БОЛЬШИХ когорт (сотни) риск таймаута клиента: тогда `false` + сначала
83
- backfill `POST /chat-users/import/getcourse-refresh-messengers`. Contract↔zod parity.
84
-
85
- ## [0.21.0] — 2026-06-26
86
-
87
- ### Added
88
-
89
- - **External API channel provisioning — 4 direct tools (134 → 138 tools).**
90
- `besales_external_api_channel_create` / `_rotate_key` / `_rotate_secret` / `_update` —
91
- провижининг открытого партнёрского relay-канала `ExternalApi` через MCP (зеркало
92
- `besales_crm_activate`): direct POST/PATCH на `/api/v2/workspaces/:workspaceId/external-api-channels`,
93
- scope `mcp:platform-setup`, `defaultWorkspaceId`. `create` возвращает `{ channelId, apiKey,
94
- webhookSecret, ingestPath }` — apiKey (Bearer входящих партнёра) и webhookSecret (HMAC-подпись
95
- наших колбэков) показываются ОДИН раз; `_rotate_key` / `_rotate_secret` перевыпускают их (старое
96
- инвалидируется немедленно); `_update` меняет несекретные `callback_url` / `source_channel`.
97
- Канал также провиженится из UI (front-aniomaly `AddPlatformPage` / `PlatformPage`) и принимает
98
- входящие на `POST /api/v2/channels/:channelId/messages` (Bearer bsl-ключ) → AI → HMAC-колбэк
99
- (`message.reply`; проактивный follow-up — `message.followup` без `requestId`). Новый
100
- `src/tools/definitions/external-api-channels.ts` + записи в `mcp-tools.json`; contract↔zod parity
101
- (`registry.spec.ts` / `server.spec.ts` → 138).
102
-
103
- ## [0.20.0] — 2026-06-25
104
-
105
- ### Added
106
-
107
- - **`besales_agent_variable_overrides_get` — read-only текущие перезаписи переменных агента (133 → 134 tools).**
108
- `GET /platforms/:platformId/agents/:agentId/variable-overrides` (workspace-scoped) → `{ workspaceOverrides[],
109
- customOverrides[] }`: для каждой перезаписи — id переменной + `name` + `type` + `overrideValue`.
110
- `workspaceOverrides` — перезаписи `WorkspaceVariable` (референс `{{{name}}}`), `customOverrides` —
111
- платформенной `CustomVariable` (`{name}`). Закрывает асимметрию: перезаписи через MCP можно было
112
- ЗАПИСАТЬ (`besales_agent_update.agent_variable_overrides` / `agent_workspace_variable_overrides`), но не
113
- ПРОЧИТАТЬ (read-back существовал только GUI-эндпоинтом под `JwtAuthGuard`). Эти поля заменяют набор
114
- ЦЕЛИКОМ (`replaceForAgent` = delete отсутствующих + upsert присланных), поэтому read-back обязателен,
115
- чтобы не затереть уже выставленную перезапись (напр. `registration_link`): прочитал → добавил новые →
116
- переотправил весь набор. Backend: `getAgentVariableOverrides` в `platform-setup-adapter` (+spec).
117
-
118
- ## [0.18.0] — 2026-06-23
119
-
120
- ### Fixed
121
-
122
- - **`besales-mcp connect` — печатает authorization URL и не падает, если браузер не открылся
123
- (0 new tools).** Раньше `connect` молча полагался на авто-открытие браузера (пакет `open`) и сам URL
124
- **не печатал** — если браузер не открывался (WSL / RDP / нет дефолтного браузера / тихий фейл `open`),
125
- пользователь висел до 5-минутного таймаута, и **открыть ссылку вручную было нечем**. Теперь CLI
126
- **печатает authorization URL перед ожиданием** колбэка (открой вручную, если авто-открытие не
127
- сработало) и **не прерывает флоу при ошибке авто-открытия** — продолжает ждать колбэк (до 5 мин), пока
128
- ты завершаешь вход по напечатанной ссылке. Добавлен опциональный hook `OauthClient.onAuthorizationUrl(url)`
129
- (CLI печатает URL через него). Особенно важно на Windows/WSL, где авто-открытие браузера часто молчит.
130
-
131
- ## [0.15.0] — 2026-06-15
132
-
133
- ### Added
134
-
135
- - **`besales_trigger_delete` — удаление триггера агента через MCP (130 → 131 tools).** Destructive:
136
- `explicit_confirmation: true` обязателен (паттерн `besales_crm_pipeline_delete`); маршрут
137
- `DELETE /platforms/:platformId/agents/:agentId/triggers/:triggerId`. Audit пишет **non-reversible**
138
- запись со снапшотом before (для ручного восстановления) — faithful recreate вложенного дерева
139
- действий+конфигов отложен (как `revertClone`), safety = подтверждение.
140
-
141
- ### Changed
142
-
143
- - **`besales_trigger_upsert` — `replace_actions: true` снимает запрет на замену действий существующего
144
- триггера.** Раньше PATCH с `actions` отвергался (additive-only, «не правится через MCP»); теперь с явным
145
- `replace_actions=true` действия заменяются целиком (delete-and-recreate через ядровый `updateTrigger`,
146
- как в UI). Без флага — прежнее поведение (отказ, защита от случайной потери соседних действий).
147
- enhanceResponse напоминает: прочитай текущие действия (`besales_platform_context_get`) и передай
148
- ПОЛНЫЙ набор, а не дельту. Закрывает «правка triggers/actions только через UI» (напр. смена searchMode
149
- у DATA_SOURCE_READ-действия). Backend: `replaceActions` opt-in в `besales_trigger_upsert` PATCH +
150
- новый `DELETE` в platform-setup-adapter (ai-aniomaly), audit non-reversible со снапшотом.
151
-
152
- ## [0.14.0] — 2026-06-12
153
-
154
- ### Added
155
-
156
- - **`url_handling.use_youtube_data_api` — опциональный флаг обогащения YouTube-ссылок (0 new tools, 130).**
157
- `besales_behavior_update` через типизированную секцию `url_handling` принимает `use_youtube_data_api: boolean`.
158
- Когда влючён и `behavior` — non-terminal (`PASS_THROUGH`/`PROCESS_WITH_CRAWLER`), backend на YouTube-ссылку
159
- дёргает YouTube Data API v3 (`videos.list?part=snippet`) и подмешивает title/description/tags **текстом** в
160
- контекст LLM (само видео не смотрится). `SILENT`/`FIXED_RESPONSE` флаг не вскрывает. Backend остаётся no-op,
161
- пока в env не задан `YOUTUBE_DATA_API_KEY`. Маппер `mapBehaviorUrlHandlingInput` протаскивает snake→camel
162
- (`use_youtube_data_api` → `useYoutubeDataApi`). Контракты (`mcp-tools.json` url_handling + openapi
163
- `BehaviorUrlHandlingJson`) и сгенерированные типы синхронизированы. Tool counts без изменений (130).
164
- - **Тест маппера** `mapBehaviorUrlHandlingInput` (`shared.spec.ts`): snake→camel, сохранение `false`,
165
- дроп `undefined` (189 → 192 теста).
166
-
167
- ### Changed
168
-
169
- - **Point-of-action nudge для ГЕНЕРАЦИИ промпта (0 new tools, 130) — завершает набор симметричных nudge'ей.**
170
- `besales_prompt_generate_get_instructions` теперь ПЕРВОЙ инструкцией велит свериться с
171
- `besales://docs/prompt-anatomy` (лимит длины + что система добавляет сама) и `besales://docs/prompt-principles`
172
- (человечность/анти-AI-tell + sales-плейбук + раздел C: майнить реальные диалоги операторов) — форму/тактику
173
- брать из ресурсов, не из догадок. Раньше это жило только в serverInstructions (session-level, легко дрейфит
174
- к моменту генерации); теперь напоминание есть в точке действия — как у `prompt_patch_commit` (0.12.0) и
175
- `dialog_script_update`. Backbone Фаза 4a (serverInstructions) тоже получила указатель «ПЕРЕД генерацией
176
- читай anatomy + principles». Чистый instruction-текст, схемы/счётчики без изменений.
177
-
178
- ### Fixed
179
-
180
- - **Контракт `mcp-tools.json` досинхронизирован с `src/schemas` (7 comm-resources + расширенное описание
181
- `prompt-principles`, добавленные в Increment 13 только в `src/schemas`).** Контракт-источник отставал на
182
- 23 ресурса → `yarn types:gen:mcp` (`cp` contract→src/schemas) ронял 7 comm-ресурсов и валил
183
- `registry.spec`/`server.spec` (ждут 30). Теперь контракт == src/schemas → codegen идемпотентен.
184
- `api-contract.gen.ts` (`BehaviorUrlHandlingJson`) тоже получил `useYoutubeDataApi` руками (telephony-дрейф
185
- в этом неиспользуемом файле не трогали).
186
-
187
- ## [0.13.0] — 2026-06-10
188
-
189
- ### Added
190
-
191
- - **7 comm-skill ресурсов `besales://docs/comm-*` (0 new tools, 130; 23 → 30 resources).** Глубокие
192
- тематические разборы 97 боевых диалогов (Партии 1+3 разметки Антона): first-touch / discovery /
193
- objections-price / handoff-close / followups / anti-robot / tone-register — второй слой к always-on
194
- `besales://docs/prompt-principles` (расширен до A33/B39). Source of truth:
195
- `docs/dialog-corpus/deep/comm_*.md` (animaly), синк markdown-копий — `scripts/sync-comm-skills.sh`.
196
-
197
- ## [0.12.0] — 2026-06-10
198
-
199
- ### Changed
200
-
201
- - **«Скрипт диалога» — loose-связь со §6 (снята жёсткая сцепка `§6 = render(скрипт)`).** Скрипт
202
- (`dialogScript`) теперь SUMMARY/скелет диалога, а §6 промпта создаётся агентом НА ЕГО ОСНОВЕ, но
203
- богаче и независима — после создания расходятся, ничего не перетирается автоматически. Источник
204
- истины для рантайма — промпт. `besales_dialog_script_*` описания + serverInstructions Фаза 3/4a +
205
- workflow `platform-setup-from-scratch` переформулированы под loose-модель (§6 пиши на основе скрипта,
206
- подробнее; после правки §6 — обнови скрипт-summary). Симметричный point-of-action nudge: `besales_prompt_patch_commit`
207
- при коммите правки промпта напоминает обновить скрипт-summary, если правка затронула этапы/ветки/переходы
208
- (а не тон/факты) — связь loose, авто-синка нет.
209
- - **serverInstructions hygiene: восстановлено правило «сохраняй маркеры §6 при правке».** Маркеры
210
- `Ветка X. / [этап:] / [тег:] / →` активно парсит `coverage_check` (покрытие тест-сценариев) +
211
- fallback-парсер — это НЕ только legacy. Убран ошибочный «silent-revert warning» (правка §6 больше
212
- не откатывается — сцепки нет). Tool counts без изменений (130).
213
-
214
- ### Fixed
215
-
216
- - **`besales_test_scenario_generate_get_instructions`: дрейф «1-4 turns» → «минимум 4 turns».**
217
- Backend (JSON-схема `minItems:4` + DTO + service-валидация) требует ≥4 turns на сценарий —
218
- старая инструкция «1-4 turns» вела к 400 на submit при 1-3 turns. Заодно добавлена краткость
219
- client-реплик: мессенджер-стиль 3-15 слов, стиль из languageStyle сегмента/persona (синхронно
220
- с backend-инструкциями scenario_builder и тестер-промптом симуляции prompt-services).
221
-
222
- ## [0.11.0] — 2026-06-10
223
-
224
- ### Added
225
-
226
- - **«Скрипт диалога» как отдельная хранимая сущность (+2 tools, 128 → 130).** `besales_dialog_script_get`
227
- (read структурного скрипта из поля `dialogScript`) + `besales_dialog_script_update` (записать/поправить
228
- граф: этапы/ветки/реплики/переходы). Инверсия источника правды: `dialogScript` (поле на агенте) =
229
- source of truth, §6 «Скрипт диалога» в промпте рендерится ИЗ него детерминированно при генерации
230
- (`besales_prompt_generate`). Скрипт и промпт — отдельные шаги.
231
-
232
- ### Changed
233
-
234
- - **serverInstructions Фаза 3/4 reframe.** «Скрипт» теперь отдельная хранимая сущность (не «секция промпта»):
235
- на 4a после `besales_agent_create` → `besales_dialog_script_update` (структура ДО промпта) →
236
- `besales_prompt_generate` (§6 рендерится из поля). Hygiene §6-маркеров остаётся валидной для legacy/ручных правок.
237
-
238
- ## [0.10.1] — 2026-06-09
239
-
240
- ### Changed
241
-
242
- - **Приветствие на создании агента — только текст, кнопки opt-in.** Уточнена guidance
243
- (0 новых tools/resources): на фазе 4 (Build&Prove) из секций `besales_behavior_update`
244
- ставится ТОЛЬКО `greeting.bot_greeting` текстом (язык аудитории, открывает INBOUND-диалог) —
245
- это единственная behavior-секция при создании, остальной behavior (typing/media/splitting/
246
- operator_schedule/privacy) откладывается на фазу 5 (Enrich). `greeting_buttons` —
247
- **opt-in**: добавляются лишь по явному запросу пользователя (кнопки дают menu-feel, против
248
- принципа «звучит как человек»). Синхронно: `SERVER_INSTRUCTIONS` (фаза 4a + golden rule 7),
249
- workflow `platform-setup-from-scratch`, doc-bridge `besales://docs/agent-behavior` (§6,
250
- MCP-operator-пометка), success-сообщение `besales_prompt_finalize`. Требует reconnect MCP-хоста.
251
- (2026-06-09)
252
-
253
- ## [0.10.0] — 2026-06-09
254
-
255
- ### Changed
256
-
257
- - **Оркестрация: пайплайн-модель переписана на 6 фаз `1–6`** (1 Connect · 2 Discover ·
258
- 3 Author · 4 Build&Prove · 5 Enrich · 6 Activate) взамен прежней `0/A–E`. `SERVER_INSTRUCTIONS`
259
- и workflow `platform-setup-from-scratch` теперь ведут пользователя по фазам (директивнее, но
260
- гибко: любое действие в любой момент → возврат в пайплайн) + сквозные правила: тест-рефлекс на
261
- каждую версию промпта, Google-Sheets feedback-loop (`besales_feedback_sheet_*`), выбор модели
262
- только в фазе 4, тестирование мультиагент+роутер (`mode=single_agent` + `mode=workflow`),
263
- ленивая CRM. **0 новых tools, 0 новых resource-файлов** (orchestration-only — правит контент
264
- существующих ресурсов/инструкций) — поверхность 128 tools / 23 resources. (2026-06-09)
265
- - **`besales_workspace_overview.setupCompleteness.suggestedNextPhase` — значения `0/A–E` → `1–6`**
266
- (contract-изменение enum в `openapi-besales-api.yaml`; регенерён `api-contract.gen.ts`). Эвристика
267
- эмитит `{1,4,5,null}`; reorder — «prove» (sandbox, фаза 4) проверяется до «enrich» (knowledge,
268
- фаза 5). MCP релеит значение прозрачно (логика не ветвится на нём).
269
-
270
- ### Notes
271
-
272
- - Канонич. источник модели — `docs/specs/v1.5/10-agent-orchestration-layer.md` §4/§4.1.
273
- - Требует **перезапуск / reconnect MCP-хоста** — running-процесс держит старые instructions/resources.
274
-
275
- ## [0.9.1] — 2026-06-09
276
-
277
- ### Added
278
-
279
- - **`besales_behavior_update` — секция `privacy`** — typed-секция
280
- `privacy: { anonymization_enabled }` включает обратимую PII-анонимизацию
281
- LLM-пайплайна (per-platform флаг `AgentBehavior.anonymizationEnabled`: реальные
282
- имя/телефон/email вырезаются перед отправкой в LLM и подставляются обратно в ответ
283
- и аргументы tool-call). Проксируется на v2-эндпоинт
284
- `PATCH /api/v2/platforms/:platformId/agent-behavior` (схема `BehaviorPrivacyJson`).
285
- Новых tool'ов нет — toolset остаётся 128, resources 23. (2026-06-09)
286
-
287
- ## [0.9.0] — 2026-06-08
288
-
289
- ### Added
290
-
291
- - **Data sources — 1С provisioning + management (9 tools)** —
292
- `besales_datasource_create_init` / `_create_status` (Setup URL pattern: пароль
293
- OData вводится в браузере на `/setup/:ref`, минуя чат), `_list`, `_health`,
294
- `_catalogs`, `_catalog_roles`, `_role_assign` (one-role-per-object: PRODUCT_CATALOG
295
- /STOCK/PRICE/ORDER/CUSTOMER/OTHER), `_enable` (вкл/выкл подключение), `_vectorize`
296
- (семантический поиск по каталогу товаров → Pinecone). Категория «БД»: 1С — товарная
297
- БД через OData; чтение/запись данных агент делает через ДЕЙСТВИЯ ТРИГГЕРОВ
298
- (`DATA_SOURCE_READ` / `DATA_SOURCE_WRITE`), а не через MCP-tools или tools агента —
299
- у агента остаются ровно 3 attachable tool (`run_trigger` / `send_pic` / `call_qa`).
300
- Проксируют v2-адаптер `/api/v2/.../data-sources` + `datasource-setup-sessions`.
301
- Tool count 119 → 128, resources 22 → 23 (+workflow `connect-datasource-from-scratch`). Scope: `mcp:platform-setup`.
302
- (2026-06-08)
303
-
304
- ## [0.8.0] — 2026-06-06
305
-
306
- ### Added
307
-
308
- - **Model comparison — «model bake-off» (4 tools)** — `besales_model_catalog_list`,
309
- `besales_model_comparison_run_start`, `besales_model_comparison_get`,
310
- `besales_model_comparison_eval_submit`. On-demand сравнение промпта на нескольких
311
- моделях: один и тот же набор persona-диалогов гоняется на N моделях (модель агента
312
- варьируется, тестер фиксирован — apples-to-apples), бэкенд считает per-model
313
- детерминированные метрики, оператор-ИИ судит победителя и фиксирует вердикт через
314
- eval-submit. Internal prompt-services-операция (не external dual-mode). Новый
315
- workflow-ресурс `besales://workflows/compare-models` + строка в serverInstructions.
316
- Tool count 115 → 119, resources 21 → 22. (2026-06-06)
317
-
318
- ### Fixed
319
-
320
- - Сверена loose-canonical `docs/specs/v2/contracts/mcp-tools.json` (была 114/20) с
321
- проверенным `src/schemas`-базисом (115/21) ПЕРЕД добавлением: `besales_crm_list` +
322
- ресурс `besales://docs/prompt-principles` были в src, но отсутствовали в loose —
323
- следующий `types:gen:mcp` откатил бы src. (2026-06-06)
324
-
325
- ### Changed
326
-
327
- - **serverInstructions golden rule #6 + `besales_workbook_inspect` response instructions** —
328
- теперь явно требуют: (1) пройти по содержимому ВСЕХ вкладок и не заявлять «этого нет в файле»,
329
- пока не сверился с каждой (`google_sheets_url` inspect читает все вкладки server-side без обрезки —
330
- использовать его, а не `read_file_content`, который молча режет большие многотабовые файлы);
331
- (2) если источник на языке, отличном от языка диалога с пользователем — ПЕРЕД загрузкой в
332
- RAG/промпт/ICP дать пользователю краткое саммари на его языке (что нашёл, что внедряешь;
333
- по цифрам/процентам/условиям — подтверждение). Docs-only, без новых tools, tool count без изменений.
334
- Спека-зеркало: `docs/specs/v1.5/10-agent-orchestration-layer.md` §3. (2026-06-04)
335
-
336
- ## [0.7.0] — 2026-06-03
337
-
338
- ### Added
339
-
340
- - **`install:claude-desktop --name <server> --workspace <uuid>`** — writes an
341
- env-pinned named `mcpServers` entry (with a timestamped config backup), so each
342
- workspace gets its own server with tools namespaced `mcp__<server>__besales_*`.
343
- The pin lives in the host config, so it **survives MCP reconnects and never
344
- silently drifts** — the durable way to run several workspaces concurrently in a
345
- GUI host (Claude Desktop), unlike the in-memory `besales_workspace_use`. With no
346
- flags the command still installs the local-dev `besales` server as before. Not
347
- an MCP tool — tool count unchanged at 114. (2026-06-03)
348
-
349
- ## [0.6.0] — 2026-06-03
350
-
351
- ### Added
352
-
353
- - **CRM activation tool** — `besales_crm_activate({ crm_id })` activates a CRM
354
- (live token check + deactivates the other workspace CRMs + enables linked
355
- triggers). Closes the gap where MCP could connect a CRM but not enable it
356
- (activation used to be UI-only). Tool count 113 → 114.
357
- - **CRM provisioning auto-activation** — on `READY`, AmoCRM auto-activates when it
358
- is the workspace's only CRM (the long-lived token is live-validated during
359
- activation). If another CRM is already active it stays inactive — switch with
360
- `besales_crm_activate` (no silent clobber).
361
- - **Connect-CRM workflow resource** — `besales://workflows/connect-crm-from-scratch`:
362
- operational steps to connect each CRM (AmoCRM long-lived token, where to find
363
- sub_domain/client_id/secrets, the scopes needed for call-audio export, and
364
- activation). Resource count 19 → 20.
365
-
366
- ### Changed
367
-
368
- - **All CRM fields are entered on the setup page** — `besales_crm_create_init.fields`
369
- is now optional; the non-secret fields (sub_domain / client_id / domain /
370
- account_domain / forum_group_id) are entered by the human on `/setup/:ref`
371
- alongside the secrets, so even non-secret IDs no longer pass through the chat.
372
- Init now also returns `required_non_secret_fields`.
373
- - **serverInstructions golden rule #8** — operational instructions must come from
374
- MCP resources / a tool's `instructions`, never from the platform source code.
375
- - **`besales://docs/crm-integration`** — §7 now distinguishes AmoCRM OAuth (UI)
376
- from MCP long-lived-token provisioning (it previously read as OAuth-only).
377
-
378
- ## [0.5.0] — 2026-06-03
379
-
380
- ### Added
381
-
382
- - **Per-session workspace binding for GUI hosts** — `besales_workspace_use`
383
- (bind THIS session to a workspace, in-memory) and `besales_workspace_current`
384
- (show the binding + source, list connected workspaces). Each host session runs
385
- its own `besales-mcp` process, so the binding is per-session and touches neither
386
- the global `active` nor other sessions — the answer for Claude Desktop "new
387
- session", where `BESALES_WORKSPACE_ID` cannot be set per session. Not persisted
388
- (a fresh session starts on `active`; re-bind when needed); refused under a
389
- `BESALES_WORKSPACE_ID` pin. Resolution precedence is now env → explicit
390
- `workspace_id` → session binding → active → sole. Tool count 111 → 113.
391
- (2026-06-03)
392
-
393
- ## [0.4.0] — 2026-06-02
394
-
395
- ### Added
396
-
397
- - **ICP read tools (4)** — `besales_icp_list`, `besales_icp_get`,
398
- `besales_icp_scenarios_list`, `besales_icp_sample_messages`. Read-only wrappers
399
- over the existing `GET /api/v2/icp/*` endpoints, so a host can read live ICP
400
- data (profile + segments + personas + recent samples; test scenarios; sample
401
- dialogue messages). Previously only `besales_workspace_overview` summary counts
402
- were exposed — there was no way to read the actual segment/persona/scenario/
403
- dialogue content through MCP. No backend or OpenAPI change (the GET routes and
404
- contract already existed). Tool count 107 → 111. (2026-06-02)
405
-
406
- ## [0.3.0] — 2026-06-02
407
-
408
- ### Added
409
-
410
- - **Multiple workspaces in one keychain** — `connect` now *appends* a key per
411
- workspace instead of overwriting, so several workspaces (even across accounts)
412
- coexist. New commands: `connections` (list + active marker), `use <workspaceId>`
413
- (set the active default), `disconnect <workspaceId>` / `disconnect --all`. Bare
414
- `disconnect` now removes only the active workspace (was: clear everything).
415
- (2026-06-02)
416
- - **Per-session workspace pinning** — `BESALES_WORKSPACE_ID` env var binds a host
417
- session to one workspace and overrides the global active pointer. Per-call
418
- resolution precedence: env → explicit `workspace_id` → active → sole connection.
419
- A mismatching explicit `workspace_id` under a pinned env var is refused.
420
- (2026-06-02)
421
- - **Automatic legacy migration** — a pre-0.3 single-workspace connection
422
- (`api_key` + `workspace_id`) is folded into the multi-workspace store on the
423
- first storage command or tool call; no reconnect needed. (2026-06-02)
424
-
425
- ### Changed
426
-
427
- - `besales_*` tool calls resolve their workspace key per call from the connection
428
- store. `workspace_id` argument descriptions now read "defaults to the workspace
429
- bound to this session (BESALES_WORKSPACE_ID or active connection)". No tool
430
- schema changes. (2026-06-02)
431
-
432
- ### Removed
433
-
434
- - Public exports `CredentialReader`, `CredentialStorage`, and the
435
- `ToolApiClient.getStoredWorkspaceId()` method — the HTTP client now takes the
436
- api key per request instead of reading a single stored key. (2026-06-02)
437
-
438
- ## [0.2.0] — 2026-05-29
439
-
440
- ### Added
441
-
442
- - **OAuth PKCE platform provisioning** — `besales_platform_create_oauth_init`
443
- opens the browser authorization flow for Instagram/Avito so the OAuth code
444
- never passes through the LLM. (`d4d2c3d`, 2026-05-29)
445
- - **AmoCRM / Bitrix24 connection via browser-secrets** — `besales_crm_create_init`
446
- now also provisions AmoCRM and Bitrix24 (credentials pasted in the browser, not
447
- the chat), and `besales_crm_operator_update` toggles operators. Tool count
448
- 92 → 95 → 105 → **107**. (`d4d2c3d`, 2026-05-29)
449
- - **Increment 5 — files + platform/CRM provisioning (10 tools)** — file upload
450
- flow (`besales_file_upload_request` / `_upload_status` / `besales_file_list`,
451
- 5a), platform provisioning (`besales_platform_create_init` / `_create_status`,
452
- 5b), and CRM connection + field mapping + operators
453
- (`besales_crm_create_*`, `besales_crm_field_mapping_*`,
454
- `besales_crm_operator_*`, 5c). All use the Setup URL pattern for sensitive
455
- input. Tool count 95 → 105. (`d4882f1`, 2026-05-29)
456
- - **Increment 4d — platform clone (3 tools)** —
457
- `besales_platform_clone_preview` / `_execute` / `_status` plus safety
458
- hardening. Tool count 92 → 95. (`a10ec46`, 2026-05-28)
459
- - **Increment 4b — CRM pipelines, statuses, platform link (11 tools)** —
460
- `besales_crm_pipeline_*` (5), `besales_crm_pipeline_status_*` (4),
461
- `besales_platform_pipeline_link` / `_unlink` (2). Tool count 81 → 92.
462
- (`144a7bf`, 2026-05-27)
463
- - **Increment 4a — unified Variables API (5 tools)** — `besales_variable_*`
464
- CRUD. Tool count 76 → 81. (`c20f74c`, 2026-05-27)
465
- - **Increment 3 — knowledge tables + typed agent/behavior sections (7 tools)** —
466
- `besales_knowledge_table_*` (6) plus typed-section expansion of
467
- `besales_agent_update` / `besales_behavior_update` /
468
- `besales_platform_settings_update` / `besales_pipeline_settings_update`.
469
- Tool count 70 → 77. (`c3c60b8`, 2026-05-27)
470
- - **Increment 2 — knowledge Q&A + websites (11 tools)** — `besales_knowledge_qa_*`
471
- (7, incl. semantic search and move) and `besales_knowledge_website_*` (4).
472
- Tool count 59 → 70. (`b507dbf`, 2026-05-27)
473
- - **Increment 1 — knowledge ingestion (10 tools)** — `besales_knowledge_space_*`
474
- (6) and `besales_knowledge_document_*` (4). Tool count 49 → 59.
475
- (`c71157a`, 2026-05-27)
476
- - **Workbook ingestion (3 tools)** — `besales_workbook_inspect`,
477
- `besales_workbook_extract_amocrm_leads`, `besales_workbook_to_knowledge_document`
478
- for xlsx and Google Sheets sources. Tool count 46 → 49. (`282fa2f`, 2026-05-27)
479
- - `besales_workspace_overview` tool. (`9d19f38`, 2026-05-26)
480
- - **Prompt patch sessions (5 tools)** — `besales_prompt_patch_start` / `_get` /
481
- `_apply` / `_commit` / `_discard`. (`c5fc4d8`, 2026-05-26)
482
- - **Google Sheets feedback integration (5 tools)** — `besales_feedback_sheet_*`
483
- (link / list / read / unlink / row_update) for binding tester-feedback sheets
484
- to a prompt. (`383b6b3`, 2026-05-21)
485
- - `besales_test_scenario_generate_get_instructions` / `_submit` external pair,
486
- closing the single-tool gap for the sandbox flow. Tool count 31 → 33.
487
- (`fc26398`, 2026-05-19)
488
- - `client_mode` (`scripted` / `simulated`) and `mode` options on
489
- `besales_sandbox_run_start` (schema-only; tool count unchanged).
490
- (`ee508bd`, `d93c724`, 2026-05-21/22)
491
-
492
- ### Changed
493
-
494
- - Reconciled the published catalog count to match `mcp-tools.json` after drift
495
- (markdown table said 38; JSON synced to 41). (`36b4c05`, 2026-05-26)
496
- - Regenerated `api-contract.gen.ts` against successive OpenAPI drafts
497
- (SandboxScenarioMetric, PromptDraft, feedback-path removal, OpenAPI 2.0.7).
498
-
499
- ### Removed (BREAKING)
500
-
501
- - **Phase B hard break (2026-05-27)** — removed deprecated MCP tool shapes:
502
- the generic `updates` field on `besales_behavior_update` and
503
- `besales_pipeline_settings_update`, and the generic `settings` field on
504
- `besales_platform_settings_update` are now rejected with HTTP 400; only typed
505
- JSONB-shaped sections remain. `besales_agent_legacy_self_analysis_set` was
506
- deleted (replaced in v2 by post-processors / the Routing Studio Critic node).
507
- Tool count 77 → 76. (`cacfb74`, 2026-05-27)
508
- - `besales_prompt_iterate_*` (2 tools) fully removed in favor of the
509
- `besales_prompt_analyze_*` + `besales_prompt_patch_*` flow. (`c5fc4d8`,
510
- `b14fe89`, 2026-05-26)
511
-
512
- ## [0.1.0] — 2026-05-13
513
-
514
- Initial package scaffold and first active toolset.
515
-
516
- ### Added
517
-
518
- - npm package bootstrap, OAuth client, and MCP server skeleton.
519
- (`66266e7`, `dd3256c`, 2026-05-13)
520
- - First active MCP tools and concept resources (18 tools). (`e094b01`,
521
- 2026-05-13)
522
- - **Platform Setup Bridge tools** — `besales_platform_context_get`,
523
- `besales_agent_*`, `besales_router_update`, `besales_routing_rule_upsert`,
524
- `besales_trigger_upsert`, `besales_behavior_update`,
525
- `besales_followup_sequence_upsert`, `besales_pipeline_settings_update`,
526
- `besales_platform_settings_update`, `besales_audit_revert`. Tool count
527
- 18 → 31. (`32f36ec`, 2026-05-15)
528
- - MCP host setup runbook (`docs/host-setup.md`) and npm package setup flow in the
529
- README. (`90ef122`, `4e3cac1`, 2026-05-14/15)
530
- - Split `BESALES_OAUTH_AUTHORIZE_URL` from `BESALES_API_BASE_URL`. (`0656d0b`,
531
- 2026-05-18)