@_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.
- package/LICENSE +21 -0
- package/README.md +152 -0
- package/bin/openswarm.js +38 -0
- package/config.py +34 -0
- package/data_analyst_agent/.cursor/rules/data_analyst.mdc +43 -0
- package/data_analyst_agent/__init__.py +3 -0
- package/data_analyst_agent/__pycache__/__init__.cpython-312.pyc +0 -0
- package/data_analyst_agent/__pycache__/data_analyst_agent.cpython-312.pyc +0 -0
- package/data_analyst_agent/data_analyst_agent.py +45 -0
- package/data_analyst_agent/instructions.md +173 -0
- package/data_analyst_agent/test_files/test_file.csv +21 -0
- package/data_analyst_agent/tools/__init__.py +6 -0
- package/deep_research/__init__.py +1 -0
- package/deep_research/__pycache__/__init__.cpython-312.pyc +0 -0
- package/deep_research/__pycache__/deep_research.cpython-312.pyc +0 -0
- package/deep_research/deep_research.py +27 -0
- package/deep_research/instructions.md +104 -0
- package/deep_research/tools/__init__.py +1 -0
- package/docs_agent/__init__.py +3 -0
- package/docs_agent/__pycache__/__init__.cpython-312.pyc +0 -0
- package/docs_agent/__pycache__/docs_agent.cpython-312.pyc +0 -0
- package/docs_agent/docs_agent.py +61 -0
- package/docs_agent/instructions.md +418 -0
- package/docs_agent/tools/ConvertDocument.py +323 -0
- package/docs_agent/tools/CreateDocument.py +287 -0
- package/docs_agent/tools/ListDocuments.py +134 -0
- package/docs_agent/tools/ModifyDocument.py +247 -0
- package/docs_agent/tools/RestoreDocument.py +79 -0
- package/docs_agent/tools/ViewDocument.py +153 -0
- package/docs_agent/tools/__init__.py +1 -0
- package/docs_agent/tools/__pycache__/ConvertDocument.cpython-312.pyc +0 -0
- package/docs_agent/tools/__pycache__/CreateDocument.cpython-312.pyc +0 -0
- package/docs_agent/tools/__pycache__/ListDocuments.cpython-312.pyc +0 -0
- package/docs_agent/tools/__pycache__/ModifyDocument.cpython-312.pyc +0 -0
- package/docs_agent/tools/__pycache__/RestoreDocument.cpython-312.pyc +0 -0
- package/docs_agent/tools/__pycache__/ViewDocument.cpython-312.pyc +0 -0
- package/docs_agent/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__init__.py +1 -0
- package/docs_agent/tools/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/doc_file_utils.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_blocks.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_constants.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_core.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_css.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_images.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_page.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_paragraphs.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_playwright.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_selectors.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_docx_shared.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/__pycache__/html_validation.cpython-312.pyc +0 -0
- package/docs_agent/tools/utils/doc_file_utils.py +29 -0
- package/docs_agent/tools/utils/html_docx_blocks.py +262 -0
- package/docs_agent/tools/utils/html_docx_constants.py +78 -0
- package/docs_agent/tools/utils/html_docx_core.py +138 -0
- package/docs_agent/tools/utils/html_docx_css.py +262 -0
- package/docs_agent/tools/utils/html_docx_images.py +293 -0
- package/docs_agent/tools/utils/html_docx_page.py +185 -0
- package/docs_agent/tools/utils/html_docx_paragraphs.py +342 -0
- package/docs_agent/tools/utils/html_docx_playwright.py +184 -0
- package/docs_agent/tools/utils/html_docx_selectors.py +196 -0
- package/docs_agent/tools/utils/html_docx_shared.py +23 -0
- package/docs_agent/tools/utils/html_docx_tables.py +942 -0
- package/docs_agent/tools/utils/html_validation.py +102 -0
- package/helpers.py +59 -0
- package/image_generation_agent/__init__.py +1 -0
- package/image_generation_agent/__pycache__/__init__.cpython-312.pyc +0 -0
- package/image_generation_agent/__pycache__/image_generation_agent.cpython-312.pyc +0 -0
- package/image_generation_agent/image_generation_agent.py +31 -0
- package/image_generation_agent/instructions.md +80 -0
- package/image_generation_agent/tools/CombineImages.py +211 -0
- package/image_generation_agent/tools/EditImages.py +200 -0
- package/image_generation_agent/tools/GenerateImages.py +184 -0
- package/image_generation_agent/tools/RemoveBackground.py +108 -0
- package/image_generation_agent/tools/__init__.py +2 -0
- package/image_generation_agent/tools/__pycache__/CombineImages.cpython-312.pyc +0 -0
- package/image_generation_agent/tools/__pycache__/EditImages.cpython-312.pyc +0 -0
- package/image_generation_agent/tools/__pycache__/GenerateImages.cpython-312.pyc +0 -0
- package/image_generation_agent/tools/__pycache__/RemoveBackground.cpython-312.pyc +0 -0
- package/image_generation_agent/tools/utils/__init__.py +2 -0
- package/image_generation_agent/tools/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/image_generation_agent/tools/utils/__pycache__/image_io.cpython-312.pyc +0 -0
- package/image_generation_agent/tools/utils/image_io.py +308 -0
- package/onboard.py +325 -0
- package/orchestrator/__init__.py +3 -0
- package/orchestrator/__pycache__/__init__.cpython-312.pyc +0 -0
- package/orchestrator/__pycache__/orchestrator.cpython-312.pyc +0 -0
- package/orchestrator/instructions.md +90 -0
- package/orchestrator/orchestrator.py +33 -0
- package/package.json +49 -0
- package/patches/__init__.py +1 -0
- package/patches/__pycache__/__init__.cpython-312.pyc +0 -0
- package/patches/__pycache__/patch_agency_swarm_dual_comms.cpython-312.pyc +0 -0
- package/patches/__pycache__/patch_file_attachment_refs.cpython-312.pyc +0 -0
- package/patches/__pycache__/patch_ipython_interpreter_composio.cpython-312.pyc +0 -0
- package/patches/dom-to-pptx+1.1.5.patch +133440 -0
- package/patches/patch_agency_swarm_dual_comms.py +199 -0
- package/patches/patch_file_attachment_refs.py +74 -0
- package/patches/patch_ipython_interpreter_composio.py +54 -0
- package/pyproject.toml +67 -0
- package/run.py +343 -0
- package/server.py +26 -0
- package/shared_instructions.md +119 -0
- package/shared_tools/CopyFile.py +68 -0
- package/shared_tools/ExecuteTool.py +184 -0
- package/shared_tools/FindTools.py +101 -0
- package/shared_tools/ManageConnections.py +43 -0
- package/shared_tools/SearchTools.py +44 -0
- package/shared_tools/__init__.py +7 -0
- package/shared_tools/__pycache__/CopyFile.cpython-312.pyc +0 -0
- package/shared_tools/__pycache__/ExecuteTool.cpython-312.pyc +0 -0
- package/shared_tools/__pycache__/FindTools.cpython-312.pyc +0 -0
- package/shared_tools/__pycache__/ManageConnections.cpython-312.pyc +0 -0
- package/shared_tools/__pycache__/SearchTools.cpython-312.pyc +0 -0
- package/shared_tools/__pycache__/__init__.cpython-312.pyc +0 -0
- package/slides_agent/.cursor/rules/slides-agent-workflow.mdc +9 -0
- package/slides_agent/__init__.py +1 -0
- package/slides_agent/__pycache__/__init__.cpython-312.pyc +0 -0
- package/slides_agent/__pycache__/slides_agent.cpython-312.pyc +0 -0
- package/slides_agent/instructions.md +298 -0
- package/slides_agent/pptx/SKILL.md +528 -0
- package/slides_agent/pptx/html2pptx.md +625 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/slides_agent/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/slides_agent/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/slides_agent/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/slides_agent/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/slides_agent/pptx/ooxml/scripts/pack.py +169 -0
- package/slides_agent/pptx/ooxml/scripts/unpack.py +29 -0
- package/slides_agent/pptx/ooxml/scripts/validate.py +69 -0
- package/slides_agent/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/slides_agent/pptx/ooxml/scripts/validation/base.py +951 -0
- package/slides_agent/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/slides_agent/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/slides_agent/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/slides_agent/pptx/ooxml.md +427 -0
- package/slides_agent/pptx/scripts/html2pptx.js +1092 -0
- package/slides_agent/pptx/scripts/inventory.py +1020 -0
- package/slides_agent/pptx/scripts/rearrange.py +231 -0
- package/slides_agent/pptx/scripts/replace.py +385 -0
- package/slides_agent/pptx/scripts/thumbnail.py +451 -0
- package/slides_agent/slides_agent.py +109 -0
- package/slides_agent/test_deck/_theme.css +92 -0
- package/slides_agent/test_deck/assets/placeholder.svg +11 -0
- package/slides_agent/test_deck/slide_01_title.html +10 -0
- package/slides_agent/test_deck/slide_02_image_split.html +23 -0
- package/slides_agent/test_deck/slide_03_kpi.html +21 -0
- package/slides_agent/tools/ApplyPptxTextReplacements.py +91 -0
- package/slides_agent/tools/BuildPptxFromHtmlSlides.py +221 -0
- package/slides_agent/tools/CheckSlide.py +218 -0
- package/slides_agent/tools/CheckSlideCanvasOverflow.py +221 -0
- package/slides_agent/tools/CreateImageMontage.py +261 -0
- package/slides_agent/tools/CreatePptxThumbnailGrid.py +168 -0
- package/slides_agent/tools/DeleteSlide.py +78 -0
- package/slides_agent/tools/DownloadImage.py +79 -0
- package/slides_agent/tools/EnsureRasterImage.py +157 -0
- package/slides_agent/tools/ExtractPptxTextInventory.py +104 -0
- package/slides_agent/tools/GenerateImage.py +189 -0
- package/slides_agent/tools/ImageSearch.py +127 -0
- package/slides_agent/tools/InsertNewSlides.py +393 -0
- package/slides_agent/tools/ManageTheme.py +112 -0
- package/slides_agent/tools/ModifySlide.py +563 -0
- package/slides_agent/tools/ReadSlide.py +26 -0
- package/slides_agent/tools/RearrangePptxSlidesFromTemplate.py +114 -0
- package/slides_agent/tools/RestoreSnapshot.py +89 -0
- package/slides_agent/tools/SlideScreenshot.py +66 -0
- package/slides_agent/tools/__init__.py +54 -0
- package/slides_agent/tools/__pycache__/ApplyPptxTextReplacements.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/BuildPptxFromHtmlSlides.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/CheckSlide.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/CheckSlideCanvasOverflow.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/CreateImageMontage.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/CreatePptxThumbnailGrid.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/DeleteSlide.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/DownloadImage.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/EnsureRasterImage.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/ExtractPptxTextInventory.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/GenerateImage.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/ImageSearch.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/InsertNewSlides.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/ManageTheme.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/ModifySlide.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/ReadSlide.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/RearrangePptxSlidesFromTemplate.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/RestoreSnapshot.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/SlideScreenshot.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/slide_file_utils.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/slide_html_utils.cpython-312.pyc +0 -0
- package/slides_agent/tools/__pycache__/template_registry.cpython-312.pyc +0 -0
- package/slides_agent/tools/deck_utils.py +31 -0
- package/slides_agent/tools/html2pptx_runner.js +1183 -0
- package/slides_agent/tools/html_writer_instructions.md +149 -0
- package/slides_agent/tools/slide_file_utils.py +108 -0
- package/slides_agent/tools/slide_html_utils.py +354 -0
- package/slides_agent/tools/template_registry.py +55 -0
- package/swarm.py +82 -0
- package/video_generation_agent/__init__.py +1 -0
- package/video_generation_agent/__pycache__/__init__.cpython-312.pyc +0 -0
- package/video_generation_agent/__pycache__/video_generation_agent.cpython-312.pyc +0 -0
- package/video_generation_agent/instructions.md +178 -0
- package/video_generation_agent/tools/AddSubtitles.py +425 -0
- package/video_generation_agent/tools/CombineImages.py +166 -0
- package/video_generation_agent/tools/CombineVideos.py +113 -0
- package/video_generation_agent/tools/EditAudio.py +297 -0
- package/video_generation_agent/tools/EditImage.py +144 -0
- package/video_generation_agent/tools/EditVideoContent.py +369 -0
- package/video_generation_agent/tools/GenerateImage.py +133 -0
- package/video_generation_agent/tools/GenerateVideo.py +556 -0
- package/video_generation_agent/tools/TrimVideo.py +233 -0
- package/video_generation_agent/tools/__init__.py +1 -0
- package/video_generation_agent/tools/__pycache__/AddSubtitles.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/CombineImages.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/CombineVideos.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/EditAudio.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/EditImage.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/EditVideoContent.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/GenerateImage.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/GenerateVideo.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/__pycache__/TrimVideo.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/utils/__init__.py +1 -0
- package/video_generation_agent/tools/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/utils/__pycache__/image_utils.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/utils/__pycache__/video_utils.cpython-312.pyc +0 -0
- package/video_generation_agent/tools/utils/image_utils.py +174 -0
- package/video_generation_agent/tools/utils/video_utils.py +522 -0
- package/video_generation_agent/video_generation_agent.py +26 -0
- package/virtual_assistant/__init__.py +1 -0
- package/virtual_assistant/__pycache__/__init__.cpython-312.pyc +0 -0
- package/virtual_assistant/__pycache__/virtual_assistant.cpython-312.pyc +0 -0
- package/virtual_assistant/instructions.md +206 -0
- package/virtual_assistant/tools/AddLabelToEmail.py +154 -0
- package/virtual_assistant/tools/CheckEventsForDate.py +218 -0
- package/virtual_assistant/tools/CheckUnreadSlackMessages.py +216 -0
- package/virtual_assistant/tools/CreateCalendarEvent.py +261 -0
- package/virtual_assistant/tools/DeleteCalendarEvent.py +137 -0
- package/virtual_assistant/tools/DeleteDraft.py +95 -0
- package/virtual_assistant/tools/DraftEmail.py +239 -0
- package/virtual_assistant/tools/EditFile.py +113 -0
- package/virtual_assistant/tools/FindEmails.py +330 -0
- package/virtual_assistant/tools/GetCurrentTime.py +69 -0
- package/virtual_assistant/tools/GetSlackUserInfo.py +117 -0
- package/virtual_assistant/tools/ListDirectory.py +113 -0
- package/virtual_assistant/tools/ListSkills.py +94 -0
- package/virtual_assistant/tools/ManageLabels.py +295 -0
- package/virtual_assistant/tools/ProductSearch.py +254 -0
- package/virtual_assistant/tools/ReadEmail.py +251 -0
- package/virtual_assistant/tools/ReadFile.py +108 -0
- package/virtual_assistant/tools/ReadSlackMessages.py +191 -0
- package/virtual_assistant/tools/RemoveLabelFromEmail.py +137 -0
- package/virtual_assistant/tools/RescheduleCalendarEvent.py +227 -0
- package/virtual_assistant/tools/ScholarSearch.py +216 -0
- package/virtual_assistant/tools/SendDraft.py +101 -0
- package/virtual_assistant/tools/SendSlackMessage.py +148 -0
- package/virtual_assistant/tools/WriteFile.py +95 -0
- package/virtual_assistant/tools/__init__.py +1 -0
- package/virtual_assistant/tools/__pycache__/AddLabelToEmail.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/CheckEventsForDate.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/CheckUnreadSlackMessages.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/CreateCalendarEvent.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/DeleteCalendarEvent.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/DeleteDraft.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/DraftEmail.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/EditFile.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/FindEmails.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/GetCurrentTime.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/GetSlackUserInfo.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ListDirectory.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ListSkills.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ManageLabels.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ProductSearch.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ReadEmail.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ReadFile.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ReadSlackMessages.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/RemoveLabelFromEmail.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/RescheduleCalendarEvent.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/ScholarSearch.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/SendDraft.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/SendSlackMessage.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/WriteFile.cpython-312.pyc +0 -0
- package/virtual_assistant/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- package/virtual_assistant/virtual_assistant.py +52 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
from agency_swarm.tools import BaseTool
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from helpers import execute_composio_tool
|
|
6
|
+
import json
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DeleteDraft(BaseTool):
|
|
10
|
+
"""
|
|
11
|
+
Permanently deletes an email draft by its ID.
|
|
12
|
+
|
|
13
|
+
Use this to clean up drafts that are no longer needed.
|
|
14
|
+
This action cannot be undone.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
provider: Literal["gmail", "outlook"] = Field(
|
|
18
|
+
...,
|
|
19
|
+
description="Email provider: 'gmail' or 'outlook'"
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
draft_id: str = Field(
|
|
23
|
+
...,
|
|
24
|
+
description="The draft ID to delete (obtained from DraftEmail tool)"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def run(self):
|
|
28
|
+
try:
|
|
29
|
+
if self.provider == "gmail":
|
|
30
|
+
return self._delete_gmail_draft(execute_composio_tool)
|
|
31
|
+
else:
|
|
32
|
+
return self._delete_outlook_draft(execute_composio_tool)
|
|
33
|
+
|
|
34
|
+
except Exception as e:
|
|
35
|
+
return f"Error deleting draft: {str(e)}"
|
|
36
|
+
|
|
37
|
+
def _delete_gmail_draft(self, execute_tool) -> str:
|
|
38
|
+
"""Deletes a Gmail draft."""
|
|
39
|
+
result = execute_tool(
|
|
40
|
+
tool_name="GMAIL_DELETE_DRAFT",
|
|
41
|
+
arguments={
|
|
42
|
+
"user_id": "me",
|
|
43
|
+
"draft_id": self.draft_id
|
|
44
|
+
},
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
if isinstance(result, dict) and result.get("error"):
|
|
48
|
+
return f"Error deleting Gmail draft: {result.get('error')}"
|
|
49
|
+
|
|
50
|
+
return json.dumps({
|
|
51
|
+
"provider": "gmail",
|
|
52
|
+
"success": True,
|
|
53
|
+
"message": "Draft deleted successfully",
|
|
54
|
+
"draft_id": self.draft_id
|
|
55
|
+
}, indent=2)
|
|
56
|
+
|
|
57
|
+
def _delete_outlook_draft(self, execute_tool) -> str:
|
|
58
|
+
"""Deletes an Outlook draft."""
|
|
59
|
+
result = execute_tool(
|
|
60
|
+
tool_name="OUTLOOK_DELETE_MESSAGE",
|
|
61
|
+
arguments={
|
|
62
|
+
"user_id": "me",
|
|
63
|
+
"message_id": self.draft_id
|
|
64
|
+
},
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
if isinstance(result, dict) and result.get("error"):
|
|
68
|
+
return f"Error deleting Outlook draft: {result.get('error')}"
|
|
69
|
+
|
|
70
|
+
return json.dumps({
|
|
71
|
+
"provider": "outlook",
|
|
72
|
+
"success": True,
|
|
73
|
+
"message": "Draft deleted successfully",
|
|
74
|
+
"draft_id": self.draft_id
|
|
75
|
+
}, indent=2)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if __name__ == "__main__":
|
|
79
|
+
import sys
|
|
80
|
+
import os
|
|
81
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
|
|
82
|
+
|
|
83
|
+
print("=" * 60)
|
|
84
|
+
print("DeleteDraft Test Suite")
|
|
85
|
+
print("=" * 60)
|
|
86
|
+
print()
|
|
87
|
+
print("To test DeleteDraft, first create a draft using DraftEmail,")
|
|
88
|
+
print("then use the draft_id to delete it.")
|
|
89
|
+
print()
|
|
90
|
+
print("Example:")
|
|
91
|
+
print(" tool = DeleteDraft(provider='gmail', draft_id='r12345...')")
|
|
92
|
+
print(" result = tool.run()")
|
|
93
|
+
print()
|
|
94
|
+
print("=" * 60)
|
|
95
|
+
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
from typing import Literal, Optional, List
|
|
2
|
+
from agency_swarm.tools import BaseTool
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
import json
|
|
5
|
+
|
|
6
|
+
from helpers import execute_composio_tool
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DraftEmail(BaseTool):
|
|
10
|
+
"""
|
|
11
|
+
Creates an email draft in the user's mailbox (Gmail or Outlook).
|
|
12
|
+
|
|
13
|
+
The draft can be reviewed, edited, and sent later using SendDraft.
|
|
14
|
+
Returns the draft ID which is needed to send or delete the draft.
|
|
15
|
+
|
|
16
|
+
Supports creating replies within existing threads:
|
|
17
|
+
- Gmail: Use thread_id to reply in a thread
|
|
18
|
+
- Outlook: Use reply_to_message_id to reply to a specific message
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
provider: Literal["gmail", "outlook"] = Field(
|
|
22
|
+
...,
|
|
23
|
+
description="Email provider: 'gmail' or 'outlook'"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
to: Optional[List[str]] = Field(
|
|
27
|
+
default=None,
|
|
28
|
+
description="List of recipient email addresses (e.g., ['user@example.com']). Optional for drafts."
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
subject: Optional[str] = Field(
|
|
32
|
+
default=None,
|
|
33
|
+
description="Email subject line. Leave empty when replying to stay in the same thread."
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
body: str = Field(
|
|
37
|
+
...,
|
|
38
|
+
description="Email body content (plain text)"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
cc: Optional[List[str]] = Field(
|
|
42
|
+
default=None,
|
|
43
|
+
description="List of CC recipient email addresses"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
bcc: Optional[List[str]] = Field(
|
|
47
|
+
default=None,
|
|
48
|
+
description="List of BCC recipient email addresses"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
is_html: bool = Field(
|
|
52
|
+
default=False,
|
|
53
|
+
description="Set to True if body contains HTML formatting"
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
thread_id: Optional[str] = Field(
|
|
57
|
+
default=None,
|
|
58
|
+
description="Gmail only: Thread ID to reply to. Leave subject empty to stay in the same thread."
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
reply_to_message_id: Optional[str] = Field(
|
|
62
|
+
default=None,
|
|
63
|
+
description="Outlook only: Message ID to reply to. Creates a draft reply to that message."
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def run(self):
|
|
67
|
+
try:
|
|
68
|
+
if self.provider == "gmail":
|
|
69
|
+
return self._create_gmail_draft(execute_composio_tool)
|
|
70
|
+
else:
|
|
71
|
+
return self._create_outlook_draft(execute_composio_tool)
|
|
72
|
+
|
|
73
|
+
except Exception as e:
|
|
74
|
+
return f"Error creating draft: {str(e)}"
|
|
75
|
+
|
|
76
|
+
def _create_gmail_draft(self, execute_tool) -> str:
|
|
77
|
+
"""Creates a Gmail draft."""
|
|
78
|
+
arguments = {
|
|
79
|
+
"user_id": "me",
|
|
80
|
+
"body": self.body,
|
|
81
|
+
"is_html": self.is_html
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Add subject (leave empty for thread replies to stay in same thread)
|
|
85
|
+
if self.subject:
|
|
86
|
+
arguments["subject"] = self.subject
|
|
87
|
+
|
|
88
|
+
if self.to:
|
|
89
|
+
arguments["recipient_email"] = self.to[0]
|
|
90
|
+
if len(self.to) > 1:
|
|
91
|
+
arguments["extra_recipients"] = self.to[1:]
|
|
92
|
+
|
|
93
|
+
if self.cc:
|
|
94
|
+
arguments["cc"] = self.cc
|
|
95
|
+
|
|
96
|
+
if self.bcc:
|
|
97
|
+
arguments["bcc"] = self.bcc
|
|
98
|
+
|
|
99
|
+
# Add thread_id for replies
|
|
100
|
+
if self.thread_id:
|
|
101
|
+
arguments["thread_id"] = self.thread_id
|
|
102
|
+
|
|
103
|
+
result = execute_tool(
|
|
104
|
+
tool_name="GMAIL_CREATE_EMAIL_DRAFT",
|
|
105
|
+
arguments=arguments,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
if isinstance(result, dict) and result.get("error"):
|
|
109
|
+
return f"Error creating Gmail draft: {result.get('error')}"
|
|
110
|
+
|
|
111
|
+
data = result.get("data", {})
|
|
112
|
+
|
|
113
|
+
return json.dumps({
|
|
114
|
+
"provider": "gmail",
|
|
115
|
+
"success": True,
|
|
116
|
+
"draft_id": data.get("id"),
|
|
117
|
+
"message_id": data.get("message", {}).get("id"),
|
|
118
|
+
"thread_id": data.get("message", {}).get("threadId"),
|
|
119
|
+
"subject": self.subject,
|
|
120
|
+
"to": self.to,
|
|
121
|
+
"is_reply": self.thread_id is not None
|
|
122
|
+
}, indent=2)
|
|
123
|
+
|
|
124
|
+
def _create_outlook_draft(self, execute_tool) -> str:
|
|
125
|
+
"""Creates an Outlook draft."""
|
|
126
|
+
# Check if this is a reply to an existing message
|
|
127
|
+
if self.reply_to_message_id:
|
|
128
|
+
return self._create_outlook_reply_draft(execute_tool)
|
|
129
|
+
|
|
130
|
+
arguments = {
|
|
131
|
+
"body": self.body,
|
|
132
|
+
"is_html": self.is_html
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if self.subject:
|
|
136
|
+
arguments["subject"] = self.subject
|
|
137
|
+
else:
|
|
138
|
+
arguments["subject"] = "(No subject)"
|
|
139
|
+
|
|
140
|
+
if self.to:
|
|
141
|
+
arguments["to_recipients"] = self.to
|
|
142
|
+
|
|
143
|
+
if self.cc:
|
|
144
|
+
arguments["cc_recipients"] = self.cc
|
|
145
|
+
|
|
146
|
+
if self.bcc:
|
|
147
|
+
arguments["bcc_recipients"] = self.bcc
|
|
148
|
+
|
|
149
|
+
result = execute_tool(
|
|
150
|
+
tool_name="OUTLOOK_CREATE_DRAFT",
|
|
151
|
+
arguments=arguments,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
if isinstance(result, dict) and result.get("error"):
|
|
155
|
+
return f"Error creating Outlook draft: {result.get('error')}"
|
|
156
|
+
|
|
157
|
+
data = result.get("data", {})
|
|
158
|
+
|
|
159
|
+
return json.dumps({
|
|
160
|
+
"provider": "outlook",
|
|
161
|
+
"success": True,
|
|
162
|
+
"draft_id": data.get("id"),
|
|
163
|
+
"subject": self.subject,
|
|
164
|
+
"to": self.to,
|
|
165
|
+
"web_link": data.get("webLink", ""),
|
|
166
|
+
"is_reply": False
|
|
167
|
+
}, indent=2)
|
|
168
|
+
|
|
169
|
+
def _create_outlook_reply_draft(self, execute_tool) -> str:
|
|
170
|
+
"""Creates an Outlook draft reply to an existing message."""
|
|
171
|
+
arguments = {
|
|
172
|
+
"user_id": "me",
|
|
173
|
+
"message_id": self.reply_to_message_id,
|
|
174
|
+
"comment": self.body
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if self.cc:
|
|
178
|
+
arguments["cc_emails"] = self.cc
|
|
179
|
+
|
|
180
|
+
if self.bcc:
|
|
181
|
+
arguments["bcc_emails"] = self.bcc
|
|
182
|
+
|
|
183
|
+
result = execute_tool(
|
|
184
|
+
tool_name="OUTLOOK_CREATE_DRAFT_REPLY",
|
|
185
|
+
arguments=arguments,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
if isinstance(result, dict) and result.get("error"):
|
|
189
|
+
return f"Error creating Outlook reply draft: {result.get('error')}"
|
|
190
|
+
|
|
191
|
+
data = result.get("data", {})
|
|
192
|
+
|
|
193
|
+
return json.dumps({
|
|
194
|
+
"provider": "outlook",
|
|
195
|
+
"success": True,
|
|
196
|
+
"draft_id": data.get("id"),
|
|
197
|
+
"reply_to_message_id": self.reply_to_message_id,
|
|
198
|
+
"conversation_id": data.get("conversationId"),
|
|
199
|
+
"web_link": data.get("webLink", ""),
|
|
200
|
+
"is_reply": True
|
|
201
|
+
}, indent=2)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
if __name__ == "__main__":
|
|
205
|
+
import sys
|
|
206
|
+
import os
|
|
207
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
|
|
208
|
+
|
|
209
|
+
print("=" * 60)
|
|
210
|
+
print("DraftEmail Test Suite")
|
|
211
|
+
print("=" * 60)
|
|
212
|
+
print()
|
|
213
|
+
|
|
214
|
+
# Test 1: Create Gmail draft
|
|
215
|
+
print("Test 1: Create Gmail draft")
|
|
216
|
+
print("-" * 60)
|
|
217
|
+
tool = DraftEmail(
|
|
218
|
+
provider="gmail",
|
|
219
|
+
to=["arseny9795@gmail.com"],
|
|
220
|
+
subject="Test Draft from Virtual Assistant",
|
|
221
|
+
body="This is a test draft created by the Virtual Assistant tool.\n\nPlease ignore this message."
|
|
222
|
+
)
|
|
223
|
+
result = tool.run()
|
|
224
|
+
print(result)
|
|
225
|
+
|
|
226
|
+
# Save draft_id for cleanup
|
|
227
|
+
import json
|
|
228
|
+
try:
|
|
229
|
+
data = json.loads(result)
|
|
230
|
+
gmail_draft_id = data.get("draft_id")
|
|
231
|
+
print(f"\nDraft ID saved for cleanup: {gmail_draft_id}")
|
|
232
|
+
except json.JSONDecodeError:
|
|
233
|
+
gmail_draft_id = None
|
|
234
|
+
print()
|
|
235
|
+
|
|
236
|
+
print("=" * 60)
|
|
237
|
+
print("Test completed! Remember to delete the draft.")
|
|
238
|
+
print("=" * 60)
|
|
239
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from agency_swarm.tools import BaseTool
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EditFile(BaseTool):
|
|
9
|
+
"""
|
|
10
|
+
Performs exact string replacements in files.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- You must use ReadFile tool at least once in the conversation before editing.
|
|
14
|
+
- When editing text, preserve the exact indentation (tabs/spaces) as it appears in the file.
|
|
15
|
+
- The edit will FAIL if old_string is not unique in the file. Provide more context to make it unique or use replace_all.
|
|
16
|
+
- Use replace_all for replacing and renaming strings across the file.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
file_path: str = Field(..., description="The absolute path to the file to modify")
|
|
20
|
+
old_string: str = Field(..., description="The text to replace")
|
|
21
|
+
new_string: str = Field(
|
|
22
|
+
...,
|
|
23
|
+
description="The text to replace it with (must be different from old_string)",
|
|
24
|
+
)
|
|
25
|
+
replace_all: Optional[bool] = Field(
|
|
26
|
+
False, description="Replace all occurrences of old_string (default false)"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def run(self):
|
|
30
|
+
try:
|
|
31
|
+
if self.old_string == self.new_string:
|
|
32
|
+
return "Error: old_string and new_string must be different"
|
|
33
|
+
|
|
34
|
+
if not os.path.exists(self.file_path):
|
|
35
|
+
return f"Error: File does not exist: {self.file_path}"
|
|
36
|
+
|
|
37
|
+
if not os.path.isfile(self.file_path):
|
|
38
|
+
return f"Error: Path is not a file: {self.file_path}"
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
with open(self.file_path, "r", encoding="utf-8") as file:
|
|
42
|
+
content = file.read()
|
|
43
|
+
except UnicodeDecodeError:
|
|
44
|
+
return f"Error: Unable to decode file {self.file_path}. It may be a binary file."
|
|
45
|
+
|
|
46
|
+
if self.old_string not in content:
|
|
47
|
+
return f"Error: String to replace not found in file.\nString: {repr(self.old_string)}"
|
|
48
|
+
|
|
49
|
+
occurrences = content.count(self.old_string)
|
|
50
|
+
|
|
51
|
+
if occurrences > 1 and not self.replace_all:
|
|
52
|
+
previews = []
|
|
53
|
+
start_idx = 0
|
|
54
|
+
for _ in range(2):
|
|
55
|
+
idx = content.find(self.old_string, start_idx)
|
|
56
|
+
if idx == -1:
|
|
57
|
+
break
|
|
58
|
+
a = max(0, idx - 30)
|
|
59
|
+
b = min(len(content), idx + len(self.old_string) + 30)
|
|
60
|
+
previews.append("..." + content[a:b] + "...")
|
|
61
|
+
start_idx = idx + len(self.old_string)
|
|
62
|
+
preview_block = "\n".join(previews)
|
|
63
|
+
return (
|
|
64
|
+
f"Error: String appears {occurrences} times in file. Either provide a larger string with more "
|
|
65
|
+
f"surrounding context to make it unique or use replace_all=True to change every instance.\n"
|
|
66
|
+
f"First matches:\n{preview_block}"
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
if self.replace_all:
|
|
70
|
+
new_content = content.replace(self.old_string, self.new_string)
|
|
71
|
+
replacement_count = occurrences
|
|
72
|
+
else:
|
|
73
|
+
new_content = content.replace(self.old_string, self.new_string, 1)
|
|
74
|
+
replacement_count = 1
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
with open(self.file_path, "w", encoding="utf-8") as file:
|
|
78
|
+
file.write(new_content)
|
|
79
|
+
return f"Successfully replaced {replacement_count} occurrence(s) in {self.file_path}"
|
|
80
|
+
except PermissionError:
|
|
81
|
+
return f"Error: Permission denied writing to file: {self.file_path}"
|
|
82
|
+
except Exception as e:
|
|
83
|
+
return f"Error writing to file: {str(e)}"
|
|
84
|
+
|
|
85
|
+
except Exception as e:
|
|
86
|
+
return f"Error during edit operation: {str(e)}"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
if __name__ == "__main__":
|
|
90
|
+
# Test the tool
|
|
91
|
+
test_file_path = "/tmp/test_edit_tool.txt"
|
|
92
|
+
test_content = """This is a test file.
|
|
93
|
+
Line 2 has some text.
|
|
94
|
+
Line 3 has the same text.
|
|
95
|
+
Final line."""
|
|
96
|
+
|
|
97
|
+
# Create test file
|
|
98
|
+
with open(test_file_path, "w") as f:
|
|
99
|
+
f.write(test_content)
|
|
100
|
+
|
|
101
|
+
print("Original content:")
|
|
102
|
+
print(test_content)
|
|
103
|
+
print("\n" + "=" * 50 + "\n")
|
|
104
|
+
|
|
105
|
+
tool = EditFile(
|
|
106
|
+
file_path=test_file_path, old_string="some text", new_string="REPLACED TEXT"
|
|
107
|
+
)
|
|
108
|
+
result = tool.run()
|
|
109
|
+
print(result)
|
|
110
|
+
|
|
111
|
+
# Cleanup
|
|
112
|
+
os.remove(test_file_path)
|
|
113
|
+
|