@_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
@@ -0,0 +1,528 @@
1
+ ---
2
+ name: pptx
3
+ description: "Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks"
4
+ ---
5
+
6
+ # PPTX creation, editing, and analysis
7
+
8
+ ## Overview
9
+
10
+ A user may ask you to create, edit, or analyze the contents of a .pptx file. A .pptx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.
11
+
12
+ ## Reading and analyzing content
13
+
14
+ ### Text extraction
15
+
16
+ If you just need to read the text contents of a presentation, you should convert the document to markdown:
17
+
18
+ ```bash
19
+ # Convert document to markdown
20
+ python -m markitdown path-to-file.pptx
21
+ ```
22
+
23
+ ### Raw XML access
24
+
25
+ You need raw XML access for: comments, speaker notes, slide layouts, animations, design elements, and complex formatting. For any of these features, you'll need to unpack a presentation and read its raw XML contents.
26
+
27
+ #### Unpacking a file
28
+
29
+ `python ooxml/scripts/unpack.py <office_file> <output_dir>`
30
+
31
+ **Note**: The unpack.py script is located at `skills/pptx/ooxml/scripts/unpack.py` relative to the project root. If the script doesn't exist at this path, use `find . -name "unpack.py"` to locate it.
32
+
33
+ #### Key file structures
34
+
35
+ - `ppt/presentation.xml` - Main presentation metadata and slide references
36
+ - `ppt/slides/slide{N}.xml` - Individual slide contents (slide1.xml, slide2.xml, etc.)
37
+ - `ppt/notesSlides/notesSlide{N}.xml` - Speaker notes for each slide
38
+ - `ppt/comments/modernComment_*.xml` - Comments for specific slides
39
+ - `ppt/slideLayouts/` - Layout templates for slides
40
+ - `ppt/slideMasters/` - Master slide templates
41
+ - `ppt/theme/` - Theme and styling information
42
+ - `ppt/media/` - Images and other media files
43
+
44
+ #### Typography and color extraction
45
+
46
+ **When given an example design to emulate**: Always analyze the presentation's typography and colors first using the methods below:
47
+
48
+ 1. **Read theme file**: Check `ppt/theme/theme1.xml` for colors (`<a:clrScheme>`) and fonts (`<a:fontScheme>`)
49
+ 2. **Sample slide content**: Examine `ppt/slides/slide1.xml` for actual font usage (`<a:rPr>`) and colors
50
+ 3. **Search for patterns**: Use grep to find color (`<a:solidFill>`, `<a:srgbClr>`) and font references across all XML files
51
+
52
+ ## Creating a new PowerPoint presentation **without a template**
53
+
54
+ When creating a new PowerPoint presentation from scratch, use the **html2pptx** workflow to convert HTML slides to PowerPoint with accurate positioning.
55
+
56
+ ### Design Principles
57
+
58
+ **CRITICAL**: Before creating any presentation, analyze the content and choose appropriate design elements:
59
+
60
+ 1. **Consider the subject matter**: What is this presentation about? What tone, industry, or mood does it suggest?
61
+ 2. **Check for branding**: If the user mentions a company/organization, consider their brand colors and identity
62
+ 3. **Match palette to content**: Select colors that reflect the subject
63
+ 4. **State your approach**: Explain your design choices before writing code
64
+
65
+ **Requirements**:
66
+
67
+ - ✅ State your content-informed design approach BEFORE writing code
68
+ - ✅ Use web-safe fonts only: Arial, Helvetica, Times New Roman, Georgia, Courier New, Verdana, Tahoma, Trebuchet MS, Impact
69
+ - ✅ Create clear visual hierarchy through size, weight, and color
70
+ - ✅ Ensure readability: strong contrast, appropriately sized text, clean alignment
71
+ - ✅ Be consistent: repeat patterns, spacing, and visual language across slides
72
+
73
+ #### Color Palette Selection
74
+
75
+ **Choosing colors creatively**:
76
+
77
+ - **Think beyond defaults**: What colors genuinely match this specific topic? Avoid autopilot choices.
78
+ - **Consider multiple angles**: Topic, industry, mood, energy level, target audience, brand identity (if mentioned)
79
+ - **Be adventurous**: Try unexpected combinations - a healthcare presentation doesn't have to be green, finance doesn't have to be navy
80
+ - **Build your palette**: Pick 3-5 colors that work together (dominant colors + supporting tones + accent)
81
+ - **Ensure contrast**: Text must be clearly readable on backgrounds
82
+
83
+ **Example color palettes** (use these to spark creativity - choose one, adapt it, or create your own):
84
+
85
+ 1. **Classic Blue**: Deep navy (#1C2833), slate gray (#2E4053), silver (#AAB7B8), off-white (#F4F6F6)
86
+ 2. **Teal & Coral**: Teal (#5EA8A7), deep teal (#277884), coral (#FE4447), white (#FFFFFF)
87
+ 3. **Bold Red**: Red (#C0392B), bright red (#E74C3C), orange (#F39C12), yellow (#F1C40F), green (#2ECC71)
88
+ 4. **Warm Blush**: Mauve (#A49393), blush (#EED6D3), rose (#E8B4B8), cream (#FAF7F2)
89
+ 5. **Burgundy Luxury**: Burgundy (#5D1D2E), crimson (#951233), rust (#C15937), gold (#997929)
90
+ 6. **Deep Purple & Emerald**: Purple (#B165FB), dark blue (#181B24), emerald (#40695B), white (#FFFFFF)
91
+ 7. **Cream & Forest Green**: Cream (#FFE1C7), forest green (#40695B), white (#FCFCFC)
92
+ 8. **Pink & Purple**: Pink (#F8275B), coral (#FF574A), rose (#FF737D), purple (#3D2F68)
93
+ 9. **Lime & Plum**: Lime (#C5DE82), plum (#7C3A5F), coral (#FD8C6E), blue-gray (#98ACB5)
94
+ 10. **Black & Gold**: Gold (#BF9A4A), black (#000000), cream (#F4F6F6)
95
+ 11. **Sage & Terracotta**: Sage (#87A96B), terracotta (#E07A5F), cream (#F4F1DE), charcoal (#2C2C2C)
96
+ 12. **Charcoal & Red**: Charcoal (#292929), red (#E33737), light gray (#CCCBCB)
97
+ 13. **Vibrant Orange**: Orange (#F96D00), light gray (#F2F2F2), charcoal (#222831)
98
+ 14. **Forest Green**: Black (#191A19), green (#4E9F3D), dark green (#1E5128), white (#FFFFFF)
99
+ 15. **Retro Rainbow**: Purple (#722880), pink (#D72D51), orange (#EB5C18), amber (#F08800), gold (#DEB600)
100
+ 16. **Vintage Earthy**: Mustard (#E3B448), sage (#CBD18F), forest green (#3A6B35), cream (#F4F1DE)
101
+ 17. **Coastal Rose**: Old rose (#AD7670), beaver (#B49886), eggshell (#F3ECDC), ash gray (#BFD5BE)
102
+ 18. **Orange & Turquoise**: Light orange (#FC993E), grayish turquoise (#667C6F), white (#FCFCFC)
103
+
104
+ #### Visual Details Options
105
+
106
+ **Geometric Patterns**:
107
+
108
+ - Diagonal section dividers instead of horizontal
109
+ - Asymmetric column widths (30/70, 40/60, 25/75)
110
+ - Rotated text headers at 90° or 270°
111
+ - Circular/hexagonal frames for images
112
+ - Triangular accent shapes in corners
113
+ - Overlapping shapes for depth
114
+
115
+ **Border & Frame Treatments**:
116
+
117
+ - Thick single-color borders (10-20pt) on one side only
118
+ - Double-line borders with contrasting colors
119
+ - Corner brackets instead of full frames
120
+ - L-shaped borders (top+left or bottom+right)
121
+ - Underline accents beneath headers (3-5pt thick)
122
+
123
+ **Typography Treatments**:
124
+
125
+ - Extreme size contrast (72pt headlines vs 11pt body)
126
+ - All-caps headers with wide letter spacing
127
+ - Numbered sections in oversized display type
128
+ - Monospace (Courier New) for data/stats/technical content
129
+ - Condensed fonts (Arial Narrow) for dense information
130
+ - Outlined text for emphasis
131
+
132
+ **Chart & Data Styling**:
133
+
134
+ - Monochrome charts with single accent color for key data
135
+ - Horizontal bar charts instead of vertical
136
+ - Dot plots instead of bar charts
137
+ - Minimal gridlines or none at all
138
+ - Data labels directly on elements (no legends)
139
+ - Oversized numbers for key metrics
140
+
141
+ **Layout Innovations**:
142
+
143
+ - Full-bleed images with text overlays
144
+ - Sidebar column (20-30% width) for navigation/context
145
+ - Modular grid systems (3×3, 4×4 blocks)
146
+ - Z-pattern or F-pattern content flow
147
+ - Floating text boxes over colored shapes
148
+ - Magazine-style multi-column layouts
149
+
150
+ **Background Treatments**:
151
+
152
+ - Solid color blocks occupying 40-60% of slide
153
+ - Gradient fills (vertical or diagonal only)
154
+ - Split backgrounds (two colors, diagonal or vertical)
155
+ - Edge-to-edge color bands
156
+ - Negative space as a design element
157
+
158
+ ### Layout Tips
159
+
160
+ **When creating slides with charts or tables:**
161
+
162
+ - **Two-column layout (PREFERRED)**: Use a header spanning the full width, then two columns below - text/bullets in one column and the featured content in the other. This provides better balance and makes charts/tables more readable. Use flexbox with unequal column widths (e.g., 40%/60% split) to optimize space for each content type.
163
+ - **Full-slide layout**: Let the featured content (chart/table) take up the entire slide for maximum impact and readability
164
+ - **NEVER vertically stack**: Do not place charts/tables below text in a single column - this causes poor readability and layout issues
165
+
166
+ ### Workflow
167
+
168
+ 1. **MANDATORY - READ ENTIRE FILE**: Read [`html2pptx.md`](html2pptx.md) completely from start to finish. **NEVER set any range limits when reading this file.** Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with presentation creation.
169
+ 2. Create an HTML file for each slide with proper dimensions (e.g., 720pt × 405pt for 16:9)
170
+ - Use `<p>`, `<h1>`-`<h6>`, `<ul>`, `<ol>` for all text content
171
+ - Use `class="placeholder"` for areas where charts/tables will be added (render with gray background for visibility)
172
+ - **CRITICAL**: Rasterize gradients and icons as PNG images FIRST using Sharp, then reference in HTML
173
+ - **LAYOUT**: For slides with charts/tables/images, use either full-slide layout or two-column layout for better readability
174
+ 3. Create and run a JavaScript file using the [`html2pptx.js`](scripts/html2pptx.js) library to convert HTML slides to PowerPoint and save the presentation
175
+ - Use the `html2pptx()` function to process each HTML file
176
+ - Add charts and tables to placeholder areas using PptxGenJS API
177
+ - Save the presentation using `pptx.writeFile()`
178
+ 4. **Visual validation**: Generate thumbnails and inspect for layout issues
179
+ - Create thumbnail grid: `python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4`
180
+ - Read and carefully examine the thumbnail image for:
181
+ - **Text cutoff**: Text being cut off by header bars, shapes, or slide edges
182
+ - **Text overlap**: Text overlapping with other text or shapes
183
+ - **Positioning issues**: Content too close to slide boundaries or other elements
184
+ - **Contrast issues**: Insufficient contrast between text and backgrounds
185
+ - If issues found, adjust HTML margins/spacing/colors and regenerate the presentation
186
+ - Repeat until all slides are visually correct
187
+
188
+ ## Editing an existing PowerPoint presentation
189
+
190
+ When edit slides in an existing PowerPoint presentation, you need to work with the raw Office Open XML (OOXML) format. This involves unpacking the .pptx file, editing the XML content, and repacking it.
191
+
192
+ ### Workflow
193
+
194
+ 1. **MANDATORY - READ ENTIRE FILE**: Read [`ooxml.md`](ooxml.md) (~500 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Read the full file content for detailed guidance on OOXML structure and editing workflows before any presentation editing.
195
+ 2. Unpack the presentation: `python ooxml/scripts/unpack.py <office_file> <output_dir>`
196
+ 3. Edit the XML files (primarily `ppt/slides/slide{N}.xml` and related files)
197
+ 4. **CRITICAL**: Validate immediately after each edit and fix any validation errors before proceeding: `python ooxml/scripts/validate.py <dir> --original <file>`
198
+ 5. Pack the final presentation: `python ooxml/scripts/pack.py <input_directory> <office_file>`
199
+
200
+ ## Creating a new PowerPoint presentation **using a template**
201
+
202
+ When you need to create a presentation that follows an existing template's design, you'll need to duplicate and re-arrange template slides before then replacing placeholder context.
203
+
204
+ ### Workflow
205
+
206
+ 1. **Extract template text AND create visual thumbnail grid**:
207
+
208
+ - Extract text: `python -m markitdown template.pptx > template-content.md`
209
+ - Read `template-content.md`: Read the entire file to understand the contents of the template presentation. **NEVER set any range limits when reading this file.**
210
+ - Create thumbnail grids: `python scripts/thumbnail.py template.pptx`
211
+ - See [Creating Thumbnail Grids](#creating-thumbnail-grids) section for more details
212
+
213
+ 2. **Analyze template and save inventory to a file**:
214
+
215
+ - **Visual Analysis**: Review thumbnail grid(s) to understand slide layouts, design patterns, and visual structure
216
+ - Create and save a template inventory file at `template-inventory.md` containing:
217
+
218
+ ```markdown
219
+ # Template Inventory Analysis
220
+
221
+ **Total Slides: [count]**
222
+ **IMPORTANT: Slides are 0-indexed (first slide = 0, last slide = count-1)**
223
+
224
+ ## [Category Name]
225
+
226
+ - Slide 0: [Layout code if available] - Description/purpose
227
+ - Slide 1: [Layout code] - Description/purpose
228
+ - Slide 2: [Layout code] - Description/purpose
229
+ [... EVERY slide must be listed individually with its index ...]
230
+ ```
231
+
232
+ - **Using the thumbnail grid**: Reference the visual thumbnails to identify:
233
+ - Layout patterns (title slides, content layouts, section dividers)
234
+ - Image placeholder locations and counts
235
+ - Design consistency across slide groups
236
+ - Visual hierarchy and structure
237
+ - This inventory file is REQUIRED for selecting appropriate templates in the next step
238
+
239
+ 3. **Create presentation outline based on template inventory**:
240
+
241
+ - Review available templates from step 2.
242
+ - Choose an intro or title template for the first slide. This should be one of the first templates.
243
+ - Choose safe, text-based layouts for the other slides.
244
+ - **CRITICAL: Match layout structure to actual content**:
245
+ - Single-column layouts: Use for unified narrative or single topic
246
+ - Two-column layouts: Use ONLY when you have exactly 2 distinct items/concepts
247
+ - Three-column layouts: Use ONLY when you have exactly 3 distinct items/concepts
248
+ - Image + text layouts: Use ONLY when you have actual images to insert
249
+ - Quote layouts: Use ONLY for actual quotes from people (with attribution), never for emphasis
250
+ - Never use layouts with more placeholders than you have content
251
+ - If you have 2 items, don't force them into a 3-column layout
252
+ - If you have 4+ items, consider breaking into multiple slides or using a list format
253
+ - Count your actual content pieces BEFORE selecting the layout
254
+ - Verify each placeholder in the chosen layout will be filled with meaningful content
255
+ - Select one option representing the **best** layout for each content section.
256
+ - Save `outline.md` with content AND template mapping that leverages available designs
257
+ - Example template mapping:
258
+ ```
259
+ # Template slides to use (0-based indexing)
260
+ # WARNING: Verify indices are within range! Template with 73 slides has indices 0-72
261
+ # Mapping: slide numbers from outline -> template slide indices
262
+ template_mapping = [
263
+ 0, # Use slide 0 (Title/Cover)
264
+ 34, # Use slide 34 (B1: Title and body)
265
+ 34, # Use slide 34 again (duplicate for second B1)
266
+ 50, # Use slide 50 (E1: Quote)
267
+ 54, # Use slide 54 (F2: Closing + Text)
268
+ ]
269
+ ```
270
+
271
+ 4. **Duplicate, reorder, and delete slides using `rearrange.py`**:
272
+
273
+ - Use the `scripts/rearrange.py` script to create a new presentation with slides in the desired order:
274
+ ```bash
275
+ python scripts/rearrange.py template.pptx working.pptx 0,34,34,50,52
276
+ ```
277
+ - The script handles duplicating repeated slides, deleting unused slides, and reordering automatically
278
+ - Slide indices are 0-based (first slide is 0, second is 1, etc.)
279
+ - The same slide index can appear multiple times to duplicate that slide
280
+
281
+ 5. **Extract ALL text using the `inventory.py` script**:
282
+
283
+ - **Run inventory extraction**:
284
+ ```bash
285
+ python scripts/inventory.py working.pptx text-inventory.json
286
+ ```
287
+ - **Read text-inventory.json**: Read the entire text-inventory.json file to understand all shapes and their properties. **NEVER set any range limits when reading this file.**
288
+
289
+ - The inventory JSON structure:
290
+
291
+ ```json
292
+ {
293
+ "slide-0": {
294
+ "shape-0": {
295
+ "placeholder_type": "TITLE", // or null for non-placeholders
296
+ "left": 1.5, // position in inches
297
+ "top": 2.0,
298
+ "width": 7.5,
299
+ "height": 1.2,
300
+ "paragraphs": [
301
+ {
302
+ "text": "Paragraph text",
303
+ // Optional properties (only included when non-default):
304
+ "bullet": true, // explicit bullet detected
305
+ "level": 0, // only included when bullet is true
306
+ "alignment": "CENTER", // CENTER, RIGHT (not LEFT)
307
+ "space_before": 10.0, // space before paragraph in points
308
+ "space_after": 6.0, // space after paragraph in points
309
+ "line_spacing": 22.4, // line spacing in points
310
+ "font_name": "Arial", // from first run
311
+ "font_size": 14.0, // in points
312
+ "bold": true,
313
+ "italic": false,
314
+ "underline": false,
315
+ "color": "FF0000" // RGB color
316
+ }
317
+ ]
318
+ }
319
+ }
320
+ }
321
+ ```
322
+
323
+ - Key features:
324
+ - **Slides**: Named as "slide-0", "slide-1", etc.
325
+ - **Shapes**: Ordered by visual position (top-to-bottom, left-to-right) as "shape-0", "shape-1", etc.
326
+ - **Placeholder types**: TITLE, CENTER_TITLE, SUBTITLE, BODY, OBJECT, or null
327
+ - **Default font size**: `default_font_size` in points extracted from layout placeholders (when available)
328
+ - **Slide numbers are filtered**: Shapes with SLIDE_NUMBER placeholder type are automatically excluded from inventory
329
+ - **Bullets**: When `bullet: true`, `level` is always included (even if 0)
330
+ - **Spacing**: `space_before`, `space_after`, and `line_spacing` in points (only included when set)
331
+ - **Colors**: `color` for RGB (e.g., "FF0000"), `theme_color` for theme colors (e.g., "DARK_1")
332
+ - **Properties**: Only non-default values are included in the output
333
+
334
+ 6. **Generate replacement text and save the data to a JSON file**
335
+ Based on the text inventory from the previous step:
336
+
337
+ - **CRITICAL**: First verify which shapes exist in the inventory - only reference shapes that are actually present
338
+ - **VALIDATION**: The replace.py script will validate that all shapes in your replacement JSON exist in the inventory
339
+ - If you reference a non-existent shape, you'll get an error showing available shapes
340
+ - If you reference a non-existent slide, you'll get an error indicating the slide doesn't exist
341
+ - All validation errors are shown at once before the script exits
342
+ - **IMPORTANT**: The replace.py script uses inventory.py internally to identify ALL text shapes
343
+ - **AUTOMATIC CLEARING**: ALL text shapes from the inventory will be cleared unless you provide "paragraphs" for them
344
+ - Add a "paragraphs" field to shapes that need content (not "replacement_paragraphs")
345
+ - Shapes without "paragraphs" in the replacement JSON will have their text cleared automatically
346
+ - Paragraphs with bullets will be automatically left aligned. Don't set the `alignment` property on when `"bullet": true`
347
+ - Generate appropriate replacement content for placeholder text
348
+ - Use shape size to determine appropriate content length
349
+ - **CRITICAL**: Include paragraph properties from the original inventory - don't just provide text
350
+ - **IMPORTANT**: When bullet: true, do NOT include bullet symbols (•, -, \*) in text - they're added automatically
351
+ - **ESSENTIAL FORMATTING RULES**:
352
+ - Headers/titles should typically have `"bold": true`
353
+ - List items should have `"bullet": true, "level": 0` (level is required when bullet is true)
354
+ - Preserve any alignment properties (e.g., `"alignment": "CENTER"` for centered text)
355
+ - Include font properties when different from default (e.g., `"font_size": 14.0`, `"font_name": "Lora"`)
356
+ - Colors: Use `"color": "FF0000"` for RGB or `"theme_color": "DARK_1"` for theme colors
357
+ - The replacement script expects **properly formatted paragraphs**, not just text strings
358
+ - **Overlapping shapes**: Prefer shapes with larger default_font_size or more appropriate placeholder_type
359
+ - Save the updated inventory with replacements to `replacement-text.json`
360
+ - **WARNING**: Different template layouts have different shape counts - always check the actual inventory before creating replacements
361
+
362
+ Example paragraphs field showing proper formatting:
363
+
364
+ ```json
365
+ "paragraphs": [
366
+ {
367
+ "text": "New presentation title text",
368
+ "alignment": "CENTER",
369
+ "bold": true
370
+ },
371
+ {
372
+ "text": "Section Header",
373
+ "bold": true
374
+ },
375
+ {
376
+ "text": "First bullet point without bullet symbol",
377
+ "bullet": true,
378
+ "level": 0
379
+ },
380
+ {
381
+ "text": "Red colored text",
382
+ "color": "FF0000"
383
+ },
384
+ {
385
+ "text": "Theme colored text",
386
+ "theme_color": "DARK_1"
387
+ },
388
+ {
389
+ "text": "Regular paragraph text without special formatting"
390
+ }
391
+ ]
392
+ ```
393
+
394
+ **Shapes not listed in the replacement JSON are automatically cleared**:
395
+
396
+ ```json
397
+ {
398
+ "slide-0": {
399
+ "shape-0": {
400
+ "paragraphs": [...] // This shape gets new text
401
+ }
402
+ // shape-1 and shape-2 from inventory will be cleared automatically
403
+ }
404
+ }
405
+ ```
406
+
407
+ **Common formatting patterns for presentations**:
408
+
409
+ - Title slides: Bold text, sometimes centered
410
+ - Section headers within slides: Bold text
411
+ - Bullet lists: Each item needs `"bullet": true, "level": 0`
412
+ - Body text: Usually no special properties needed
413
+ - Quotes: May have special alignment or font properties
414
+
415
+ 7. **Apply replacements using the `replace.py` script**
416
+
417
+ ```bash
418
+ python scripts/replace.py working.pptx replacement-text.json output.pptx
419
+ ```
420
+
421
+ The script will:
422
+
423
+ - First extract the inventory of ALL text shapes using functions from inventory.py
424
+ - Validate that all shapes in the replacement JSON exist in the inventory
425
+ - Clear text from ALL shapes identified in the inventory
426
+ - Apply new text only to shapes with "paragraphs" defined in the replacement JSON
427
+ - Preserve formatting by applying paragraph properties from the JSON
428
+ - Handle bullets, alignment, font properties, and colors automatically
429
+ - Save the updated presentation
430
+
431
+ Example validation errors:
432
+
433
+ ```
434
+ ERROR: Invalid shapes in replacement JSON:
435
+ - Shape 'shape-99' not found on 'slide-0'. Available shapes: shape-0, shape-1, shape-4
436
+ - Slide 'slide-999' not found in inventory
437
+ ```
438
+
439
+ ```
440
+ ERROR: Replacement text made overflow worse in these shapes:
441
+ - slide-0/shape-2: overflow worsened by 1.25" (was 0.00", now 1.25")
442
+ ```
443
+
444
+ ## Creating Thumbnail Grids
445
+
446
+ To create visual thumbnail grids of PowerPoint slides for quick analysis and reference:
447
+
448
+ ```bash
449
+ python scripts/thumbnail.py template.pptx [output_prefix]
450
+ ```
451
+
452
+ **Features**:
453
+
454
+ - Creates: `thumbnails.jpg` (or `thumbnails-1.jpg`, `thumbnails-2.jpg`, etc. for large decks)
455
+ - Default: 5 columns, max 30 slides per grid (5×6)
456
+ - Custom prefix: `python scripts/thumbnail.py template.pptx my-grid`
457
+ - Note: The output prefix should include the path if you want output in a specific directory (e.g., `workspace/my-grid`)
458
+ - Adjust columns: `--cols 4` (range: 3-6, affects slides per grid)
459
+ - Grid limits: 3 cols = 12 slides/grid, 4 cols = 20, 5 cols = 30, 6 cols = 42
460
+ - Slides are zero-indexed (Slide 0, Slide 1, etc.)
461
+
462
+ **Use cases**:
463
+
464
+ - Template analysis: Quickly understand slide layouts and design patterns
465
+ - Content review: Visual overview of entire presentation
466
+ - Navigation reference: Find specific slides by their visual appearance
467
+ - Quality check: Verify all slides are properly formatted
468
+
469
+ **Examples**:
470
+
471
+ ```bash
472
+ # Basic usage
473
+ python scripts/thumbnail.py presentation.pptx
474
+
475
+ # Combine options: custom name, columns
476
+ python scripts/thumbnail.py template.pptx analysis --cols 4
477
+ ```
478
+
479
+ ## Converting Slides to Images
480
+
481
+ To visually analyze PowerPoint slides, convert them to images using a two-step process:
482
+
483
+ 1. **Convert PPTX to PDF**:
484
+
485
+ ```bash
486
+ soffice --headless --convert-to pdf template.pptx
487
+ ```
488
+
489
+ 2. **Convert PDF pages to JPEG images**:
490
+ ```bash
491
+ pdftoppm -jpeg -r 150 template.pdf slide
492
+ ```
493
+ This creates files like `slide-1.jpg`, `slide-2.jpg`, etc.
494
+
495
+ Options:
496
+
497
+ - `-r 150`: Sets resolution to 150 DPI (adjust for quality/size balance)
498
+ - `-jpeg`: Output JPEG format (use `-png` for PNG if preferred)
499
+ - `-f N`: First page to convert (e.g., `-f 2` starts from page 2)
500
+ - `-l N`: Last page to convert (e.g., `-l 5` stops at page 5)
501
+ - `slide`: Prefix for output files
502
+
503
+ Example for specific range:
504
+
505
+ ```bash
506
+ pdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide # Converts only pages 2-5
507
+ ```
508
+
509
+ ## Code Style Guidelines
510
+
511
+ **IMPORTANT**: When generating code for PPTX operations:
512
+
513
+ - Write concise code
514
+ - Avoid verbose variable names and redundant operations
515
+ - Avoid unnecessary print statements
516
+
517
+ ## Dependencies
518
+
519
+ Required dependencies (should already be installed):
520
+
521
+ - **markitdown**: `pip install "markitdown[pptx]"` (for text extraction from presentations)
522
+ - **pptxgenjs**: `npm install -g pptxgenjs` (for creating presentations via html2pptx)
523
+ - **playwright**: `npm install -g playwright` (for HTML rendering in html2pptx)
524
+ - **react-icons**: `npm install -g react-icons react react-dom` (for icons)
525
+ - **sharp**: `npm install -g sharp` (for SVG rasterization and image processing)
526
+ - **LibreOffice**: `sudo apt-get install libreoffice` (for PDF conversion)
527
+ - **Poppler**: `sudo apt-get install poppler-utils` (for pdftoppm to convert PDF to images)
528
+ - **defusedxml**: `pip install defusedxml` (for secure XML parsing)