@_vrsen/openswarm 0.1.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 (316) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -0
  3. package/bin/openswarm.js +38 -0
  4. package/config.py +34 -0
  5. package/data_analyst_agent/.cursor/rules/data_analyst.mdc +43 -0
  6. package/data_analyst_agent/__init__.py +3 -0
  7. package/data_analyst_agent/__pycache__/__init__.cpython-312.pyc +0 -0
  8. package/data_analyst_agent/__pycache__/data_analyst_agent.cpython-312.pyc +0 -0
  9. package/data_analyst_agent/data_analyst_agent.py +45 -0
  10. package/data_analyst_agent/instructions.md +173 -0
  11. package/data_analyst_agent/test_files/test_file.csv +21 -0
  12. package/data_analyst_agent/tools/__init__.py +6 -0
  13. package/deep_research/__init__.py +1 -0
  14. package/deep_research/__pycache__/__init__.cpython-312.pyc +0 -0
  15. package/deep_research/__pycache__/deep_research.cpython-312.pyc +0 -0
  16. package/deep_research/deep_research.py +27 -0
  17. package/deep_research/instructions.md +104 -0
  18. package/deep_research/tools/__init__.py +1 -0
  19. package/docs_agent/__init__.py +3 -0
  20. package/docs_agent/__pycache__/__init__.cpython-312.pyc +0 -0
  21. package/docs_agent/__pycache__/docs_agent.cpython-312.pyc +0 -0
  22. package/docs_agent/docs_agent.py +61 -0
  23. package/docs_agent/instructions.md +418 -0
  24. package/docs_agent/tools/ConvertDocument.py +323 -0
  25. package/docs_agent/tools/CreateDocument.py +287 -0
  26. package/docs_agent/tools/ListDocuments.py +134 -0
  27. package/docs_agent/tools/ModifyDocument.py +247 -0
  28. package/docs_agent/tools/RestoreDocument.py +79 -0
  29. package/docs_agent/tools/ViewDocument.py +153 -0
  30. package/docs_agent/tools/__init__.py +1 -0
  31. package/docs_agent/tools/__pycache__/ConvertDocument.cpython-312.pyc +0 -0
  32. package/docs_agent/tools/__pycache__/CreateDocument.cpython-312.pyc +0 -0
  33. package/docs_agent/tools/__pycache__/ListDocuments.cpython-312.pyc +0 -0
  34. package/docs_agent/tools/__pycache__/ModifyDocument.cpython-312.pyc +0 -0
  35. package/docs_agent/tools/__pycache__/RestoreDocument.cpython-312.pyc +0 -0
  36. package/docs_agent/tools/__pycache__/ViewDocument.cpython-312.pyc +0 -0
  37. package/docs_agent/tools/__pycache__/__init__.cpython-312.pyc +0 -0
  38. package/docs_agent/tools/utils/__init__.py +1 -0
  39. package/docs_agent/tools/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  40. package/docs_agent/tools/utils/__pycache__/doc_file_utils.cpython-312.pyc +0 -0
  41. package/docs_agent/tools/utils/__pycache__/html_docx_blocks.cpython-312.pyc +0 -0
  42. package/docs_agent/tools/utils/__pycache__/html_docx_constants.cpython-312.pyc +0 -0
  43. package/docs_agent/tools/utils/__pycache__/html_docx_core.cpython-312.pyc +0 -0
  44. package/docs_agent/tools/utils/__pycache__/html_docx_css.cpython-312.pyc +0 -0
  45. package/docs_agent/tools/utils/__pycache__/html_docx_images.cpython-312.pyc +0 -0
  46. package/docs_agent/tools/utils/__pycache__/html_docx_page.cpython-312.pyc +0 -0
  47. package/docs_agent/tools/utils/__pycache__/html_docx_paragraphs.cpython-312.pyc +0 -0
  48. package/docs_agent/tools/utils/__pycache__/html_docx_playwright.cpython-312.pyc +0 -0
  49. package/docs_agent/tools/utils/__pycache__/html_docx_selectors.cpython-312.pyc +0 -0
  50. package/docs_agent/tools/utils/__pycache__/html_docx_shared.cpython-312.pyc +0 -0
  51. package/docs_agent/tools/utils/__pycache__/html_validation.cpython-312.pyc +0 -0
  52. package/docs_agent/tools/utils/doc_file_utils.py +29 -0
  53. package/docs_agent/tools/utils/html_docx_blocks.py +262 -0
  54. package/docs_agent/tools/utils/html_docx_constants.py +78 -0
  55. package/docs_agent/tools/utils/html_docx_core.py +138 -0
  56. package/docs_agent/tools/utils/html_docx_css.py +262 -0
  57. package/docs_agent/tools/utils/html_docx_images.py +293 -0
  58. package/docs_agent/tools/utils/html_docx_page.py +185 -0
  59. package/docs_agent/tools/utils/html_docx_paragraphs.py +342 -0
  60. package/docs_agent/tools/utils/html_docx_playwright.py +184 -0
  61. package/docs_agent/tools/utils/html_docx_selectors.py +196 -0
  62. package/docs_agent/tools/utils/html_docx_shared.py +23 -0
  63. package/docs_agent/tools/utils/html_docx_tables.py +942 -0
  64. package/docs_agent/tools/utils/html_validation.py +102 -0
  65. package/helpers.py +59 -0
  66. package/image_generation_agent/__init__.py +1 -0
  67. package/image_generation_agent/__pycache__/__init__.cpython-312.pyc +0 -0
  68. package/image_generation_agent/__pycache__/image_generation_agent.cpython-312.pyc +0 -0
  69. package/image_generation_agent/image_generation_agent.py +31 -0
  70. package/image_generation_agent/instructions.md +80 -0
  71. package/image_generation_agent/tools/CombineImages.py +211 -0
  72. package/image_generation_agent/tools/EditImages.py +200 -0
  73. package/image_generation_agent/tools/GenerateImages.py +184 -0
  74. package/image_generation_agent/tools/RemoveBackground.py +108 -0
  75. package/image_generation_agent/tools/__init__.py +2 -0
  76. package/image_generation_agent/tools/__pycache__/CombineImages.cpython-312.pyc +0 -0
  77. package/image_generation_agent/tools/__pycache__/EditImages.cpython-312.pyc +0 -0
  78. package/image_generation_agent/tools/__pycache__/GenerateImages.cpython-312.pyc +0 -0
  79. package/image_generation_agent/tools/__pycache__/RemoveBackground.cpython-312.pyc +0 -0
  80. package/image_generation_agent/tools/utils/__init__.py +2 -0
  81. package/image_generation_agent/tools/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  82. package/image_generation_agent/tools/utils/__pycache__/image_io.cpython-312.pyc +0 -0
  83. package/image_generation_agent/tools/utils/image_io.py +308 -0
  84. package/onboard.py +325 -0
  85. package/orchestrator/__init__.py +3 -0
  86. package/orchestrator/__pycache__/__init__.cpython-312.pyc +0 -0
  87. package/orchestrator/__pycache__/orchestrator.cpython-312.pyc +0 -0
  88. package/orchestrator/instructions.md +90 -0
  89. package/orchestrator/orchestrator.py +33 -0
  90. package/package.json +49 -0
  91. package/patches/__init__.py +1 -0
  92. package/patches/__pycache__/__init__.cpython-312.pyc +0 -0
  93. package/patches/__pycache__/patch_agency_swarm_dual_comms.cpython-312.pyc +0 -0
  94. package/patches/__pycache__/patch_file_attachment_refs.cpython-312.pyc +0 -0
  95. package/patches/__pycache__/patch_ipython_interpreter_composio.cpython-312.pyc +0 -0
  96. package/patches/dom-to-pptx+1.1.5.patch +133440 -0
  97. package/patches/patch_agency_swarm_dual_comms.py +199 -0
  98. package/patches/patch_file_attachment_refs.py +74 -0
  99. package/patches/patch_ipython_interpreter_composio.py +54 -0
  100. package/pyproject.toml +67 -0
  101. package/run.py +343 -0
  102. package/server.py +26 -0
  103. package/shared_instructions.md +119 -0
  104. package/shared_tools/CopyFile.py +68 -0
  105. package/shared_tools/ExecuteTool.py +184 -0
  106. package/shared_tools/FindTools.py +101 -0
  107. package/shared_tools/ManageConnections.py +43 -0
  108. package/shared_tools/SearchTools.py +44 -0
  109. package/shared_tools/__init__.py +7 -0
  110. package/shared_tools/__pycache__/CopyFile.cpython-312.pyc +0 -0
  111. package/shared_tools/__pycache__/ExecuteTool.cpython-312.pyc +0 -0
  112. package/shared_tools/__pycache__/FindTools.cpython-312.pyc +0 -0
  113. package/shared_tools/__pycache__/ManageConnections.cpython-312.pyc +0 -0
  114. package/shared_tools/__pycache__/SearchTools.cpython-312.pyc +0 -0
  115. package/shared_tools/__pycache__/__init__.cpython-312.pyc +0 -0
  116. package/slides_agent/.cursor/rules/slides-agent-workflow.mdc +9 -0
  117. package/slides_agent/__init__.py +1 -0
  118. package/slides_agent/__pycache__/__init__.cpython-312.pyc +0 -0
  119. package/slides_agent/__pycache__/slides_agent.cpython-312.pyc +0 -0
  120. package/slides_agent/instructions.md +298 -0
  121. package/slides_agent/pptx/SKILL.md +528 -0
  122. package/slides_agent/pptx/html2pptx.md +625 -0
  123. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  124. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  125. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  126. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  127. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  128. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  129. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  130. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  131. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  132. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  133. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  134. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  135. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  136. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  137. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  138. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  139. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  140. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  141. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  142. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  143. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  144. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  145. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  146. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  147. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  148. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  149. package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  150. package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  151. package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  152. package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  153. package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  154. package/slides_agent/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  155. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  156. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  157. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  158. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  159. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  160. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  161. package/slides_agent/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  162. package/slides_agent/pptx/ooxml/scripts/pack.py +169 -0
  163. package/slides_agent/pptx/ooxml/scripts/unpack.py +29 -0
  164. package/slides_agent/pptx/ooxml/scripts/validate.py +69 -0
  165. package/slides_agent/pptx/ooxml/scripts/validation/__init__.py +15 -0
  166. package/slides_agent/pptx/ooxml/scripts/validation/base.py +951 -0
  167. package/slides_agent/pptx/ooxml/scripts/validation/docx.py +274 -0
  168. package/slides_agent/pptx/ooxml/scripts/validation/pptx.py +315 -0
  169. package/slides_agent/pptx/ooxml/scripts/validation/redlining.py +279 -0
  170. package/slides_agent/pptx/ooxml.md +427 -0
  171. package/slides_agent/pptx/scripts/html2pptx.js +1092 -0
  172. package/slides_agent/pptx/scripts/inventory.py +1020 -0
  173. package/slides_agent/pptx/scripts/rearrange.py +231 -0
  174. package/slides_agent/pptx/scripts/replace.py +385 -0
  175. package/slides_agent/pptx/scripts/thumbnail.py +451 -0
  176. package/slides_agent/slides_agent.py +109 -0
  177. package/slides_agent/test_deck/_theme.css +92 -0
  178. package/slides_agent/test_deck/assets/placeholder.svg +11 -0
  179. package/slides_agent/test_deck/slide_01_title.html +10 -0
  180. package/slides_agent/test_deck/slide_02_image_split.html +23 -0
  181. package/slides_agent/test_deck/slide_03_kpi.html +21 -0
  182. package/slides_agent/tools/ApplyPptxTextReplacements.py +91 -0
  183. package/slides_agent/tools/BuildPptxFromHtmlSlides.py +221 -0
  184. package/slides_agent/tools/CheckSlide.py +218 -0
  185. package/slides_agent/tools/CheckSlideCanvasOverflow.py +221 -0
  186. package/slides_agent/tools/CreateImageMontage.py +261 -0
  187. package/slides_agent/tools/CreatePptxThumbnailGrid.py +168 -0
  188. package/slides_agent/tools/DeleteSlide.py +78 -0
  189. package/slides_agent/tools/DownloadImage.py +79 -0
  190. package/slides_agent/tools/EnsureRasterImage.py +157 -0
  191. package/slides_agent/tools/ExtractPptxTextInventory.py +104 -0
  192. package/slides_agent/tools/GenerateImage.py +189 -0
  193. package/slides_agent/tools/ImageSearch.py +127 -0
  194. package/slides_agent/tools/InsertNewSlides.py +393 -0
  195. package/slides_agent/tools/ManageTheme.py +112 -0
  196. package/slides_agent/tools/ModifySlide.py +563 -0
  197. package/slides_agent/tools/ReadSlide.py +26 -0
  198. package/slides_agent/tools/RearrangePptxSlidesFromTemplate.py +114 -0
  199. package/slides_agent/tools/RestoreSnapshot.py +89 -0
  200. package/slides_agent/tools/SlideScreenshot.py +66 -0
  201. package/slides_agent/tools/__init__.py +54 -0
  202. package/slides_agent/tools/__pycache__/ApplyPptxTextReplacements.cpython-312.pyc +0 -0
  203. package/slides_agent/tools/__pycache__/BuildPptxFromHtmlSlides.cpython-312.pyc +0 -0
  204. package/slides_agent/tools/__pycache__/CheckSlide.cpython-312.pyc +0 -0
  205. package/slides_agent/tools/__pycache__/CheckSlideCanvasOverflow.cpython-312.pyc +0 -0
  206. package/slides_agent/tools/__pycache__/CreateImageMontage.cpython-312.pyc +0 -0
  207. package/slides_agent/tools/__pycache__/CreatePptxThumbnailGrid.cpython-312.pyc +0 -0
  208. package/slides_agent/tools/__pycache__/DeleteSlide.cpython-312.pyc +0 -0
  209. package/slides_agent/tools/__pycache__/DownloadImage.cpython-312.pyc +0 -0
  210. package/slides_agent/tools/__pycache__/EnsureRasterImage.cpython-312.pyc +0 -0
  211. package/slides_agent/tools/__pycache__/ExtractPptxTextInventory.cpython-312.pyc +0 -0
  212. package/slides_agent/tools/__pycache__/GenerateImage.cpython-312.pyc +0 -0
  213. package/slides_agent/tools/__pycache__/ImageSearch.cpython-312.pyc +0 -0
  214. package/slides_agent/tools/__pycache__/InsertNewSlides.cpython-312.pyc +0 -0
  215. package/slides_agent/tools/__pycache__/ManageTheme.cpython-312.pyc +0 -0
  216. package/slides_agent/tools/__pycache__/ModifySlide.cpython-312.pyc +0 -0
  217. package/slides_agent/tools/__pycache__/ReadSlide.cpython-312.pyc +0 -0
  218. package/slides_agent/tools/__pycache__/RearrangePptxSlidesFromTemplate.cpython-312.pyc +0 -0
  219. package/slides_agent/tools/__pycache__/RestoreSnapshot.cpython-312.pyc +0 -0
  220. package/slides_agent/tools/__pycache__/SlideScreenshot.cpython-312.pyc +0 -0
  221. package/slides_agent/tools/__pycache__/__init__.cpython-312.pyc +0 -0
  222. package/slides_agent/tools/__pycache__/slide_file_utils.cpython-312.pyc +0 -0
  223. package/slides_agent/tools/__pycache__/slide_html_utils.cpython-312.pyc +0 -0
  224. package/slides_agent/tools/__pycache__/template_registry.cpython-312.pyc +0 -0
  225. package/slides_agent/tools/deck_utils.py +31 -0
  226. package/slides_agent/tools/html2pptx_runner.js +1183 -0
  227. package/slides_agent/tools/html_writer_instructions.md +149 -0
  228. package/slides_agent/tools/slide_file_utils.py +108 -0
  229. package/slides_agent/tools/slide_html_utils.py +354 -0
  230. package/slides_agent/tools/template_registry.py +55 -0
  231. package/swarm.py +82 -0
  232. package/video_generation_agent/__init__.py +1 -0
  233. package/video_generation_agent/__pycache__/__init__.cpython-312.pyc +0 -0
  234. package/video_generation_agent/__pycache__/video_generation_agent.cpython-312.pyc +0 -0
  235. package/video_generation_agent/instructions.md +178 -0
  236. package/video_generation_agent/tools/AddSubtitles.py +425 -0
  237. package/video_generation_agent/tools/CombineImages.py +166 -0
  238. package/video_generation_agent/tools/CombineVideos.py +113 -0
  239. package/video_generation_agent/tools/EditAudio.py +297 -0
  240. package/video_generation_agent/tools/EditImage.py +144 -0
  241. package/video_generation_agent/tools/EditVideoContent.py +369 -0
  242. package/video_generation_agent/tools/GenerateImage.py +133 -0
  243. package/video_generation_agent/tools/GenerateVideo.py +556 -0
  244. package/video_generation_agent/tools/TrimVideo.py +233 -0
  245. package/video_generation_agent/tools/__init__.py +1 -0
  246. package/video_generation_agent/tools/__pycache__/AddSubtitles.cpython-312.pyc +0 -0
  247. package/video_generation_agent/tools/__pycache__/CombineImages.cpython-312.pyc +0 -0
  248. package/video_generation_agent/tools/__pycache__/CombineVideos.cpython-312.pyc +0 -0
  249. package/video_generation_agent/tools/__pycache__/EditAudio.cpython-312.pyc +0 -0
  250. package/video_generation_agent/tools/__pycache__/EditImage.cpython-312.pyc +0 -0
  251. package/video_generation_agent/tools/__pycache__/EditVideoContent.cpython-312.pyc +0 -0
  252. package/video_generation_agent/tools/__pycache__/GenerateImage.cpython-312.pyc +0 -0
  253. package/video_generation_agent/tools/__pycache__/GenerateVideo.cpython-312.pyc +0 -0
  254. package/video_generation_agent/tools/__pycache__/TrimVideo.cpython-312.pyc +0 -0
  255. package/video_generation_agent/tools/utils/__init__.py +1 -0
  256. package/video_generation_agent/tools/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  257. package/video_generation_agent/tools/utils/__pycache__/image_utils.cpython-312.pyc +0 -0
  258. package/video_generation_agent/tools/utils/__pycache__/video_utils.cpython-312.pyc +0 -0
  259. package/video_generation_agent/tools/utils/image_utils.py +174 -0
  260. package/video_generation_agent/tools/utils/video_utils.py +522 -0
  261. package/video_generation_agent/video_generation_agent.py +26 -0
  262. package/virtual_assistant/__init__.py +1 -0
  263. package/virtual_assistant/__pycache__/__init__.cpython-312.pyc +0 -0
  264. package/virtual_assistant/__pycache__/virtual_assistant.cpython-312.pyc +0 -0
  265. package/virtual_assistant/instructions.md +206 -0
  266. package/virtual_assistant/tools/AddLabelToEmail.py +154 -0
  267. package/virtual_assistant/tools/CheckEventsForDate.py +218 -0
  268. package/virtual_assistant/tools/CheckUnreadSlackMessages.py +216 -0
  269. package/virtual_assistant/tools/CreateCalendarEvent.py +261 -0
  270. package/virtual_assistant/tools/DeleteCalendarEvent.py +137 -0
  271. package/virtual_assistant/tools/DeleteDraft.py +95 -0
  272. package/virtual_assistant/tools/DraftEmail.py +239 -0
  273. package/virtual_assistant/tools/EditFile.py +113 -0
  274. package/virtual_assistant/tools/FindEmails.py +330 -0
  275. package/virtual_assistant/tools/GetCurrentTime.py +69 -0
  276. package/virtual_assistant/tools/GetSlackUserInfo.py +117 -0
  277. package/virtual_assistant/tools/ListDirectory.py +113 -0
  278. package/virtual_assistant/tools/ListSkills.py +94 -0
  279. package/virtual_assistant/tools/ManageLabels.py +295 -0
  280. package/virtual_assistant/tools/ProductSearch.py +254 -0
  281. package/virtual_assistant/tools/ReadEmail.py +251 -0
  282. package/virtual_assistant/tools/ReadFile.py +108 -0
  283. package/virtual_assistant/tools/ReadSlackMessages.py +191 -0
  284. package/virtual_assistant/tools/RemoveLabelFromEmail.py +137 -0
  285. package/virtual_assistant/tools/RescheduleCalendarEvent.py +227 -0
  286. package/virtual_assistant/tools/ScholarSearch.py +216 -0
  287. package/virtual_assistant/tools/SendDraft.py +101 -0
  288. package/virtual_assistant/tools/SendSlackMessage.py +148 -0
  289. package/virtual_assistant/tools/WriteFile.py +95 -0
  290. package/virtual_assistant/tools/__init__.py +1 -0
  291. package/virtual_assistant/tools/__pycache__/AddLabelToEmail.cpython-312.pyc +0 -0
  292. package/virtual_assistant/tools/__pycache__/CheckEventsForDate.cpython-312.pyc +0 -0
  293. package/virtual_assistant/tools/__pycache__/CheckUnreadSlackMessages.cpython-312.pyc +0 -0
  294. package/virtual_assistant/tools/__pycache__/CreateCalendarEvent.cpython-312.pyc +0 -0
  295. package/virtual_assistant/tools/__pycache__/DeleteCalendarEvent.cpython-312.pyc +0 -0
  296. package/virtual_assistant/tools/__pycache__/DeleteDraft.cpython-312.pyc +0 -0
  297. package/virtual_assistant/tools/__pycache__/DraftEmail.cpython-312.pyc +0 -0
  298. package/virtual_assistant/tools/__pycache__/EditFile.cpython-312.pyc +0 -0
  299. package/virtual_assistant/tools/__pycache__/FindEmails.cpython-312.pyc +0 -0
  300. package/virtual_assistant/tools/__pycache__/GetCurrentTime.cpython-312.pyc +0 -0
  301. package/virtual_assistant/tools/__pycache__/GetSlackUserInfo.cpython-312.pyc +0 -0
  302. package/virtual_assistant/tools/__pycache__/ListDirectory.cpython-312.pyc +0 -0
  303. package/virtual_assistant/tools/__pycache__/ListSkills.cpython-312.pyc +0 -0
  304. package/virtual_assistant/tools/__pycache__/ManageLabels.cpython-312.pyc +0 -0
  305. package/virtual_assistant/tools/__pycache__/ProductSearch.cpython-312.pyc +0 -0
  306. package/virtual_assistant/tools/__pycache__/ReadEmail.cpython-312.pyc +0 -0
  307. package/virtual_assistant/tools/__pycache__/ReadFile.cpython-312.pyc +0 -0
  308. package/virtual_assistant/tools/__pycache__/ReadSlackMessages.cpython-312.pyc +0 -0
  309. package/virtual_assistant/tools/__pycache__/RemoveLabelFromEmail.cpython-312.pyc +0 -0
  310. package/virtual_assistant/tools/__pycache__/RescheduleCalendarEvent.cpython-312.pyc +0 -0
  311. package/virtual_assistant/tools/__pycache__/ScholarSearch.cpython-312.pyc +0 -0
  312. package/virtual_assistant/tools/__pycache__/SendDraft.cpython-312.pyc +0 -0
  313. package/virtual_assistant/tools/__pycache__/SendSlackMessage.cpython-312.pyc +0 -0
  314. package/virtual_assistant/tools/__pycache__/WriteFile.cpython-312.pyc +0 -0
  315. package/virtual_assistant/tools/__pycache__/__init__.cpython-312.pyc +0 -0
  316. package/virtual_assistant/virtual_assistant.py +52 -0
