@besales/mcp 0.33.0 → 0.37.1

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 (50) hide show
  1. package/README.md +45 -12
  2. package/dist/http/api-client.d.ts +2 -0
  3. package/dist/http/api-client.js +55 -0
  4. package/dist/http/api-client.js.map +1 -1
  5. package/dist/resources/docs/agent-behavior.md +7 -5
  6. package/dist/resources/docs/prompt-anatomy.md +4 -4
  7. package/dist/resources/docs/prompt-principles.md +22 -3
  8. package/dist/schemas/mcp-tools.json +1369 -98
  9. package/dist/skills/besales-dialogue-audit/SKILL.md +6 -0
  10. package/dist/tools/definitions/broadcast-analytics.d.ts +28 -7
  11. package/dist/tools/definitions/broadcast-analytics.js +399 -33
  12. package/dist/tools/definitions/broadcast-analytics.js.map +1 -1
  13. package/dist/tools/definitions/broadcast-mailing-variants.d.ts +19 -0
  14. package/dist/tools/definitions/broadcast-mailing-variants.js +107 -0
  15. package/dist/tools/definitions/broadcast-mailing-variants.js.map +1 -0
  16. package/dist/tools/definitions/dialogue-audit.d.ts +23 -0
  17. package/dist/tools/definitions/dialogue-audit.js +155 -0
  18. package/dist/tools/definitions/dialogue-audit.js.map +1 -0
  19. package/dist/tools/definitions/follow-up-setup.d.ts +27 -0
  20. package/dist/tools/definitions/follow-up-setup.js +76 -0
  21. package/dist/tools/definitions/follow-up-setup.js.map +1 -0
  22. package/dist/tools/definitions/follow-up.d.ts +19 -0
  23. package/dist/tools/definitions/follow-up.js +81 -3
  24. package/dist/tools/definitions/follow-up.js.map +1 -1
  25. package/dist/tools/definitions/getcourse-wave.d.ts +147 -0
  26. package/dist/tools/definitions/getcourse-wave.js +505 -0
  27. package/dist/tools/definitions/getcourse-wave.js.map +1 -0
  28. package/dist/tools/definitions/platform-setup.d.ts +92 -20
  29. package/dist/tools/definitions/platform-setup.js +132 -537
  30. package/dist/tools/definitions/platform-setup.js.map +1 -1
  31. package/dist/tools/definitions/scheduled-tasks.d.ts +9 -0
  32. package/dist/tools/definitions/scheduled-tasks.js +49 -2
  33. package/dist/tools/definitions/scheduled-tasks.js.map +1 -1
  34. package/dist/tools/definitions/session.js +6 -4
  35. package/dist/tools/definitions/session.js.map +1 -1
  36. package/dist/tools/definitions/shared.d.ts +75 -13
  37. package/dist/tools/definitions/shared.js +120 -7
  38. package/dist/tools/definitions/shared.js.map +1 -1
  39. package/dist/tools/definitions.d.ts +171 -26
  40. package/dist/tools/definitions.js +4 -0
  41. package/dist/tools/definitions.js.map +1 -1
  42. package/dist/tools/registry-mapping-cases-core.d.ts +38 -0
  43. package/dist/tools/registry-mapping-cases-core.js +700 -0
  44. package/dist/tools/registry-mapping-cases-core.js.map +1 -0
  45. package/dist/tools/registry-mapping-cases-platform.d.ts +2 -0
  46. package/dist/tools/registry-mapping-cases-platform.js +954 -0
  47. package/dist/tools/registry-mapping-cases-platform.js.map +1 -0
  48. package/dist/tools/registry.js +12 -6
  49. package/dist/tools/registry.js.map +1 -1
  50. package/package.json +2 -2
