smart-bot-factory 0.3.1__tar.gz → 0.3.3__tar.gz

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.

Potentially problematic release.


This version of smart-bot-factory might be problematic. Click here for more details.

Files changed (92) hide show
  1. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/.gitignore +5 -0
  2. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/PKG-INFO +26 -17
  3. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/README.md +24 -16
  4. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/pyproject.toml +2 -1
  5. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/admin/__init__.py +2 -0
  6. smart_bot_factory-0.3.3/smart_bot_factory/admin/admin_events.py +757 -0
  7. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/admin/admin_logic.py +54 -12
  8. smart_bot_factory-0.3.3/smart_bot_factory/aiogram_calendar/__init__.py +6 -0
  9. smart_bot_factory-0.3.3/smart_bot_factory/aiogram_calendar/common.py +70 -0
  10. smart_bot_factory-0.3.3/smart_bot_factory/aiogram_calendar/dialog_calendar.py +197 -0
  11. smart_bot_factory-0.3.3/smart_bot_factory/aiogram_calendar/schemas.py +78 -0
  12. smart_bot_factory-0.3.3/smart_bot_factory/aiogram_calendar/simple_calendar.py +180 -0
  13. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/analytics/analytics_manager.py +42 -5
  14. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/cli.py +1 -1
  15. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/core/bot_utils.py +17 -16
  16. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/core/decorators.py +215 -4
  17. smart_bot_factory-0.3.3/smart_bot_factory/core/states.py +26 -0
  18. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/creation/bot_builder.py +54 -2
  19. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/handlers/handlers.py +388 -4
  20. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/integrations/openai_client.py +29 -1
  21. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/integrations/supabase_client.py +413 -37
  22. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/utm_link_generator.py +13 -3
  23. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/uv.lock +24 -1
  24. smart_bot_factory-0.3.1/.github/ISSUE_TEMPLATE//342/234/250-/320/267/320/260/320/277/321/200/320/276/321/201-/321/204/321/203/320/275/320/272/321/206/320/270/320/270.md +0 -20
  25. smart_bot_factory-0.3.1/.github/ISSUE_TEMPLATE//360/237/220/233-/320/261/320/260/320/263-/321/200/320/265/320/277/320/276/321/200/321/202.md +0 -26
  26. smart_bot_factory-0.3.1/.github/workflows/ci.yml +0 -59
  27. smart_bot_factory-0.3.1/.github/workflows/publish-private.yml +0 -34
  28. smart_bot_factory-0.3.1/.github/workflows/publish.yml +0 -31
  29. smart_bot_factory-0.3.1/smart_bot_factory/core/states.py +0 -14
  30. smart_bot_factory-0.3.1/smart_bot_factory/table/database_structure.sql +0 -57
  31. smart_bot_factory-0.3.1/smart_bot_factory/table/schema.sql +0 -1094
  32. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/.python-version +0 -0
  33. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/LICENSE +0 -0
  34. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/best-valera.py +0 -0
  35. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/prompts/1sales_context.txt +0 -0
  36. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/prompts/2product_info.txt +0 -0
  37. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/prompts/3objection_handling.txt +0 -0
  38. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/prompts/final_instructions.txt +0 -0
  39. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/prompts/help_message.txt +0 -0
  40. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/prompts/welcome_message.txt +0 -0
  41. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/tests/quick_scenarios.yaml +0 -0
  42. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/tests/realistic_scenarios.yaml +0 -0
  43. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/tests/scenario_examples.yaml +0 -0
  44. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/welcome_files/welcome_file_msg.txt +0 -0
  45. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/best-valera/welcome_files//320/247/320/265/320/272 /320/273/320/270/321/201/321/202 /320/277/320/276 152/320/244/320/227 /320/270 323/320/244/320/227 /320/264/320/273/321/217 /320/274/320/265/320/264/320/270/321/206/320/270/320/275/321/213.pdf" +0 -0
  46. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/prompts/2product_info.txt +0 -0
  47. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/prompts/3objection_handling.txt +0 -0
  48. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/prompts/final_instructions.txt +0 -0
  49. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/prompts/help_message.txt +0 -0
  50. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/prompts/welcome_message.txt +0 -0
  51. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/tests/quick_scenarios.yaml +0 -0
  52. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/tests/realistic_scenarios.yaml +0 -0
  53. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/tests/scenario_examples.yaml +0 -0
  54. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/welcome_files/welcome_file_msg.txt +0 -0
  55. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/bots/valera/welcome_files//320/247/320/265/320/272 /320/273/320/270/321/201/321/202 /320/277/320/276 152/320/244/320/227 /320/270 323/320/244/320/227 /320/264/320/273/321/217 /320/274/320/265/320/264/320/270/321/206/320/270/320/275/321/213.pdf" +0 -0
  56. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/publish.py +0 -0
  57. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/__init__.py +0 -0
  58. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/admin/admin_manager.py +0 -0
  59. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/admin/admin_migration.sql +0 -0
  60. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/admin/admin_tester.py +0 -0
  61. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/admin/timeout_checker.py +0 -0
  62. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/config.py +0 -0
  63. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt +0 -0
  64. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt +0 -0
  65. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt +0 -0
  66. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +0 -0
  67. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/prompts/help_message.txt +0 -0
  68. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/prompts/welcome_message.txt +0 -0
  69. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064229.txt +0 -0
  70. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064335.txt +0 -0
  71. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064638.txt +0 -0
  72. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/tests/quick_scenarios.yaml +0 -0
  73. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/tests/realistic_scenarios.yaml +0 -0
  74. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/tests/scenario_examples.yaml +0 -0
  75. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +0 -0
  76. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/configs/growthmed-october-24/welcome_file//320/247/320/265/320/272 /320/273/320/270/321/201/321/202 /320/277/320/276 152/320/244/320/227 /320/270 323/320/244/320/227 /320/264/320/273/321/217 /320/274/320/265/320/264/320/270/321/206/320/270/320/275/321/213.pdf" +0 -0
  77. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/core/conversation_manager.py +0 -0
  78. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/core/message_sender.py +0 -0
  79. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/core/router.py +0 -0
  80. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/core/router_manager.py +0 -0
  81. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/creation/__init__.py +0 -0
  82. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/creation/bot_testing.py +0 -0
  83. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/event/__init__.py +0 -0
  84. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/message/__init__.py +0 -0
  85. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/router/__init__.py +0 -0
  86. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/setup_checker.py +0 -0
  87. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/supabase/__init__.py +0 -0
  88. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/supabase/client.py +0 -0
  89. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/utils/__init__.py +0 -0
  90. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/utils/debug_routing.py +0 -0
  91. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/utils/prompt_loader.py +0 -0
  92. {smart_bot_factory-0.3.1 → smart_bot_factory-0.3.3}/smart_bot_factory/utils/user_prompt_loader.py +0 -0