package/run.py ADDED
@@ -0,0 +1,343 @@
1
+ import os
2
+ import sys
3
+ import subprocess
4
+ import shutil
5
+ import tempfile
6
+ from pathlib import Path
7
+
8
+ # ── Bootstrap: create venv + install deps automatically on first run ─────────
9
+ # Only stdlib imports above. _bootstrap() is called explicitly — either from
10
+ # swarm.py (via `from run import _bootstrap; _bootstrap()`) or from the
11
+ # __main__ guard below — never at module level, so `from run import _bootstrap`
12
+ # is safe to call from outside the venv.
13
+ def _bootstrap() -> None:
14
+ _repo = Path(__file__).resolve().parent
15
+ _venv = _repo / ".venv"
16
+ _venv_python = _venv / ("Scripts/python.exe" if sys.platform == "win32" else "bin/python")
17
+
18
+ # If not running inside the repo venv, set it up and re-launch into it.
19
+ if Path(sys.executable).resolve() != _venv_python.resolve():
20
+ if not _venv_python.exists():
21
+ print("Setting up virtual environment…")
22
+ subprocess.check_call([sys.executable, "-m", "venv", str(_venv)])
23
+ print("Installing dependencies, please wait…\n")
24
+ subprocess.check_call([str(_venv_python), "-m", "pip", "install", "-e", str(_repo)])
25
+ print("\nDone.\n")
26
+ # Use subprocess.run instead of os.execv — on Windows, os.execv hands off
27
+ # the ConPTY pipe in a broken state which causes the TUI to receive mouse
28
+ # movements as text input. subprocess.run keeps the parent alive as the
29
+ # terminal owner and gives the child clean handle inheritance.
30
+ sys.exit(subprocess.run([str(_venv_python)] + sys.argv).returncode)
31
+
32
+ # Running inside the venv — ensure deps are present (handles missing/corrupt install).
33
+ try:
34
+ import dotenv # noqa: F401
35
+ import rich # noqa: F401
36
+ import questionary # noqa: F401
37
+ import agency_swarm # noqa: F401
38
+ except ImportError:
39
+ print("Installing dependencies, please wait…\n")
40
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "-e", str(_repo)])
41
+ print("\nDone.\n")
42
+ sys.exit(subprocess.run([sys.executable] + sys.argv).returncode)
43
+
44
+ # Ensure the Playwright browser binary for the installed playwright version
45
+ # is present. playwright install is idempotent — it exits quickly if the
46
+ # right revision is already downloaded.
47
+ try:
48
+ subprocess.check_call(
49
+ [sys.executable, "-m", "playwright", "install", "chromium"],
50
+ stdout=subprocess.DEVNULL,
51
+ stderr=subprocess.DEVNULL,
52
+ )
53
+ except Exception:
54
+ pass
55
+
56
+ # Install LibreOffice and Poppler if missing (used by Slides Agent).
57
+ # Auto-installs when a known package manager is available; silently skips otherwise.
58
+ _soffice = "soffice.com" if sys.platform == "win32" else "soffice"
59
+ if not shutil.which(_soffice):
60
+ if sys.platform == "darwin" and shutil.which("brew"):
61
+ print("Installing LibreOffice (required for Slides Agent), please wait…\n")
62
+ subprocess.check_call(["brew", "install", "--cask", "libreoffice"])
63
+ print("\nDone.\n")
64
+ elif sys.platform.startswith("linux") and shutil.which("apt-get"):
65
+ print("Installing LibreOffice (required for Slides Agent), please wait…\n")
66
+ subprocess.check_call(["sudo", "apt-get", "install", "-y", "libreoffice-impress"])
67
+ print("\nDone.\n")
68
+ elif sys.platform == "win32" and shutil.which("winget"):
69
+ print("Installing LibreOffice (required for Slides Agent), please wait…\n")
70
+ subprocess.check_call(["winget", "install", "--id", "TheDocumentFoundation.LibreOffice", "-e", "--silent"])
71
+ print("\nDone.\n")
72
+ else:
73
+ print(
74
+ "Warning: LibreOffice not found — Slides Agent thumbnail and export features "
75
+ "will be unavailable.\n"
76
+ " Install it from: https://www.libreoffice.org/download/download-libreoffice/\n"
77
+ )
78
+
79
+ if not shutil.which("pdftoppm"):
80
+ if sys.platform == "darwin" and shutil.which("brew"):
81
+ print("Installing Poppler (required for Slides Agent), please wait…\n")
82
+ subprocess.check_call(["brew", "install", "poppler"])
83
+ print("\nDone.\n")
84
+ elif sys.platform.startswith("linux") and shutil.which("apt-get"):
85
+ print("Installing Poppler (required for Slides Agent), please wait…\n")
86
+ subprocess.check_call(["sudo", "apt-get", "install", "-y", "poppler-utils"])
87
+ print("\nDone.\n")
88
+ elif sys.platform == "win32" and shutil.which("winget"):
89
+ print("Installing Poppler (required for Slides Agent), please wait…\n")
90
+ subprocess.check_call(["winget", "install", "--id", "oschwartz10612.Poppler", "-e", "--silent"])
91
+ print("\nDone.\n")
92
+ else:
93
+ print(
94
+ "Warning: Poppler (pdftoppm) not found — Slides Agent thumbnail and export "
95
+ "features will be unavailable.\n"
96
+ " Install it from: https://poppler.freedesktop.org\n"
97
+ )
98
+
99
+ # Install Node.js dependencies if node_modules is missing or outdated.
100
+ _npm = shutil.which("npm")
101
+ if _npm and (_repo / "package.json").exists():
102
+ _node_modules = _repo / "node_modules"
103
+ _pkg_lock = _repo / "package-lock.json"
104
+ _npm_marker = _node_modules / ".package-lock.json"
105
+ _need_npm = (
106
+ not _node_modules.exists()
107
+ or not _npm_marker.exists()
108
+ or (_pkg_lock.exists() and _pkg_lock.stat().st_mtime > _npm_marker.stat().st_mtime)
109
+ )
110
+ if _need_npm:
111
+ print("Installing Node.js dependencies, please wait…\n")
112
+ subprocess.check_call([_npm, "install"], cwd=str(_repo))
113
+ print("\nDone.\n")
114
+
115
+ # Download the OpenSwarm TUI binary from GitHub Releases if missing.
116
+ _bin_name = "agency.exe" if sys.platform == "win32" else "agency"
117
+ _bin_path = _repo / _bin_name
118
+ if not _bin_path.exists():
119
+ import urllib.request
120
+ _bin_url = f"https://github.com/VRSEN/OpenSwarm/releases/latest/download/{_bin_name}"
121
+ print("Downloading OpenSwarm TUI, please wait…\n")
122
+ try:
123
+ urllib.request.urlretrieve(_bin_url, str(_bin_path))
124
+ if sys.platform != "win32":
125
+ _bin_path.chmod(0o755)
126
+ print("\nDone.\n")
127
+ except Exception:
128
+ print("Warning: Could not download OpenSwarm TUI. The terminal UI will use the default.\n")
129
+ # ─────────────────────────────────────────────────────────────────────────────
130
+
131
+
132
+ _PROVIDER_KEYS = ["OPENAI_API_KEY", "ANTHROPIC_API_KEY", "GOOGLE_API_KEY"]
133
+
134
+ _OPTIONAL_INTEGRATIONS = [
135
+ ("Composio (10,000+ external integrations)", ["COMPOSIO_API_KEY", "COMPOSIO_USER_ID"]),
136
+ ("Anthropic / Claude models", ["ANTHROPIC_API_KEY"]),
137
+ ("Search", ["SEARCH_API_KEY"]),
138
+ ("Fal.ai (video & audio generation)", ["FAL_KEY"]),
139
+ ("Google AI / Gemini", ["GOOGLE_API_KEY"]),
140
+ ("Pexels (stock images)", ["PEXELS_API_KEY"]),
141
+ ("Pixabay (stock images)", ["PIXABAY_API_KEY"]),
142
+ ("Unsplash (stock images)", ["UNSPLASH_ACCESS_KEY"]),
143
+ ]
144
+
145
+
146
+ def _ensure_configured() -> None:
147
+ """Launch the onboarding wizard if no provider key is present."""
148
+ from dotenv import load_dotenv
149
+ if any(os.getenv(k) for k in _PROVIDER_KEYS):
150
+ return
151
+ from onboard import run_onboarding
152
+ run_onboarding()
153
+ load_dotenv(override=True)
154
+
155
+
156
+ def build_integration_summary() -> str:
157
+ lines = ["Optional integrations:"]
158
+ for name, keys in _OPTIONAL_INTEGRATIONS:
159
+ active = [k for k in keys if os.getenv(k)]
160
+ if active:
161
+ lines.append(f" ✓ {name}")
162
+ else:
163
+ lines.append(f" ✗ {name} (missing: {', '.join(keys)})")
164
+ return "\n".join(lines)
165
+
166
+
167
+ def _configure_demo_console() -> None:
168
+ """
169
+ Terminal demo runs can stream stdout/stderr into a UI that expects structured output.
170
+ Some third-party libs emit warnings that can corrupt that stream, so we suppress the
171
+ known noisy ones here and apply the recommended Windows event-loop policy for pyzmq.
172
+ """
173
+ import warnings
174
+
175
+ # By default, silence *all* console output for demo runs.
176
+ # Opt out by setting OPENSWARM_DEMO_SILENCE_CONSOLE=0 / false / off.
177
+ silence_env = os.getenv("OPENSWARM_DEMO_SILENCE_CONSOLE", "").strip().lower()
178
+ silence_console = silence_env not in {"0", "false", "no", "off"}
179
+
180
+ if silence_console:
181
+ try:
182
+ import logging
183
+ devnull = open(os.devnull, "w", encoding="utf-8") # noqa: SIM115
184
+ sys.stdout = devnull # type: ignore[assignment]
185
+ sys.stderr = devnull # type: ignore[assignment]
186
+ logging.disable(logging.CRITICAL)
187
+ except Exception:
188
+ pass
189
+ return
190
+
191
+ # Keep this opt-in so developers can still see warnings when needed.
192
+ if os.getenv("OPENSWARM_DEMO_SHOW_WARNINGS", "").strip().lower() in {"1", "true", "yes", "on"}:
193
+ return
194
+
195
+ # pyzmq RuntimeWarning on Windows ProactorEventLoop (common with Python 3.8+ / 3.12)
196
+ warnings.filterwarnings(
197
+ "ignore",
198
+ message=r".*Proactor event loop does not implement add_reader.*",
199
+ category=RuntimeWarning,
200
+ )
201
+
202
+ # Pydantic v2 serializer warnings can be very noisy for streamed/typed objects.
203
+ warnings.filterwarnings(
204
+ "ignore",
205
+ message=r"^Pydantic serializer warnings:.*",
206
+ category=UserWarning,
207
+ )
208
+
209
+ # Prefer preventing the pyzmq warning entirely on Windows.
210
+ if os.name == "nt":
211
+ try:
212
+ import asyncio
213
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
214
+ except Exception:
215
+ pass
216
+
217
+
218
+ def patch_terminal_title_binary() -> None:
219
+ """
220
+ Overwrite Agency Swarm's cached TUI executable with the repo-local `agency.exe`.
221
+
222
+ The "AGENTSWARM" banner/title is rendered by that external executable, not by Python.
223
+ """
224
+ local_exe = Path(__file__).resolve().parent / "agency.exe"
225
+ if not local_exe.exists():
226
+ return
227
+
228
+ try:
229
+ from agency_swarm.ui.demos import agentswarm_cli as cli
230
+ cached_exe = Path(cli._command()[0])
231
+ except Exception:
232
+ return
233
+
234
+ if not cached_exe.exists():
235
+ return
236
+
237
+ try:
238
+ cached_exe.parent.mkdir(parents=True, exist_ok=True)
239
+ shutil.copy2(local_exe, cached_exe)
240
+ except Exception:
241
+ return
242
+
243
+
244
+ def main() -> None:
245
+ from dotenv import load_dotenv
246
+ load_dotenv()
247
+
248
+ _ensure_configured()
249
+
250
+ if not os.getenv("AGENTSWARM_BIN"):
251
+ _repo = Path(__file__).resolve().parent
252
+ # Prefer locally built dev binary when present (third_party/agentswarm-cli build output).
253
+ import platform as _platform
254
+ _machine = _platform.machine().lower()
255
+ _is_arm = _machine in ("aarch64", "arm64")
256
+ if sys.platform == "win32":
257
+ _os_name = "windows"
258
+ _bin_name = "agentswarm.exe"
259
+ elif sys.platform == "darwin":
260
+ _os_name = "darwin"
261
+ _bin_name = "agentswarm"
262
+ else:
263
+ _os_name = "linux"
264
+ _bin_name = "agentswarm"
265
+ # Try standard x64 first; fall back to baseline for older CPUs.
266
+ if _is_arm:
267
+ _arches = ["arm64"]
268
+ else:
269
+ _arches = ["x64", "x64-baseline"]
270
+ _dev_exe = None
271
+ for _arch in _arches:
272
+ _candidate = _repo / f"third_party/agentswarm-cli/packages/opencode/dist/agentswarm-cli-{_os_name}-{_arch}/bin/{_bin_name}"
273
+ if _candidate.exists():
274
+ _dev_exe = _candidate
275
+ break
276
+ if _dev_exe is not None:
277
+ os.environ["AGENTSWARM_BIN"] = str(_dev_exe)
278
+ else:
279
+ local_exe = _repo / "agency.exe"
280
+ if local_exe.exists():
281
+ os.environ["AGENTSWARM_BIN"] = str(local_exe)
282
+
283
+ # Disable OpenAI Agents SDK tracing for terminal demo runs.
284
+ try:
285
+ from agents import set_tracing_disabled
286
+ set_tracing_disabled(True)
287
+ except Exception:
288
+ pass
289
+
290
+ from swarm import create_agency
291
+
292
+ onboard_flag = Path(tempfile.gettempdir()) / "_openswarm_onboard.flag"
293
+ os.environ["OPENSWARM_ONBOARD_FLAG"] = str(onboard_flag)
294
+ onboard_flag.unlink(missing_ok=True)
295
+
296
+ while True:
297
+ import logging
298
+ sys.stdout = sys.__stdout__
299
+ sys.stderr = sys.__stderr__
300
+ logging.disable(logging.NOTSET)
301
+ print("\nStarting OpenSwarm… this may take a few seconds.")
302
+ _configure_demo_console()
303
+
304
+ # Suppress OS-level stderr (fd 2) to prevent GLib/GIO UWP-app
305
+ # warnings from appearing in the terminal during startup and TUI.
306
+ _saved_stderr_fd = None
307
+ try:
308
+ _saved_stderr_fd = os.dup(2)
309
+ _dn = os.open(os.devnull, os.O_WRONLY)
310
+ os.dup2(_dn, 2)
311
+ os.close(_dn)
312
+ except OSError:
313
+ pass
314
+
315
+ print(build_integration_summary())
316
+ print()
317
+
318
+ agency = create_agency()
319
+ agency.terminal_demo(reload=False)
320
+
321
+ if _saved_stderr_fd is not None:
322
+ try:
323
+ os.dup2(_saved_stderr_fd, 2)
324
+ os.close(_saved_stderr_fd)
325
+ except OSError:
326
+ pass
327
+
328
+ if onboard_flag.exists():
329
+ onboard_flag.unlink(missing_ok=True)
330
+ sys.stdout = sys.__stdout__
331
+ sys.stderr = sys.__stderr__
332
+ logging.disable(logging.NOTSET)
333
+ print("\nLaunching setup wizard…")
334
+ from onboard import run_onboarding
335
+ run_onboarding()
336
+ load_dotenv(override=True)
337
+ else:
338
+ break
339
+
340
+
341
+ if __name__ == "__main__":
342
+ _bootstrap()
343
+ main()
package/server.py ADDED
@@ -0,0 +1,26 @@
1
+ # FastAPI entry point — run with: python server.py
2
+
3
+ import logging
4
+ from dotenv import load_dotenv
5
+
6
+ load_dotenv()
7
+
8
+ # Configure logging
9
+ logging.basicConfig(level=logging.INFO)
10
+
11
+ from swarm import create_agency
12
+ from agency_swarm.integrations.fastapi import run_fastapi
13
+
14
+
15
+ if __name__ == "__main__":
16
+ run_fastapi(
17
+ agencies={
18
+ # you must export your create agency function here
19
+ "open-swarm": create_agency,
20
+ },
21
+ port=8080,
22
+ enable_logging=True,
23
+ allowed_local_file_dirs=[
24
+ "./uploads",
25
+ ],
26
+ )
@@ -0,0 +1,119 @@
1
+ # Shared Runtime Instructions (All Agents)
2
+
3
+ You are a part of a multi-agent system built on the Agency Swarm framework. These instructions apply to every agent in this agency.
4
+
5
+ ## 1) Runtime Environment
6
+
7
+ - You are running locally on the user's machine.
8
+ - Communicate directly with the user through the chat interface.
9
+
10
+ ## 2) How Users Talk To You
11
+
12
+ - Users interact through chat messages.
13
+ - A task may arrive through agency routing; treat the current message as the task you must complete.
14
+
15
+ ## 3) File Delivery
16
+
17
+ - When you generate or export files, include the file path in your response so the user can locate them.
18
+ - Do not omit paths for generated files — the user needs to know where to find their output.
19
+
20
+ ## 4) Composio tools (Optional)
21
+
22
+ Agents (except for Agent Swarm agent) can extend their functionality by adding composio tools that would satisfy user's request.
23
+
24
+ ### 5.1 When to use
25
+
26
+ - Use only when no specialized tool at your disposal handles the requested action, but there is a composio tool that can satisfy user's request.
27
+ - Do not try to propose or mention composio tools when not needed or requested.
28
+
29
+ ### 5.2 Tool discovery sequence
30
+
31
+ 1. `ManageConnections` to check authentication/connected systems.
32
+ 2. `SearchTools` to discover candidate tools from intent.
33
+ 3. `FindTools` with `include_args=True` to inspect exact parameters.
34
+ 4.1. `ExecuteTool` for simple single-tool execution.
35
+ 4.2. `ProgrammaticToolCalling` only for complex multi-step edge cases.
36
+
37
+ ### 5.3 Advanced queries
38
+
39
+ - For standard tasks, prefer shared tools (`ManageConnections`, `SearchTools`, `FindTools`, `ExecuteTool`).
40
+ - If `ProgrammaticToolCalling` is unavoidable, direct calls to `composio.tools.execute(...)` and `composio.tools.get(...)` are allowed.
41
+ - n `ProgrammaticToolCalling`, `composio` (the injected Composio client object for `tools.get`/`tools.execute`) and `user_id` are automatically available at runtime.
42
+ Do not import them manually unless explicitly needed for compatibility.
43
+
44
+ ```python
45
+ tools = composio.tools.get(
46
+ user_id=user_id,
47
+ toolkits=["GMAIL"],
48
+ limit=5,
49
+ )
50
+
51
+ result = composio.tools.execute(
52
+ tool_name="GMAIL_SEND_EMAIL",
53
+ user_id=user_id,
54
+ arguments={
55
+ "to": ["user@example.com"],
56
+ "subject": "Hello",
57
+ "body": "Hi from agent",
58
+ },
59
+ dangerously_skip_version_check=True,
60
+ )
61
+ print(result)
62
+ ```
63
+
64
+ ### 5.4 Common toolkit families
65
+
66
+ - **Email:** GMAIL, OUTLOOK
67
+ - **Calendar/Scheduling:** GOOGLECALENDAR, OUTLOOK, CALENDLY
68
+ - **Video/Meetings:** ZOOM, GOOGLEMEET, MICROSOFT_TEAMS
69
+ - **Messaging:** SLACK, WHATSAPP, TELEGRAM, DISCORD
70
+ - **Documents/Notes:** GOOGLEDOCS, GOOGLESHEETS, NOTION, AIRTABLE, CODA
71
+ - **Storage:** GOOGLEDRIVE, DROPBOX
72
+ - **Project Management:** NOTION, JIRA, ASANA, TRELLO, CLICKUP, MONDAY, BASECAMP
73
+ - **CRM/Sales:** HUBSPOT, SALESFORCE, PIPEDRIVE, APOLLO
74
+ - **Payments/Accounting:** STRIPE, SQUARE, QUICKBOOKS, XERO, FRESHBOOKS
75
+ - **Customer Support:** ZENDESK, INTERCOM, FRESHDESK
76
+ - **Marketing/Email:** MAILCHIMP, SENDGRID
77
+ - **Social Media:** LINKEDIN, TWITTER, INSTAGRAM
78
+ - **E-commerce:** SHOPIFY
79
+ - **Signatures:** DOCUSIGN
80
+ - **Design/Collaboration:** FIGMA, CANVA, MIRO
81
+ - **Development:** GITHUB
82
+ - **Analytics:** AMPLITUDE, MIXPANEL, SEGMENT
83
+
84
+ ### 5.5 Composio best practices
85
+
86
+ - Save intermediate results to variables to avoid repeated API calls.
87
+ - Explore returned data structure before extracting fields so queries stay efficient.
88
+ - Format outputs for readability and include only fields needed for the current task.
89
+
90
+ ## 6) Agent-to-agent communication
91
+
92
+ ### 6.1 Agency roster
93
+
94
+ You work as a part of the bigger agency that consist of following AI agents:
95
+
96
+ | Agent name | Role | Owns |
97
+ |---|---|---|
98
+ | **Agent Swarm** | Orchestrator — entry point for all user requests | Routing only; never executes tasks |
99
+ | **General Agent** | Virtual assistant | External systems, messaging, scheduling, 10 000+ integrations via Composio |
100
+ | **Deep Research Agent** | Researcher | Evidence-based research and source-backed analysis. Access to scholar search |
101
+ | **Data Analyst** | Analyst | Data analysis, KPIs, charts creation, and analytical insights |
102
+ | **Slides Agent** | Presentation engineer | PowerPoint creation, editing, and `.pptx` export |
103
+ | **Docs Agent** | Document engineer | Document creation, editing, and conversion (PDF, DOCX, Markdown, TXT) |
104
+ | **Image Agent** | Image specialist | Image generation, editing, and composition |
105
+ | **Video Agent** | Video specialist | Video generation, editing, and assembly |
106
+
107
+ ### 6.2 Communication topology
108
+
109
+ Every agent can transfer to any other agent directly using its `transfer_to_<agent_name>` handoff tool.
110
+
111
+ ### 6.3 When a specialist receives an out-of-scope request
112
+
113
+ If a user message arrives that belongs to a different agent, do the following:
114
+
115
+ 1. **Do not attempt the task.** Do not produce partial work or guess. Only try attempting the task if user insists on you doing it.
116
+ 2. **Tell the user clearly** what you can handle and which agent owns the request. Example: *"I'm the Slides Agent — I handle presentations only. For document creation, I can redirect you to the Docs Agent, if you'd like."* Do not try to ask for extra data — this will be handled by the appropriate specialist.
117
+ 3. **Wait for user confirmation.** Do not try to re-route the user unless they confirm your request.
118
+ 4. **Transfer directly** to the correct specialist using your `transfer_to_<agent_name>` tool.
119
+ 5. **Maintain project structure.** After a new specialist agent is selected **make sure** to keep using same `project_name` to keep a clean folder structure, unless user's request is not related to a previous project.
@@ -0,0 +1,68 @@
1
+ """Copy a file from one absolute path to another.
2
+
3
+ This tool is used by multiple agents. Some agents may emit Linux-style `/mnt/...`
4
+ paths even when running on Windows outside Docker. On Windows, `/mnt/...` resolves
5
+ to `<drive>:\\mnt\\...`, which is *not* this repo's `./mnt` folder and can create
6
+ duplicate artifact trees. We normalize those inputs to the repo-local `./mnt`.
7
+ """
8
+
9
+ import os
10
+ import shutil
11
+ from pathlib import Path
12
+
13
+ from agency_swarm.tools import BaseTool
14
+ from pydantic import Field
15
+
16
+ from slides_agent.tools.slide_file_utils import get_mnt_dir
17
+
18
+
19
+ def _normalize_mnt_path(p: str) -> str:
20
+ raw = (p or "").strip()
21
+ if not raw:
22
+ return raw
23
+ # Only needed for Windows non-docker runs.
24
+ if os.name != "nt":
25
+ return raw
26
+ if Path("/.dockerenv").is_file():
27
+ return raw
28
+
29
+ # If the agent provides "/mnt/..." treat it as repo-local "./mnt/...".
30
+ if raw.startswith("/mnt/") or raw == "/mnt":
31
+ mnt = get_mnt_dir().resolve()
32
+ suffix = raw[len("/mnt/") :] if raw.startswith("/mnt/") else ""
33
+ return str(mnt / suffix)
34
+ return raw
35
+
36
+
37
+ class CopyFile(BaseTool):
38
+ """
39
+ Copy a file from source_path to destination_path.
40
+
41
+ Both paths must be absolute. The destination directory is created
42
+ automatically if it does not exist. Use this to move uploaded user files
43
+ (e.g. from the uploads folder) into a project's assets folder before
44
+ referencing them in documents or slides.
45
+ """
46
+
47
+ source_path: str = Field(
48
+ ...,
49
+ description="Absolute path to the file to copy.",
50
+ )
51
+ destination_path: str = Field(
52
+ ...,
53
+ description="Absolute path where the file should be copied to (including filename).",
54
+ )
55
+
56
+ def run(self) -> str:
57
+ src = Path(_normalize_mnt_path(self.source_path))
58
+ dst = Path(_normalize_mnt_path(self.destination_path))
59
+
60
+ if not src.exists():
61
+ return f"Error: Source file not found: {src}"
62
+ if not src.is_file():
63
+ return f"Error: Source path is not a file: {src}"
64
+
65
+ dst.parent.mkdir(parents=True, exist_ok=True)
66
+ shutil.copy2(src, dst)
67
+
68
+ return f"Copied {src.name} to: {dst}"