@@ -0,0 +1,954 @@
1
+ export function createPlatformMappingCases(ids) {
2
+ const { workspaceId, agentId, icpId, crmConnectionId, runId, dialogueId, knowledgeSpaceId, platformId, toolId, routingRuleId, triggerId, sequenceId, auditLogId, qaId, targetSpaceId, websiteId, draftId, compareAgentId, customVariableId, waveSegmentVariableId, } = ids;
3
+ return [
4
+ {
5
+ name: 'besales_agent_list',
6
+ input: { platform_id: platformId },
7
+ method: 'GET',
8
+ path: `/platforms/${platformId}/agents`,
9
+ },
10
+ {
11
+ name: 'besales_agent_variable_overrides_get',
12
+ input: { platform_id: platformId, agent_id: agentId },
13
+ method: 'GET',
14
+ path: `/platforms/${platformId}/agents/${agentId}/variable-overrides`,
15
+ },
16
+ {
17
+ name: 'besales_agent_create',
18
+ input: { platform_id: platformId, name: 'Sales', model_lane: 'STANDARD' },
19
+ path: `/platforms/${platformId}/agents`,
20
+ body: { name: 'Sales', modelLane: 'STANDARD' },
21
+ },
22
+ {
23
+ name: 'besales_agent_update',
24
+ input: { platform_id: platformId, agent_id: agentId, use_global_history: false },
25
+ method: 'PATCH',
26
+ path: `/platforms/${platformId}/agents/${agentId}`,
27
+ body: { useGlobalHistory: false },
28
+ },
29
+ {
30
+ name: 'besales_agent_tools_update',
31
+ input: {
32
+ platform_id: platformId,
33
+ agent_id: agentId,
34
+ tools: [{ tool_id: toolId, priority: 3, is_enabled: true }],
35
+ },
36
+ method: 'PATCH',
37
+ path: `/platforms/${platformId}/agents/${agentId}/tools`,
38
+ body: { tools: [{ toolId, priority: 3, isEnabled: true }] },
39
+ },
40
+ {
41
+ name: 'besales_router_update',
42
+ input: {
43
+ platform_id: platformId,
44
+ skip_llm_routing: true,
45
+ direct_routing_agent_id: agentId,
46
+ explicit_confirmation: true,
47
+ },
48
+ method: 'PATCH',
49
+ path: `/platforms/${platformId}/router`,
50
+ body: {
51
+ skipLlmRouting: true,
52
+ directRoutingAgentId: agentId,
53
+ explicitConfirmation: true,
54
+ },
55
+ },
56
+ {
57
+ name: 'besales_routing_rule_upsert',
58
+ input: {
59
+ platform_id: platformId,
60
+ routing_rule_id: routingRuleId,
61
+ routing_strategy: 'LEAD_STATUS',
62
+ custom_router_prompt: 'Prefer sales',
63
+ lead_statuses: [{ lead_status_name: 'hot' }],
64
+ },
65
+ method: 'PATCH',
66
+ path: `/platforms/${platformId}/router/routing-rules`,
67
+ body: {
68
+ routingRuleId,
69
+ routingStrategy: 'LEAD_STATUS',
70
+ customRouterPrompt: 'Prefer sales',
71
+ leadStatuses: [{ leadStatusName: 'hot' }],
72
+ },
73
+ },
74
+ {
75
+ // Мультизначные условия: набор обязан доезжать до API целиком. До правки маппер читал
76
+ // только variable_value, поэтому variable_values терялся молча — generic parity-тест
77
+ // сверяет лишь top-level поля и внутрь conditions[] не заглядывает.
78
+ name: 'besales_routing_rule_upsert',
79
+ input: {
80
+ platform_id: platformId,
81
+ routing_strategy: 'CUSTOM_VARIABLE',
82
+ custom_router_prompt: 'Роутинг по сегменту волны',
83
+ condition_logic: 'ALL',
84
+ conditions: [
85
+ { custom_variable_id: customVariableId, variable_values: ['дбо'] },
86
+ { custom_variable_id: waveSegmentVariableId, variable_values: ['post-web', 'post-web-2'] },
87
+ ],
88
+ },
89
+ method: 'POST',
90
+ path: `/platforms/${platformId}/router/routing-rules`,
91
+ body: {
92
+ routingStrategy: 'CUSTOM_VARIABLE',
93
+ customRouterPrompt: 'Роутинг по сегменту волны',
94
+ conditionLogic: 'ALL',
95
+ conditions: [
96
+ { customVariableId: customVariableId, variableValues: ['дбо'] },
97
+ { customVariableId: waveSegmentVariableId, variableValues: ['post-web', 'post-web-2'] },
98
+ ],
99
+ },
100
+ },
101
+ {
102
+ // Legacy-форма условия остаётся рабочей (старые клиенты шлют скаляр)
103
+ name: 'besales_routing_rule_upsert',
104
+ input: {
105
+ platform_id: platformId,
106
+ routing_strategy: 'CUSTOM_VARIABLE',
107
+ custom_router_prompt: 'Legacy',
108
+ conditions: [{ custom_variable_id: customVariableId, variable_value: 'дбо' }],
109
+ },
110
+ method: 'POST',
111
+ path: `/platforms/${platformId}/router/routing-rules`,
112
+ body: {
113
+ routingStrategy: 'CUSTOM_VARIABLE',
114
+ customRouterPrompt: 'Legacy',
115
+ conditions: [{ customVariableId: customVariableId, variableValue: 'дбо' }],
116
+ },
117
+ },
118
+ {
119
+ name: 'besales_trigger_upsert',
120
+ input: {
121
+ platform_id: platformId,
122
+ agent_id: agentId,
123
+ trigger_id: triggerId,
124
+ is_enabled: false,
125
+ },
126
+ method: 'PATCH',
127
+ path: `/platforms/${platformId}/agents/${agentId}/triggers/${triggerId}`,
128
+ body: { isEnabled: false },
129
+ },
130
+ {
131
+ name: 'besales_trigger_upsert',
132
+ input: {
133
+ platform_id: platformId,
134
+ agent_id: agentId,
135
+ trigger_id: triggerId,
136
+ replace_actions: true,
137
+ actions: [{ actionType: 'SET_VARIABLE' }],
138
+ },
139
+ method: 'PATCH',
140
+ path: `/platforms/${platformId}/agents/${agentId}/triggers/${triggerId}`,
141
+ body: { actions: [{ actionType: 'SET_VARIABLE' }], replaceActions: true },
142
+ },
143
+ {
144
+ name: 'besales_trigger_delete',
145
+ input: {
146
+ platform_id: platformId,
147
+ agent_id: agentId,
148
+ trigger_id: triggerId,
149
+ explicit_confirmation: true,
150
+ },
151
+ method: 'DELETE',
152
+ path: `/platforms/${platformId}/agents/${agentId}/triggers/${triggerId}`,
153
+ body: { explicitConfirmation: true },
154
+ },
155
+ {
156
+ name: 'besales_behavior_update',
157
+ input: { platform_id: platformId, greeting: { bot_greeting: 'Hi' } },
158
+ method: 'PATCH',
159
+ path: `/platforms/${platformId}/agent-behavior`,
160
+ body: { greeting: { botGreeting: 'Hi' } },
161
+ },
162
+ {
163
+ name: 'besales_behavior_update',
164
+ input: { platform_id: platformId, privacy: { anonymization_enabled: true } },
165
+ method: 'PATCH',
166
+ path: `/platforms/${platformId}/agent-behavior`,
167
+ body: { privacy: { anonymizationEnabled: true } },
168
+ },
169
+ {
170
+ name: 'besales_behavior_update',
171
+ input: {
172
+ platform_id: platformId,
173
+ privacy: {
174
+ anonymization_disabled_types: ['PHONE'],
175
+ contact_name_personalization_mode: 'ENABLED',
176
+ },
177
+ },
178
+ method: 'PATCH',
179
+ path: `/platforms/${platformId}/agent-behavior`,
180
+ body: {
181
+ privacy: {
182
+ anonymizationDisabledTypes: ['PHONE'],
183
+ contactNamePersonalizationMode: 'ENABLED',
184
+ },
185
+ },
186
+ },
187
+ {
188
+ name: 'besales_followup_sequence_upsert',
189
+ input: {
190
+ platform_id: platformId,
191
+ sequence_id: sequenceId,
192
+ name: 'reactivation',
193
+ type: 'LOST_CLIENTS',
194
+ trigger: 'LOST_CLIENTS',
195
+ config: { days: 30 },
196
+ },
197
+ method: 'PATCH',
198
+ path: `/platforms/${platformId}/follow-up/sequences/${sequenceId}`,
199
+ body: {
200
+ name: 'reactivation',
201
+ type: 'LOST_CLIENTS',
202
+ trigger: 'LOST_CLIENTS',
203
+ config: { days: 30 },
204
+ },
205
+ },
206
+ {
207
+ name: 'besales_pipeline_settings_update',
208
+ input: {
209
+ platform_id: platformId,
210
+ crm_pipeline_behavior: { filter_enabled: true },
211
+ },
212
+ method: 'PATCH',
213
+ path: `/platforms/${platformId}/pipeline-settings`,
214
+ body: { crmPipelineBehavior: { filterEnabled: true } },
215
+ },
216
+ {
217
+ name: 'besales_platform_settings_update',
218
+ input: {
219
+ platform_id: platformId,
220
+ access_control: { is_ai_enabled: true },
221
+ },
222
+ method: 'PATCH',
223
+ path: `/platforms/${platformId}/settings`,
224
+ body: { accessControl: { isAiEnabled: true } },
225
+ },
226
+ {
227
+ name: 'besales_platform_settings_update',
228
+ input: {
229
+ platform_id: platformId,
230
+ getcourse_settings: {
231
+ wave_field_bindings: {
232
+ product_value_source: 'NAME',
233
+ product: { field_id: 101, field_label: 'Продукт' },
234
+ channels: { field_id: 102, field_label: 'Каналы' },
235
+ },
236
+ },
237
+ },
238
+ method: 'PATCH',
239
+ path: `/platforms/${platformId}/settings`,
240
+ body: {
241
+ getcourseSettings: {
242
+ waveFieldBindings: {
243
+ productValueSource: 'NAME',
244
+ product: { fieldId: 101, fieldLabel: 'Продукт' },
245
+ channels: { fieldId: 102, fieldLabel: 'Каналы' },
246
+ },
247
+ },
248
+ },
249
+ },
250
+ {
251
+ name: 'besales_audit_revert',
252
+ input: { platform_id: platformId, audit_log_id: auditLogId },
253
+ method: 'POST',
254
+ path: `/platforms/${platformId}/audit/${auditLogId}/revert`,
255
+ },
256
+ // Phase 4 — audio import mode
257
+ {
258
+ name: 'besales_icp_import_dialogues',
259
+ input: {
260
+ icp_id: icpId,
261
+ mode: 'audio',
262
+ audio_source_type: 'amocrm_leads',
263
+ audio_source_config: {
264
+ crmConnectionId,
265
+ leadIds: ['24001691', '24000957'],
266
+ defaultOutcome: 'won',
267
+ },
268
+ language: 'uz-UZ',
269
+ },
270
+ method: 'POST',
271
+ path: `/icp/audio-import-runs`,
272
+ body: {
273
+ icpProfileId: icpId,
274
+ sourceType: 'amocrm_leads',
275
+ sourceConfig: {
276
+ crmConnectionId,
277
+ leadIds: ['24001691', '24000957'],
278
+ defaultOutcome: 'won',
279
+ },
280
+ language: 'uz-UZ',
281
+ },
282
+ },
283
+ {
284
+ name: 'besales_icp_import_status',
285
+ input: { run_id: icpId },
286
+ method: 'GET',
287
+ path: `/icp/audio-import-runs/${icpId}`,
288
+ },
289
+ {
290
+ name: 'besales_workbook_inspect',
291
+ input: { stored_file_id: agentId, sample_rows_per_sheet: 5, max_cells_total: 100 },
292
+ path: `/workspaces/${workspaceId}/workbooks/inspect`,
293
+ body: {
294
+ storedFileId: agentId,
295
+ sampleRowsPerSheet: 5,
296
+ maxCellsTotal: 100,
297
+ },
298
+ },
299
+ {
300
+ name: 'besales_workbook_extract_amocrm_leads',
301
+ input: { workbook_id: agentId, sheet_title: 'Все разговоры', include_contacts: true },
302
+ path: `/workspaces/${workspaceId}/workbooks/${agentId}/extract-amocrm-leads`,
303
+ body: {
304
+ sheetTitle: 'Все разговоры',
305
+ includeContacts: true,
306
+ },
307
+ },
308
+ {
309
+ name: 'besales_workbook_to_knowledge_document',
310
+ input: {
311
+ workbook_id: agentId,
312
+ sheet_gid: 12345,
313
+ namespace: 'aslzar-rules',
314
+ split_override: {
315
+ split_mode: 'separator',
316
+ separator: '\n## ',
317
+ max_chunk_size: 1500,
318
+ },
319
+ },
320
+ path: `/workspaces/${workspaceId}/workbooks/${agentId}/knowledge-document`,
321
+ body: {
322
+ sheetGid: 12345,
323
+ namespace: 'aslzar-rules',
324
+ splitOverride: {
325
+ splitMode: 'separator',
326
+ separator: '\n## ',
327
+ maxChunkSize: 1500,
328
+ },
329
+ },
330
+ },
331
+ // v1.5 Increment 1 — Knowledge Spaces (6 tools)
332
+ {
333
+ name: 'besales_knowledge_space_create',
334
+ input: { name: 'support-faq', scope_type: 'WORKSPACE', access_mode: 'AUTO_QUERY' },
335
+ path: `/workspaces/${workspaceId}/knowledge-spaces`,
336
+ body: { name: 'support-faq', scope_type: 'WORKSPACE', access_mode: 'AUTO_QUERY' },
337
+ },
338
+ {
339
+ name: 'besales_knowledge_space_list',
340
+ input: { scope_type: 'WORKSPACE' },
341
+ method: 'GET',
342
+ path: `/workspaces/${workspaceId}/knowledge-spaces?scope_type=WORKSPACE`,
343
+ },
344
+ {
345
+ name: 'besales_knowledge_space_get',
346
+ input: { knowledge_space_id: knowledgeSpaceId },
347
+ method: 'GET',
348
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}`,
349
+ },
350
+ {
351
+ name: 'besales_knowledge_space_patch',
352
+ input: { knowledge_space_id: knowledgeSpaceId, access_mode: 'TOOL_ONLY' },
353
+ method: 'PATCH',
354
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}`,
355
+ body: { access_mode: 'TOOL_ONLY' },
356
+ },
357
+ {
358
+ name: 'besales_knowledge_space_channel_link_upsert',
359
+ input: { knowledge_space_id: knowledgeSpaceId, channel_id: platformId },
360
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/channel-links`,
361
+ body: { channel_id: platformId },
362
+ },
363
+ {
364
+ name: 'besales_knowledge_space_channel_link_remove',
365
+ input: { knowledge_space_id: knowledgeSpaceId, channel_id: platformId },
366
+ method: 'DELETE',
367
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/channel-links/${platformId}`,
368
+ },
369
+ // v1.5 Increment 1 — Knowledge Documents (4 tools)
370
+ {
371
+ name: 'besales_knowledge_document_upload',
372
+ input: {
373
+ knowledge_space_id: knowledgeSpaceId,
374
+ source_kind: 'TEXT',
375
+ content: '# Hello world',
376
+ filename: 'hello.md',
377
+ },
378
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/documents`,
379
+ body: {
380
+ source_kind: 'TEXT',
381
+ content: '# Hello world',
382
+ filename: 'hello.md',
383
+ },
384
+ },
385
+ {
386
+ name: 'besales_knowledge_document_list',
387
+ input: { knowledge_space_id: knowledgeSpaceId, status: 'COMPLETED', page: 1, limit: 20 },
388
+ method: 'GET',
389
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/documents?status=COMPLETED&page=1&limit=20`,
390
+ },
391
+ {
392
+ name: 'besales_knowledge_document_get',
393
+ input: { knowledge_space_id: knowledgeSpaceId, document_id: triggerId },
394
+ method: 'GET',
395
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/documents/${triggerId}`,
396
+ },
397
+ {
398
+ name: 'besales_knowledge_document_delete',
399
+ input: { knowledge_space_id: knowledgeSpaceId, document_id: triggerId, explicit_confirmation: true },
400
+ method: 'DELETE',
401
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/documents/${triggerId}`,
402
+ body: { explicit_confirmation: true },
403
+ },
404
+ // v1.5 Increment 2 — Knowledge Q&A (7 tools)
405
+ {
406
+ name: 'besales_knowledge_qa_create',
407
+ input: {
408
+ knowledge_space_id: knowledgeSpaceId,
409
+ question: 'How do I cancel?',
410
+ answer: 'In settings.',
411
+ },
412
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs`,
413
+ body: { question: 'How do I cancel?', answer: 'In settings.' },
414
+ },
415
+ {
416
+ name: 'besales_knowledge_qa_list',
417
+ input: { knowledge_space_id: knowledgeSpaceId, mode: 'SIMPLE', page: 1, limit: 20 },
418
+ method: 'GET',
419
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs?mode=SIMPLE&page=1&limit=20`,
420
+ },
421
+ {
422
+ name: 'besales_knowledge_qa_get',
423
+ input: { knowledge_space_id: knowledgeSpaceId, qa_id: qaId },
424
+ method: 'GET',
425
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs/${qaId}`,
426
+ },
427
+ {
428
+ name: 'besales_knowledge_qa_patch',
429
+ input: { knowledge_space_id: knowledgeSpaceId, qa_id: qaId, question: 'updated?' },
430
+ method: 'PATCH',
431
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs/${qaId}`,
432
+ body: { question: 'updated?' },
433
+ },
434
+ {
435
+ name: 'besales_knowledge_qa_delete',
436
+ input: { knowledge_space_id: knowledgeSpaceId, qa_id: qaId, explicit_confirmation: true },
437
+ method: 'DELETE',
438
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs/${qaId}`,
439
+ body: { explicit_confirmation: true },
440
+ },
441
+ {
442
+ name: 'besales_knowledge_qa_search',
443
+ input: { knowledge_space_id: knowledgeSpaceId, query: 'cancel', top_k: 10 },
444
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs/search`,
445
+ body: { query: 'cancel', top_k: 10 },
446
+ },
447
+ {
448
+ name: 'besales_knowledge_qa_move',
449
+ input: {
450
+ source_space_id: knowledgeSpaceId,
451
+ qa_id: qaId,
452
+ target_space_id: targetSpaceId,
453
+ explicit_confirmation: true,
454
+ },
455
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/qa-pairs/${qaId}/move`,
456
+ body: { target_space_id: targetSpaceId, explicit_confirmation: true },
457
+ },
458
+ // v1.5 Increment 2 — Knowledge Websites (4 tools)
459
+ {
460
+ name: 'besales_knowledge_website_add',
461
+ input: {
462
+ knowledge_space_id: knowledgeSpaceId,
463
+ url: 'https://example.com',
464
+ display_name: 'Example',
465
+ },
466
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/websites`,
467
+ body: { url: 'https://example.com', display_name: 'Example' },
468
+ },
469
+ {
470
+ name: 'besales_knowledge_website_list',
471
+ input: { knowledge_space_id: knowledgeSpaceId, status: 'COMPLETED', page: 1, limit: 20 },
472
+ method: 'GET',
473
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/websites?status=COMPLETED&page=1&limit=20`,
474
+ },
475
+ {
476
+ name: 'besales_knowledge_website_get',
477
+ input: { knowledge_space_id: knowledgeSpaceId, website_id: websiteId },
478
+ method: 'GET',
479
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/websites/${websiteId}`,
480
+ },
481
+ {
482
+ name: 'besales_knowledge_website_delete',
483
+ input: { knowledge_space_id: knowledgeSpaceId, website_id: websiteId, explicit_confirmation: true },
484
+ method: 'DELETE',
485
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/websites/${websiteId}`,
486
+ body: { explicit_confirmation: true },
487
+ },
488
+ // v1.5 Increment 3 — Knowledge Tables (6 tools). Phase B (2026-05-27) удалил legacy_self_analysis_set.
489
+ {
490
+ name: 'besales_knowledge_table_link',
491
+ input: {
492
+ knowledge_space_id: knowledgeSpaceId,
493
+ source: { kind: 'GOOGLE_SHEETS', spreadsheet_url: 'https://docs.google.com/x' },
494
+ display_name: 'Prices',
495
+ use_vector_index: true,
496
+ },
497
+ method: 'POST',
498
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/tables`,
499
+ body: {
500
+ source: { kind: 'GOOGLE_SHEETS', spreadsheet_url: 'https://docs.google.com/x' },
501
+ display_name: 'Prices',
502
+ use_vector_index: true,
503
+ },
504
+ },
505
+ {
506
+ name: 'besales_knowledge_table_list',
507
+ input: { knowledge_space_id: knowledgeSpaceId, is_active: true, page: 1, limit: 20 },
508
+ method: 'GET',
509
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/tables?is_active=true&page=1&limit=20`,
510
+ },
511
+ {
512
+ name: 'besales_knowledge_table_get',
513
+ input: { knowledge_space_id: knowledgeSpaceId, table_id: triggerId },
514
+ method: 'GET',
515
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/tables/${triggerId}`,
516
+ },
517
+ {
518
+ name: 'besales_knowledge_table_patch',
519
+ input: {
520
+ knowledge_space_id: knowledgeSpaceId,
521
+ table_id: triggerId,
522
+ display_name: 'Prices v2',
523
+ use_vector_index: true,
524
+ },
525
+ method: 'PATCH',
526
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/tables/${triggerId}`,
527
+ body: { display_name: 'Prices v2', use_vector_index: true },
528
+ },
529
+ {
530
+ name: 'besales_knowledge_table_delete',
531
+ input: {
532
+ knowledge_space_id: knowledgeSpaceId,
533
+ table_id: triggerId,
534
+ explicit_confirmation: true,
535
+ },
536
+ method: 'DELETE',
537
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/tables/${triggerId}`,
538
+ body: { explicit_confirmation: true },
539
+ },
540
+ {
541
+ name: 'besales_knowledge_table_reindex',
542
+ input: {
543
+ knowledge_space_id: knowledgeSpaceId,
544
+ table_id: triggerId,
545
+ explicit_confirmation: true,
546
+ },
547
+ method: 'POST',
548
+ path: `/workspaces/${workspaceId}/knowledge-spaces/${knowledgeSpaceId}/tables/${triggerId}/reindex`,
549
+ body: { explicit_confirmation: true },
550
+ },
551
+ // v1.5 Increment 4a — Unified Variables API (5 tools, scope discriminator).
552
+ {
553
+ name: 'besales_variable_list',
554
+ input: { scope: 'WORKSPACE' },
555
+ method: 'GET',
556
+ path: `/workspaces/${workspaceId}/variables?scope=WORKSPACE`,
557
+ },
558
+ {
559
+ name: 'besales_variable_create',
560
+ input: {
561
+ scope: 'CHANNEL',
562
+ platform_id: platformId,
563
+ name: 'city',
564
+ type: 'TEXT',
565
+ is_constant: true,
566
+ constant_value: 'Moscow',
567
+ },
568
+ method: 'POST',
569
+ path: `/workspaces/${workspaceId}/variables`,
570
+ body: {
571
+ scope: 'CHANNEL',
572
+ name: 'city',
573
+ type: 'TEXT',
574
+ platformId,
575
+ isConstant: true,
576
+ constantValue: 'Moscow',
577
+ },
578
+ },
579
+ {
580
+ name: 'besales_variable_get',
581
+ input: { variable_id: triggerId, scope: 'WORKSPACE' },
582
+ method: 'GET',
583
+ path: `/workspaces/${workspaceId}/variables/${triggerId}?scope=WORKSPACE`,
584
+ },
585
+ {
586
+ name: 'besales_variable_update',
587
+ input: {
588
+ variable_id: triggerId,
589
+ scope: 'WORKSPACE',
590
+ value: 'NewValue',
591
+ description: 'Updated',
592
+ },
593
+ method: 'PATCH',
594
+ path: `/workspaces/${workspaceId}/variables/${triggerId}`,
595
+ body: { scope: 'WORKSPACE', description: 'Updated', value: 'NewValue' },
596
+ },
597
+ {
598
+ name: 'besales_variable_delete',
599
+ input: { variable_id: triggerId, scope: 'WORKSPACE', explicit_confirmation: true },
600
+ method: 'DELETE',
601
+ path: `/workspaces/${workspaceId}/variables/${triggerId}`,
602
+ body: { scope: 'WORKSPACE', explicitConfirmation: true },
603
+ },
604
+ // v1.5 Increment 4b — CRM Pipelines (11 tools)
605
+ {
606
+ name: 'besales_crm_pipeline_list',
607
+ input: { workspace_id: workspaceId, crm_id: knowledgeSpaceId },
608
+ method: 'GET',
609
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines`,
610
+ },
611
+ {
612
+ name: 'besales_crm_pipeline_get',
613
+ input: { workspace_id: workspaceId, crm_id: knowledgeSpaceId, pipeline_id: 100 },
614
+ method: 'GET',
615
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100`,
616
+ },
617
+ {
618
+ name: 'besales_crm_pipeline_create',
619
+ input: {
620
+ workspace_id: workspaceId,
621
+ crm_id: knowledgeSpaceId,
622
+ name: 'Sales',
623
+ acknowledge_external_side_effect: true,
624
+ },
625
+ method: 'POST',
626
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines`,
627
+ body: { name: 'Sales', acknowledgeExternalSideEffect: true },
628
+ },
629
+ {
630
+ name: 'besales_crm_pipeline_update',
631
+ input: {
632
+ workspace_id: workspaceId,
633
+ crm_id: knowledgeSpaceId,
634
+ pipeline_id: 100,
635
+ name: 'Renamed',
636
+ acknowledge_external_side_effect: true,
637
+ },
638
+ method: 'PATCH',
639
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100`,
640
+ body: { name: 'Renamed', acknowledgeExternalSideEffect: true },
641
+ },
642
+ {
643
+ name: 'besales_crm_pipeline_delete',
644
+ input: {
645
+ workspace_id: workspaceId,
646
+ crm_id: knowledgeSpaceId,
647
+ pipeline_id: 100,
648
+ explicit_confirmation: true,
649
+ acknowledge_external_side_effect: true,
650
+ },
651
+ method: 'DELETE',
652
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100`,
653
+ body: { explicitConfirmation: true, acknowledgeExternalSideEffect: true },
654
+ },
655
+ {
656
+ name: 'besales_crm_pipeline_status_list',
657
+ input: { workspace_id: workspaceId, crm_id: knowledgeSpaceId, pipeline_id: 100 },
658
+ method: 'GET',
659
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100/statuses`,
660
+ },
661
+ {
662
+ name: 'besales_crm_pipeline_status_create',
663
+ input: {
664
+ workspace_id: workspaceId,
665
+ crm_id: knowledgeSpaceId,
666
+ pipeline_id: 100,
667
+ name: 'In progress',
668
+ sort: 10,
669
+ acknowledge_external_side_effect: true,
670
+ },
671
+ method: 'POST',
672
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100/statuses`,
673
+ body: {
674
+ name: 'In progress',
675
+ sort: 10,
676
+ acknowledgeExternalSideEffect: true,
677
+ },
678
+ },
679
+ {
680
+ name: 'besales_crm_pipeline_status_update',
681
+ input: {
682
+ workspace_id: workspaceId,
683
+ crm_id: knowledgeSpaceId,
684
+ pipeline_id: 100,
685
+ status_id: 200,
686
+ is_system_managed: false,
687
+ is_bot_active: true,
688
+ acknowledge_external_side_effect: true,
689
+ },
690
+ method: 'PATCH',
691
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100/statuses/200`,
692
+ body: {
693
+ isSystemManaged: false,
694
+ isBotActive: true,
695
+ acknowledgeExternalSideEffect: true,
696
+ },
697
+ },
698
+ {
699
+ name: 'besales_crm_pipeline_status_delete',
700
+ input: {
701
+ workspace_id: workspaceId,
702
+ crm_id: knowledgeSpaceId,
703
+ pipeline_id: 100,
704
+ status_id: 200,
705
+ explicit_confirmation: true,
706
+ acknowledge_external_side_effect: true,
707
+ },
708
+ method: 'DELETE',
709
+ path: `/workspaces/${workspaceId}/crm/${knowledgeSpaceId}/pipelines/100/statuses/200`,
710
+ body: { explicitConfirmation: true, acknowledgeExternalSideEffect: true },
711
+ },
712
+ {
713
+ name: 'besales_platform_pipeline_link',
714
+ input: {
715
+ workspace_id: workspaceId,
716
+ platform_id: platformId,
717
+ pipeline_id: 100,
718
+ pipeline_crm_id: knowledgeSpaceId,
719
+ sort: 1,
720
+ },
721
+ method: 'POST',
722
+ path: `/workspaces/${workspaceId}/platforms/${platformId}/active-pipelines`,
723
+ body: { pipelineId: 100, pipelineCrmId: knowledgeSpaceId, sort: 1 },
724
+ },
725
+ {
726
+ name: 'besales_platform_pipeline_unlink',
727
+ input: {
728
+ workspace_id: workspaceId,
729
+ platform_id: platformId,
730
+ platform_pipeline_id: triggerId,
731
+ explicit_confirmation: true,
732
+ },
733
+ method: 'DELETE',
734
+ path: `/workspaces/${workspaceId}/platforms/${platformId}/active-pipelines/${triggerId}`,
735
+ body: { explicitConfirmation: true },
736
+ },
737
+ {
738
+ name: 'besales_file_upload_request',
739
+ input: { name: 'Прайс', file_type: 'DOCUMENT', source: 'USER_UPLOAD' },
740
+ method: 'POST',
741
+ path: `/workspaces/${workspaceId}/file-upload-sessions`,
742
+ body: { name: 'Прайс', file_type: 'DOCUMENT', source: 'USER_UPLOAD' },
743
+ },
744
+ {
745
+ name: 'besales_file_upload_status',
746
+ input: { upload_ref: 'REF123' },
747
+ method: 'GET',
748
+ path: `/workspaces/${workspaceId}/file-upload-sessions/REF123`,
749
+ },
750
+ {
751
+ name: 'besales_file_list',
752
+ input: { file_type: 'DOCUMENT', limit: 10 },
753
+ method: 'GET',
754
+ path: `/workspaces/${workspaceId}/files?file_type=DOCUMENT&limit=10`,
755
+ },
756
+ {
757
+ name: 'besales_platform_create_init',
758
+ input: { platform_type: 'Wazzup', name: 'My WA', fields: { wazzup_channel: 'WhatsApp' } },
759
+ method: 'POST',
760
+ path: `/workspaces/${workspaceId}/platform-setup-sessions`,
761
+ body: { platform_type: 'Wazzup', name: 'My WA', fields: { wazzup_channel: 'WhatsApp' } },
762
+ },
763
+ {
764
+ name: 'besales_platform_create_status',
765
+ input: { setup_ref: 'REF123' },
766
+ method: 'GET',
767
+ path: `/workspaces/${workspaceId}/platform-setup-sessions/REF123`,
768
+ },
769
+ {
770
+ name: 'besales_platform_create_oauth_init',
771
+ input: { platform_type: 'Instagram' },
772
+ method: 'POST',
773
+ path: `/workspaces/${workspaceId}/platform-oauth-sessions`,
774
+ body: { platform_type: 'Instagram' },
775
+ },
776
+ {
777
+ name: 'besales_crm_create_init',
778
+ input: { crm_type: 'GETCOURSE', fields: { account_domain: 'school.getcourse.ru' } },
779
+ method: 'POST',
780
+ path: `/workspaces/${workspaceId}/crm-setup-sessions`,
781
+ body: { crm_type: 'GETCOURSE', fields: { account_domain: 'school.getcourse.ru' } },
782
+ },
783
+ {
784
+ name: 'besales_crm_create_status',
785
+ input: { setup_ref: 'CRMREF' },
786
+ method: 'GET',
787
+ path: `/workspaces/${workspaceId}/crm-setup-sessions/CRMREF`,
788
+ },
789
+ {
790
+ name: 'besales_crm_field_mapping_get',
791
+ input: { crm_id: knowledgeSpaceId },
792
+ method: 'GET',
793
+ path: `/workspaces/${workspaceId}/crms/${knowledgeSpaceId}/field-mapping`,
794
+ },
795
+ {
796
+ name: 'besales_crm_field_mapping_upsert',
797
+ input: {
798
+ crm_id: knowledgeSpaceId,
799
+ replace_all_existing: true,
800
+ enabled: true,
801
+ field_mappings: [{ crm_field_id: '12345', save_as: 'phone', enabled: true, special_purpose: 'phone' }],
802
+ },
803
+ method: 'PUT',
804
+ path: `/workspaces/${workspaceId}/crms/${knowledgeSpaceId}/field-mapping`,
805
+ body: {
806
+ replace_all_existing: true,
807
+ enabled: true,
808
+ field_mappings: [{ crm_field_id: '12345', save_as: 'phone', enabled: true, special_purpose: 'phone' }],
809
+ },
810
+ },
811
+ {
812
+ name: 'besales_crm_operator_list',
813
+ input: { crm_id: knowledgeSpaceId, sync: true },
814
+ method: 'GET',
815
+ path: `/workspaces/${workspaceId}/crms/${knowledgeSpaceId}/operators?sync=true`,
816
+ },
817
+ {
818
+ name: 'besales_crm_operator_update',
819
+ input: { crm_id: knowledgeSpaceId, operator_id: triggerId, is_operator: true, is_sdr: false },
820
+ method: 'PATCH',
821
+ path: `/workspaces/${workspaceId}/crms/${knowledgeSpaceId}/operators/${triggerId}`,
822
+ body: { is_operator: true, is_sdr: false },
823
+ },
824
+ {
825
+ name: 'besales_model_catalog_list',
826
+ input: {},
827
+ method: 'GET',
828
+ path: '/model-catalog',
829
+ },
830
+ {
831
+ name: 'besales_model_comparison_run_start',
832
+ input: {
833
+ agent_id: agentId,
834
+ models: ['gpt-5.4-mini'],
835
+ dialogue_count: 5,
836
+ message_direction: 'INBOUND',
837
+ },
838
+ path: `/agents/${agentId}/model-comparison/runs`,
839
+ body: { models: ['gpt-5.4-mini'], dialogueCount: 5, messageDirection: 'INBOUND' },
840
+ },
841
+ {
842
+ name: 'besales_model_comparison_get',
843
+ input: { run_id: runId },
844
+ method: 'GET',
845
+ path: `/model-comparison/runs/${runId}`,
846
+ },
847
+ {
848
+ name: 'besales_model_comparison_eval_submit',
849
+ input: {
850
+ run_id: runId,
851
+ winner: 'gpt-5.4-mini',
852
+ rationale: 'best tone',
853
+ per_model: [
854
+ {
855
+ model: 'gpt-5.4-mini',
856
+ success_score: 80,
857
+ strengths: [],
858
+ weaknesses: [],
859
+ excerpts: [],
860
+ },
861
+ ],
862
+ },
863
+ path: `/model-comparison/runs/${runId}/eval`,
864
+ body: {
865
+ winner: 'gpt-5.4-mini',
866
+ rationale: 'best tone',
867
+ perModel: [
868
+ {
869
+ model: 'gpt-5.4-mini',
870
+ successScore: 80,
871
+ strengths: [],
872
+ weaknesses: [],
873
+ excerpts: [],
874
+ },
875
+ ],
876
+ },
877
+ },
878
+ {
879
+ name: 'besales_dialogues_query',
880
+ input: {
881
+ workspace_id: workspaceId,
882
+ work_log_event: ['FINISH_WIN'],
883
+ action_type: ['GETCOURSE_CREATE_DEAL', 'GETCOURSE_SEND_PAYMENT_LINK'],
884
+ action_success: true,
885
+ action_execution_mode: 'production',
886
+ ai_enabled: true,
887
+ limit: 50,
888
+ },
889
+ method: 'GET',
890
+ path: `/workspaces/${workspaceId}/dialogue-export?workLogEvent=FINISH_WIN&actionType=GETCOURSE_CREATE_DEAL%2CGETCOURSE_SEND_PAYMENT_LINK&actionSuccess=true&actionExecutionMode=production&aiEnabled=true&limit=50`,
891
+ },
892
+ {
893
+ name: 'besales_dialogue_transcript',
894
+ input: { conversation_id: dialogueId, limit: 50 },
895
+ method: 'GET',
896
+ path: `/dialogue-export/${dialogueId}/transcript?limit=50`,
897
+ },
898
+ // `query` в ApiToolRequest нет, поэтому draft_id клеится в path через buildListQuery —
899
+ // единственное место, где путь тулзы собирается не литералом, и его надо закрепить.
900
+ {
901
+ name: 'besales_prompt_headroom',
902
+ input: { agent_id: agentId },
903
+ method: 'GET',
904
+ path: `/agents/${agentId}/prompt/headroom`,
905
+ },
906
+ {
907
+ name: 'besales_prompt_headroom',
908
+ input: { agent_id: agentId, draft_id: draftId },
909
+ method: 'GET',
910
+ path: `/agents/${agentId}/prompt/headroom?draftId=${draftId}`,
911
+ },
912
+ // Закрепляем snake→camel маппинг тела: был инцидент, когда batch-тулза слала имя поля,
913
+ // которого нет в DTO, и получала 400 всегда.
914
+ {
915
+ name: 'besales_prompt_diff',
916
+ input: { agent_id: agentId, compare_agent_id: compareAgentId, max_lines: 50 },
917
+ method: 'POST',
918
+ path: `/agents/${agentId}/prompt/diff`,
919
+ body: { compareAgentId, maxLines: 50 },
920
+ },
921
+ {
922
+ name: 'besales_prompt_batch_start',
923
+ input: {
924
+ agent_ids: [agentId, compareAgentId],
925
+ operations: [{ type: 'replace_text', target_text: 'было', replacement_text: 'стало' }],
926
+ all_or_nothing: true,
927
+ idempotency_key: 'batch-1',
928
+ platform_id: platformId,
929
+ },
930
+ method: 'POST',
931
+ path: '/prompt-batch/runs',
932
+ body: {
933
+ agentIds: [agentId, compareAgentId],
934
+ operations: [{ type: 'replace_text', targetText: 'было', replacementText: 'стало' }],
935
+ allOrNothing: true,
936
+ idempotencyKey: 'batch-1',
937
+ platformId,
938
+ },
939
+ },
940
+ {
941
+ name: 'besales_prompt_batch_status',
942
+ input: { run_id: runId },
943
+ method: 'GET',
944
+ path: `/prompt-batch/runs/${runId}`,
945
+ },
946
+ {
947
+ name: 'besales_prompt_batch_resume',
948
+ input: { run_id: runId },
949
+ method: 'POST',
950
+ path: `/prompt-batch/runs/${runId}/resume`,
951
+ },
952
+ ];
953
+ }
954
+ //# sourceMappingURL=registry-mapping-cases-platform.js.map