@@ -213,3 +213,8 @@ cython_debug/
213
213
  marimo/_static/
214
214
  marimo/_lsp/
215
215
  __marimo__/
216
+
217
+ # Temporary event files
218
+ temp_event_files/
219
+ temp_with_msg/
220
+ temp_after_msg/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smart-bot-factory
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Библиотека для создания умных чат-ботов
5
5
  Author-email: Kopatych <eserov73@gmail.com>
6
6
  License: MIT
@@ -25,6 +25,7 @@ Requires-Dist: aiogram>=3.4.1
25
25
  Requires-Dist: click>=8.0.0
26
26
  Requires-Dist: openai>=1.12.0
27
27
  Requires-Dist: project-root-finder>=1.9
28
+ Requires-Dist: python-dateutil>=2.9.0.post0
28
29
  Requires-Dist: python-dotenv>=1.0.1
29
30
  Requires-Dist: pytz>=2023.3
30
31
  Requires-Dist: pyyaml>=6.0.2
@@ -33,27 +34,27 @@ Description-Content-Type: text/markdown
33
34
 
34
35
  # Smart Bot Factory
35
36
 
36
- **Библиотека для создания умных Telegram ботов с AI, аналитикой и гибкой архитектурой**
37
+ ## Библиотека для создания умных Telegram ботов с AI, аналитикой и гибкой архитектурой
37
38
 
38
39
  ## 📋 Содержание
39
40
 
40
- - [Установка](#установка)
41
- - [Быстрый старт](#быстрый-старт)
42
- - [CLI Команды](#cli-команды)
43
- - [Декораторы](#декораторы)
41
+ - [Установка](#-установка)
42
+ - [Быстрый старт](#-быстрый-старт)
43
+ - [CLI Команды](#-cli-команды)
44
+ - [Декораторы](#-декораторы)
44
45
  - [event_handler](#event_handler---обработчики-событий)
45
46
  - [schedule_task](#schedule_task---запланированные-задачи)
46
47
  - [global_handler](#global_handler---глобальные-обработчики)
47
- - [Хуки для кастомизации](#хуки-для-кастомизации)
48
- - [Telegram роутеры](#telegram-роутеры)
49
- - [Расширенные возможности](#расширенные-возможности)
48
+ - [Хуки для кастомизации](#-хуки-для-кастомизации)
49
+ - [Telegram роутеры](#-telegram-роутеры)
50
+ - [Расширенные возможности](#-расширенные-возможности)
50
51
 
51
52
  ---
52
53
 
53
54
  ## 🚀 Установка
54
55
 
55
56
  ```bash
56
- pip install smart-bot-factory
57
+ pip install smart_bot_factory
57
58
  ```
58
59
 
59
60
  ## ⚡ Быстрый старт
@@ -112,10 +113,18 @@ if __name__ == "__main__":
112
113
  # Создать нового бота из базового шаблона
113
114
  sbf create my-bot
114
115
 
115
- # Создать из кастомного шаблона
116
- sbf create new-bot existing-bot
116
+ # Скопировать существующего бота
117
+ sbf copy best-valera new-valera
118
+
117
119
  ```
118
120
 
121
+ **💡 Команда `copy` - создает нового бота на основе существующего:**
122
+
123
+ - ✅ Копирует код бота с автозаменой `bot_id`
124
+ - ✅ Копирует все промпты
125
+ - ✅ Копирует тесты и файлы
126
+ - ✅ Создает новый `.env` (не копирует токены)
127
+
119
128
  ### Управление ботами
120
129
 
121
130
  ```bash
@@ -268,7 +277,7 @@ async def handler(user_id: int, user_data: str):
268
277
 
269
278
  **Формула времени с `event_type`:**
270
279
 
271
- ```
280
+ ```text
272
281
  reminder_time = event_datetime - delay
273
282
  ```
274
283
 
@@ -622,8 +631,8 @@ from smart_bot_factory.message import send_message
622
631
  async def send_catalog(user_id: int, event_data: str):
623
632
  """Отправляет каталог с файлами"""
624
633
  from smart_bot_factory.message import get_bot
625
- from smart_bot_factory.supabase import SupabaseClient
626
-
634
+ from smart_bot_factory.supabase import SupabaseClient
635
+
627
636
  bot = get_bot()
628
637
  supabase_client = SupabaseClient("my-bot")
629
638
 
@@ -761,7 +770,7 @@ if __name__ == "__main__":
761
770
 
762
771
  ## 📖 Структура проекта
763
772
 
764
- ```
773
+ ```text
765
774
  project/
766
775
  ├── bots/
767
776
  │ └── my-bot/
@@ -781,7 +790,7 @@ project/
781
790
 
782
791
  ## ⚙️ Конфигурация (.env)
783
792
 
784
- ```env
793
+ ```bash
785
794
  # Telegram
786
795
  TELEGRAM_BOT_TOKEN=your_token_here
787
796
 
@@ -1,26 +1,26 @@
1
1
  # Smart Bot Factory
2
2
 
3
- **Библиотека для создания умных Telegram ботов с AI, аналитикой и гибкой архитектурой**
3
+ ## Библиотека для создания умных Telegram ботов с AI, аналитикой и гибкой архитектурой
4
4
 
5
5
  ## 📋 Содержание
6
6
 
7
- - [Установка](#установка)
8
- - [Быстрый старт](#быстрый-старт)
9
- - [CLI Команды](#cli-команды)
10
- - [Декораторы](#декораторы)
7
+ - [Установка](#-установка)
8
+ - [Быстрый старт](#-быстрый-старт)
9
+ - [CLI Команды](#-cli-команды)
10
+ - [Декораторы](#-декораторы)
11
11
  - [event_handler](#event_handler---обработчики-событий)
12
12
  - [schedule_task](#schedule_task---запланированные-задачи)
13
13
  - [global_handler](#global_handler---глобальные-обработчики)
14
- - [Хуки для кастомизации](#хуки-для-кастомизации)
15
- - [Telegram роутеры](#telegram-роутеры)
16
- - [Расширенные возможности](#расширенные-возможности)
14
+ - [Хуки для кастомизации](#-хуки-для-кастомизации)
15
+ - [Telegram роутеры](#-telegram-роутеры)
16
+ - [Расширенные возможности](#-расширенные-возможности)
17
17
 
18
18
  ---
19
19
 
20
20
  ## 🚀 Установка
21
21
 
22
22
  ```bash
23
- pip install smart-bot-factory
23
+ pip install smart_bot_factory
24
24
  ```
25
25
 
26
26
  ## ⚡ Быстрый старт
@@ -79,10 +79,18 @@ if __name__ == "__main__":
79
79
  # Создать нового бота из базового шаблона
80
80
  sbf create my-bot
81
81
 
82
- # Создать из кастомного шаблона
83
- sbf create new-bot existing-bot
82
+ # Скопировать существующего бота
83
+ sbf copy best-valera new-valera
84
+
84
85
  ```
85
86
 
87
+ **💡 Команда `copy` - создает нового бота на основе существующего:**
88
+
89
+ - ✅ Копирует код бота с автозаменой `bot_id`
90
+ - ✅ Копирует все промпты
91
+ - ✅ Копирует тесты и файлы
92
+ - ✅ Создает новый `.env` (не копирует токены)
93
+
86
94
  ### Управление ботами
87
95
 
88
96
  ```bash
@@ -235,7 +243,7 @@ async def handler(user_id: int, user_data: str):
235
243
 
236
244
  **Формула времени с `event_type`:**
237
245
 
238
- ```
246
+ ```text
239
247
  reminder_time = event_datetime - delay
240
248
  ```
241
249
 
@@ -589,8 +597,8 @@ from smart_bot_factory.message import send_message
589
597
  async def send_catalog(user_id: int, event_data: str):
590
598
  """Отправляет каталог с файлами"""
591
599
  from smart_bot_factory.message import get_bot
592
- from smart_bot_factory.supabase import SupabaseClient
593
-
600
+ from smart_bot_factory.supabase import SupabaseClient
601
+
594
602
  bot = get_bot()
595
603
  supabase_client = SupabaseClient("my-bot")
596
604
 
@@ -728,7 +736,7 @@ if __name__ == "__main__":
728
736
 
729
737
  ## 📖 Структура проекта
730
738
 
731
- ```
739
+ ```text
732
740
  project/
733
741
  ├── bots/
734
742
  │ └── my-bot/
@@ -748,7 +756,7 @@ project/
748
756
 
749
757
  ## ⚙️ Конфигурация (.env)
750
758
 
751
- ```env
759
+ ```bash
752
760
  # Telegram
753
761
  TELEGRAM_BOT_TOKEN=your_token_here
754
762
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smart-bot-factory"
3
- version = "0.3.1"
3
+ version = "0.3.3"
4
4
  description = "Библиотека для создания умных чат-ботов"
5
5
  authors = [
6
6
  {name = "Kopatych", email = "eserov73@gmail.com"}
@@ -33,6 +33,7 @@ dependencies = [
33
33
  # CLI интерфейс
34
34
  "click>=8.0.0",
35
35
  "project-root-finder>=1.9",
36
+ "python-dateutil>=2.9.0.post0",
36
37
  ]
37
38
  requires-python = ">=3.9"
38
39
  readme = "README.md"
@@ -6,9 +6,11 @@ from .admin_logic import setup_admin_handlers
6
6
  from .admin_manager import AdminManager
7
7
  from .admin_tester import test_admin_system
8
8
  from .timeout_checker import check_timeouts, setup_bot_environment
9
+ from .admin_events import setup_admin_events_handlers
9
10
 
10
11
  __all__ = [
11
12
  'setup_admin_handlers',
13
+ 'setup_admin_events_handlers',
12
14
  'AdminManager',
13
15
  'test_admin_system',
14
16
  'check_timeouts',