mg-shell 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (533) hide show
  1. mg_shell-0.1.0/.env.example +37 -0
  2. mg_shell-0.1.0/.flake8 +13 -0
  3. mg_shell-0.1.0/.github/workflows/auto-release.yml +196 -0
  4. mg_shell-0.1.0/.github/workflows/publish.yml +40 -0
  5. mg_shell-0.1.0/.github/workflows/release.yml +71 -0
  6. mg_shell-0.1.0/.github/workflows/test.yml +50 -0
  7. mg_shell-0.1.0/.gitignore +52 -0
  8. mg_shell-0.1.0/.windsurf/rules.md +252 -0
  9. mg_shell-0.1.0/CHANGELOG.md +119 -0
  10. mg_shell-0.1.0/CLAUDE.md +118 -0
  11. mg_shell-0.1.0/LICENSE.txt +19 -0
  12. mg_shell-0.1.0/PKG-INFO +221 -0
  13. mg_shell-0.1.0/README.md +126 -0
  14. mg_shell-0.1.0/Taskfile.yml +131 -0
  15. mg_shell-0.1.0/a2a-goat/Dockerfile +21 -0
  16. mg_shell-0.1.0/a2a-goat/README.md +388 -0
  17. mg_shell-0.1.0/a2a-goat/database.py +131 -0
  18. mg_shell-0.1.0/a2a-goat/requirements.txt +8 -0
  19. mg_shell-0.1.0/a2a-goat/seed_files/handbook.txt +39 -0
  20. mg_shell-0.1.0/a2a-goat/seed_files/internal/secrets.txt +38 -0
  21. mg_shell-0.1.0/a2a-goat/seed_files/onboarding.md +48 -0
  22. mg_shell-0.1.0/a2a-goat/server.py +490 -0
  23. mg_shell-0.1.0/a2a-goat/skills.py +418 -0
  24. mg_shell-0.1.0/docs/A2A_GUIDE.md +1286 -0
  25. mg_shell-0.1.0/docs/ADDING_COMMANDS.md +559 -0
  26. mg_shell-0.1.0/docs/DEVELOPER.md +563 -0
  27. mg_shell-0.1.0/docs/FLIPPER_GUIDE.md +907 -0
  28. mg_shell-0.1.0/docs/HAK5_GUIDE.md +923 -0
  29. mg_shell-0.1.0/docs/MACRO_MANUAL.md +1122 -0
  30. mg_shell-0.1.0/docs/MCP_GUIDE.md +932 -0
  31. mg_shell-0.1.0/docs/QUICKSTART.md +469 -0
  32. mg_shell-0.1.0/docs/THEMES.md +220 -0
  33. mg_shell-0.1.0/docs/USER_MANUAL.md +2626 -0
  34. mg_shell-0.1.0/docs/getting-started/installation.md +110 -0
  35. mg_shell-0.1.0/docs/index.md +36 -0
  36. mg_shell-0.1.0/docs/plugin-architecture.md +840 -0
  37. mg_shell-0.1.0/docs/plugin-distribution.md +97 -0
  38. mg_shell-0.1.0/docs/reference/app.md +10 -0
  39. mg_shell-0.1.0/docs/reference/commands.md +15 -0
  40. mg_shell-0.1.0/docs/reference/copilot.md +32 -0
  41. mg_shell-0.1.0/docs/reference/core.md +100 -0
  42. mg_shell-0.1.0/docs/reference/embed.md +74 -0
  43. mg_shell-0.1.0/docs/reference/hak5.md +70 -0
  44. mg_shell-0.1.0/docs/reference/hw.md +227 -0
  45. mg_shell-0.1.0/docs/reference/index.md +20 -0
  46. mg_shell-0.1.0/docs/reference/llm.md +29 -0
  47. mg_shell-0.1.0/docs/reference/macro.md +46 -0
  48. mg_shell-0.1.0/docs/reference/mcp.md +42 -0
  49. mg_shell-0.1.0/docs/reference/prompt.md +11 -0
  50. mg_shell-0.1.0/docs/reference/state.md +89 -0
  51. mg_shell-0.1.0/docs/reference/ui.md +64 -0
  52. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/__init__.py +9 -0
  53. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/auth_service.py +24 -0
  54. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/__init__.py +0 -0
  55. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/auth.py +271 -0
  56. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/blog.py +287 -0
  57. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/dataset.py +269 -0
  58. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/disclosures.py +301 -0
  59. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/export.py +156 -0
  60. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/instance.py +238 -0
  61. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/mindgard_cmd.py +107 -0
  62. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/multiturn.py +212 -0
  63. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/project.py +342 -0
  64. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/recon.py +223 -0
  65. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/results.py +184 -0
  66. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/sandbox.py +156 -0
  67. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/status.py +574 -0
  68. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/test.py +581 -0
  69. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/commands/update.py +183 -0
  70. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/guides.py +104 -0
  71. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/instance.py +255 -0
  72. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/__init__.py +0 -0
  73. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/api_client.py +65 -0
  74. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/auth.py +246 -0
  75. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/config.py +73 -0
  76. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/constants.py +33 -0
  77. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/dataset/__init__.py +0 -0
  78. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/dataset/client.py +170 -0
  79. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/exceptions.py +36 -0
  80. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/models.py +71 -0
  81. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/multiturn/__init__.py +0 -0
  82. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/multiturn/attack.py +95 -0
  83. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/multiturn/client.py +58 -0
  84. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/multiturn/events.py +89 -0
  85. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/project/__init__.py +0 -0
  86. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/project/client.py +83 -0
  87. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/__init__.py +0 -0
  88. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/client.py +65 -0
  89. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/constants.py +30 -0
  90. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/events.py +139 -0
  91. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/guardrail_client.py +113 -0
  92. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/guardrail_runner.py +101 -0
  93. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/recon/runner.py +81 -0
  94. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/test/__init__.py +0 -0
  95. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/test/api.py +139 -0
  96. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/test/engine.py +477 -0
  97. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/lib/test/orchestrator.py +199 -0
  98. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/plugin.py +63 -0
  99. mg_shell-0.1.0/mindgard-cloud/mindgard_cloud/session_provider.py +126 -0
  100. mg_shell-0.1.0/mindgard-cloud/pyproject.toml +27 -0
  101. mg_shell-0.1.0/mindgard-cloud/tests/__init__.py +0 -0
  102. mg_shell-0.1.0/mindgard-cloud/tests/test_cloud_plugin.py +16 -0
  103. mg_shell-0.1.0/mindgard-cloud/tests/test_guides.py +17 -0
  104. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_auth.py +10 -0
  105. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_config.py +23 -0
  106. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_dataset.py +12 -0
  107. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_multiturn.py +11 -0
  108. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_project.py +14 -0
  109. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_recon.py +26 -0
  110. mg_shell-0.1.0/mindgard-cloud/tests/test_lib_test_engine.py +41 -0
  111. mg_shell-0.1.0/mindgard-cloud/tests/test_session_provider.py +188 -0
  112. mg_shell-0.1.0/mindgard-cloud/tests/test_test_command.py +18 -0
  113. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/__init__.py +8 -0
  114. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/__init__.py +0 -0
  115. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/__init__.py +0 -0
  116. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/context.py +251 -0
  117. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/events.py +515 -0
  118. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/input_encoding.py +910 -0
  119. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/langfuse_tracing.py +235 -0
  120. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/shared.py +14 -0
  121. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/target_session.py +53 -0
  122. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/util.py +2 -0
  123. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/common/workflow.py +229 -0
  124. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/entrypoint.py +218 -0
  125. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/__init__.py +0 -0
  126. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/README.md +267 -0
  127. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/__init__.py +0 -0
  128. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/hunt.py +4680 -0
  129. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/__init__.py +0 -0
  130. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mcp-results.json +257 -0
  131. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mcp-results.md +96 -0
  132. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mcp-target.toml +1 -0
  133. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mcp-tools.json +536 -0
  134. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mcp-trace.jsonl +691 -0
  135. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mess-results.json +117 -0
  136. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mess-results.md +10 -0
  137. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mess-target.toml +1 -0
  138. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/resources/mess-trace.jsonl +265 -0
  139. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/step.py +93 -0
  140. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/__init__.py +42 -0
  141. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/base.py +178 -0
  142. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/cmdi.py +46 -0
  143. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/idor.py +56 -0
  144. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/path_traversal.py +60 -0
  145. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/pycodi.py +68 -0
  146. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/sqli.py +51 -0
  147. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/ssrf.py +64 -0
  148. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/auto_vuln_hunter/vuln_types/xxe.py +56 -0
  149. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/guardrail.py +88 -0
  150. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/initial_recon/__init__.py +0 -0
  151. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/initial_recon/step.py +348 -0
  152. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/multiturn.py +183 -0
  153. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/recon.py +114 -0
  154. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/safety/__init__.py +671 -0
  155. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/safety/models.py +39 -0
  156. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/__init__.py +0 -0
  157. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/__init__.py +81 -0
  158. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/direct_consensus.py +41 -0
  159. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/main.py +116 -0
  160. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/models.py +62 -0
  161. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/similarity_methods/__init__.py +0 -0
  162. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/similarity_methods/consensus.py +33 -0
  163. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/similarity_methods/jaccard_similarity.py +46 -0
  164. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/similarity_methods/levenshtein_distance.py +10 -0
  165. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/distil/sliding_window.py +246 -0
  166. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/system_prompt_extraction/step.py +109 -0
  167. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/test.py +182 -0
  168. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/__init__.py +206 -0
  169. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/models.py +70 -0
  170. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/prompt.py +175 -0
  171. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/sender.py +56 -0
  172. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/temp/__init__.py +0 -0
  173. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/temp/mcp_recon_tools_discovered.json +939 -0
  174. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/temp/mess_recon_tools_discovered_round_3.json +853 -0
  175. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/temp/target.toml +7 -0
  176. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_distil/temp/workflow.toml +3 -0
  177. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/steps/tool_extraction/__init__.py +158 -0
  178. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/tui/__init__.py +5 -0
  179. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/tui/display.py +138 -0
  180. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/__init__.py +0 -0
  181. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/auto_vuln_hunter/__init__.py +0 -0
  182. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/auto_vuln_hunter/v1.py +121 -0
  183. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/example/__init__.py +0 -0
  184. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/example/findings.py +33 -0
  185. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/example/v1.py +27 -0
  186. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/initial_recon/__init__.py +0 -0
  187. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/initial_recon/v1.py +90 -0
  188. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/mindgard_test/__init__.py +0 -0
  189. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/mindgard_test/v1.py +31 -0
  190. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/registry.py +102 -0
  191. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_deep/__init__.py +0 -0
  192. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_deep/v1.py +70 -0
  193. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_dev/__init__.py +0 -0
  194. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_dev/v1.py +72 -0
  195. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_extended/__init__.py +0 -0
  196. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_extended/v1.py +72 -0
  197. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_quick/__init__.py +0 -0
  198. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/safety_quick/v1.py +70 -0
  199. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/system_prompt_extraction/__init__.py +0 -0
  200. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/system_prompt_extraction/v1.py +48 -0
  201. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/tool_extraction/__init__.py +0 -0
  202. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/automat/workflow/tool_extraction/v1.py +41 -0
  203. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/__init__.py +8 -0
  204. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/direct_runner.py +231 -0
  205. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/events.py +192 -0
  206. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/hunt.py +4679 -0
  207. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/langfuse_tracing.py +236 -0
  208. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/runner.py +227 -0
  209. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/shared.py +17 -0
  210. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/target_adapter.py +141 -0
  211. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/tool_converter.py +65 -0
  212. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/__init__.py +48 -0
  213. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/base.py +178 -0
  214. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/cmdi.py +46 -0
  215. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/idor.py +56 -0
  216. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/path_traversal.py +60 -0
  217. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/push_notification_ssrf.py +108 -0
  218. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/pycodi.py +68 -0
  219. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/sqli.py +51 -0
  220. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/ssrf.py +64 -0
  221. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/task_lifecycle_abuse.py +108 -0
  222. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/avh/vuln_types/xxe.py +56 -0
  223. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/commands/__init__.py +0 -0
  224. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/commands/auto_attack.py +148 -0
  225. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/commands/workflow.py +211 -0
  226. mg_shell-0.1.0/mindgard-workflows/mindgard_workflows/plugin.py +17 -0
  227. mg_shell-0.1.0/mindgard-workflows/pyproject.toml +25 -0
  228. mg_shell-0.1.0/mindgard-workflows/tests/conftest.py +60 -0
  229. mg_shell-0.1.0/mindgard-workflows/tests/test_auto_attack.py +253 -0
  230. mg_shell-0.1.0/mindgard-workflows/tests/test_avh.py +458 -0
  231. mg_shell-0.1.0/mindgard-workflows/tests/test_workflow_command.py +29 -0
  232. mg_shell-0.1.0/mindgard_shell/__init__.py +3 -0
  233. mg_shell-0.1.0/mindgard_shell/a2a/__init__.py +108 -0
  234. mg_shell-0.1.0/mindgard_shell/a2a/auth.py +74 -0
  235. mg_shell-0.1.0/mindgard_shell/a2a/client.py +334 -0
  236. mg_shell-0.1.0/mindgard_shell/a2a/config.py +186 -0
  237. mg_shell-0.1.0/mindgard_shell/a2a/discover.py +834 -0
  238. mg_shell-0.1.0/mindgard_shell/a2a/honeypot.py +784 -0
  239. mg_shell-0.1.0/mindgard_shell/a2a/honeypot_personas.py +521 -0
  240. mg_shell-0.1.0/mindgard_shell/a2a/inject.py +327 -0
  241. mg_shell-0.1.0/mindgard_shell/a2a/monitor.py +293 -0
  242. mg_shell-0.1.0/mindgard_shell/a2a/proxy.py +261 -0
  243. mg_shell-0.1.0/mindgard_shell/a2a/runner.py +204 -0
  244. mg_shell-0.1.0/mindgard_shell/a2a/skill_converter.py +117 -0
  245. mg_shell-0.1.0/mindgard_shell/a2a/testing_agent.py +372 -0
  246. mg_shell-0.1.0/mindgard_shell/app.py +591 -0
  247. mg_shell-0.1.0/mindgard_shell/chef/__init__.py +16 -0
  248. mg_shell-0.1.0/mindgard_shell/chef/lexer.py +124 -0
  249. mg_shell-0.1.0/mindgard_shell/chef/repl.py +401 -0
  250. mg_shell-0.1.0/mindgard_shell/cli.py +110 -0
  251. mg_shell-0.1.0/mindgard_shell/commands/__init__.py +140 -0
  252. mg_shell-0.1.0/mindgard_shell/commands/a2a_cmd.py +1348 -0
  253. mg_shell-0.1.0/mindgard_shell/commands/alias.py +123 -0
  254. mg_shell-0.1.0/mindgard_shell/commands/ask.py +373 -0
  255. mg_shell-0.1.0/mindgard_shell/commands/audit.py +117 -0
  256. mg_shell-0.1.0/mindgard_shell/commands/bunny.py +1453 -0
  257. mg_shell-0.1.0/mindgard_shell/commands/chat.py +153 -0
  258. mg_shell-0.1.0/mindgard_shell/commands/chef.py +341 -0
  259. mg_shell-0.1.0/mindgard_shell/commands/context.py +359 -0
  260. mg_shell-0.1.0/mindgard_shell/commands/copilot.py +865 -0
  261. mg_shell-0.1.0/mindgard_shell/commands/dashboard.py +254 -0
  262. mg_shell-0.1.0/mindgard_shell/commands/docs.py +252 -0
  263. mg_shell-0.1.0/mindgard_shell/commands/ducky.py +825 -0
  264. mg_shell-0.1.0/mindgard_shell/commands/embed.py +1706 -0
  265. mg_shell-0.1.0/mindgard_shell/commands/guide.py +202 -0
  266. mg_shell-0.1.0/mindgard_shell/commands/history.py +191 -0
  267. mg_shell-0.1.0/mindgard_shell/commands/hooks.py +245 -0
  268. mg_shell-0.1.0/mindgard_shell/commands/hw.py +1416 -0
  269. mg_shell-0.1.0/mindgard_shell/commands/inject.py +1615 -0
  270. mg_shell-0.1.0/mindgard_shell/commands/ipy.py +234 -0
  271. mg_shell-0.1.0/mindgard_shell/commands/jobs.py +358 -0
  272. mg_shell-0.1.0/mindgard_shell/commands/macro.py +763 -0
  273. mg_shell-0.1.0/mindgard_shell/commands/mcp_cmd.py +637 -0
  274. mg_shell-0.1.0/mindgard_shell/commands/meta.py +367 -0
  275. mg_shell-0.1.0/mindgard_shell/commands/model.py +962 -0
  276. mg_shell-0.1.0/mindgard_shell/commands/netinfo.py +728 -0
  277. mg_shell-0.1.0/mindgard_shell/commands/notes.py +188 -0
  278. mg_shell-0.1.0/mindgard_shell/commands/notify_cmd.py +257 -0
  279. mg_shell-0.1.0/mindgard_shell/commands/plan.py +360 -0
  280. mg_shell-0.1.0/mindgard_shell/commands/plugin_cmd.py +560 -0
  281. mg_shell-0.1.0/mindgard_shell/commands/profile.py +356 -0
  282. mg_shell-0.1.0/mindgard_shell/commands/prompt_cmd.py +633 -0
  283. mg_shell-0.1.0/mindgard_shell/commands/rec.py +385 -0
  284. mg_shell-0.1.0/mindgard_shell/commands/reset.py +93 -0
  285. mg_shell-0.1.0/mindgard_shell/commands/session.py +343 -0
  286. mg_shell-0.1.0/mindgard_shell/commands/settings.py +215 -0
  287. mg_shell-0.1.0/mindgard_shell/commands/support.py +143 -0
  288. mg_shell-0.1.0/mindgard_shell/commands/target.py +574 -0
  289. mg_shell-0.1.0/mindgard_shell/commands/theme.py +111 -0
  290. mg_shell-0.1.0/mindgard_shell/copilot/__init__.py +31 -0
  291. mg_shell-0.1.0/mindgard_shell/copilot/config.py +177 -0
  292. mg_shell-0.1.0/mindgard_shell/copilot/default_prompt.py +55 -0
  293. mg_shell-0.1.0/mindgard_shell/copilot/engine.py +465 -0
  294. mg_shell-0.1.0/mindgard_shell/copilot/prompt.py +719 -0
  295. mg_shell-0.1.0/mindgard_shell/copilot/tools.py +509 -0
  296. mg_shell-0.1.0/mindgard_shell/core/__init__.py +1 -0
  297. mg_shell-0.1.0/mindgard_shell/core/command.py +87 -0
  298. mg_shell-0.1.0/mindgard_shell/core/exceptions.py +141 -0
  299. mg_shell-0.1.0/mindgard_shell/core/headers.py +27 -0
  300. mg_shell-0.1.0/mindgard_shell/core/plugin.py +165 -0
  301. mg_shell-0.1.0/mindgard_shell/core/protocols.py +53 -0
  302. mg_shell-0.1.0/mindgard_shell/core/target.py +199 -0
  303. mg_shell-0.1.0/mindgard_shell/core/task.py +142 -0
  304. mg_shell-0.1.0/mindgard_shell/core/types.py +14 -0
  305. mg_shell-0.1.0/mindgard_shell/core/wrappers/__init__.py +26 -0
  306. mg_shell-0.1.0/mindgard_shell/core/wrappers/base.py +87 -0
  307. mg_shell-0.1.0/mindgard_shell/core/wrappers/custom.py +99 -0
  308. mg_shell-0.1.0/mindgard_shell/core/wrappers/factory.py +139 -0
  309. mg_shell-0.1.0/mindgard_shell/core/wrappers/openai_compat.py +113 -0
  310. mg_shell-0.1.0/mindgard_shell/core/wrappers/responses.py +67 -0
  311. mg_shell-0.1.0/mindgard_shell/core/wrappers/templating.py +26 -0
  312. mg_shell-0.1.0/mindgard_shell/core/wrappers/throttle.py +55 -0
  313. mg_shell-0.1.0/mindgard_shell/embed/__init__.py +38 -0
  314. mg_shell-0.1.0/mindgard_shell/embed/adversarial_audio.py +330 -0
  315. mg_shell-0.1.0/mindgard_shell/embed/anamorpher.py +251 -0
  316. mg_shell-0.1.0/mindgard_shell/embed/audio.py +750 -0
  317. mg_shell-0.1.0/mindgard_shell/embed/audio_tts.py +324 -0
  318. mg_shell-0.1.0/mindgard_shell/embed/barcode.py +581 -0
  319. mg_shell-0.1.0/mindgard_shell/embed/formats.py +1760 -0
  320. mg_shell-0.1.0/mindgard_shell/embed/qrcode.py +154 -0
  321. mg_shell-0.1.0/mindgard_shell/embed/render_image.py +161 -0
  322. mg_shell-0.1.0/mindgard_shell/engine/__init__.py +1 -0
  323. mg_shell-0.1.0/mindgard_shell/engine/discovery.py +44 -0
  324. mg_shell-0.1.0/mindgard_shell/engine/dispatch.py +382 -0
  325. mg_shell-0.1.0/mindgard_shell/engine/dotenv.py +123 -0
  326. mg_shell-0.1.0/mindgard_shell/engine/escape_handlers.py +235 -0
  327. mg_shell-0.1.0/mindgard_shell/engine/hooks.py +344 -0
  328. mg_shell-0.1.0/mindgard_shell/engine/hooks_builtin.py +263 -0
  329. mg_shell-0.1.0/mindgard_shell/engine/jobs.py +89 -0
  330. mg_shell-0.1.0/mindgard_shell/engine/known_plugins.py +62 -0
  331. mg_shell-0.1.0/mindgard_shell/engine/lazy_cache.py +82 -0
  332. mg_shell-0.1.0/mindgard_shell/engine/lifecycle.py +277 -0
  333. mg_shell-0.1.0/mindgard_shell/engine/plugin_auth.py +107 -0
  334. mg_shell-0.1.0/mindgard_shell/engine/plugin_catalog.py +121 -0
  335. mg_shell-0.1.0/mindgard_shell/engine/plugin_installer.py +207 -0
  336. mg_shell-0.1.0/mindgard_shell/engine/plugin_loader.py +292 -0
  337. mg_shell-0.1.0/mindgard_shell/engine/plugin_wizard.py +139 -0
  338. mg_shell-0.1.0/mindgard_shell/engine/runner.py +422 -0
  339. mg_shell-0.1.0/mindgard_shell/engine/runner_bg.py +192 -0
  340. mg_shell-0.1.0/mindgard_shell/engine/streams.py +189 -0
  341. mg_shell-0.1.0/mindgard_shell/examples/README.md +70 -0
  342. mg_shell-0.1.0/mindgard_shell/examples/carriers/README.md +34 -0
  343. mg_shell-0.1.0/mindgard_shell/examples/carriers/digital-noise.wav +0 -0
  344. mg_shell-0.1.0/mindgard_shell/examples/carriers/low-drone.wav +0 -0
  345. mg_shell-0.1.0/mindgard_shell/examples/carriers/synthwave-ambient.wav +0 -0
  346. mg_shell-0.1.0/mindgard_shell/examples/compare-modes.macro +43 -0
  347. mg_shell-0.1.0/mindgard_shell/examples/full-security-audit.macro +54 -0
  348. mg_shell-0.1.0/mindgard_shell/examples/interactive-setup.macro +51 -0
  349. mg_shell-0.1.0/mindgard_shell/examples/mcp-config-everything.json +8 -0
  350. mg_shell-0.1.0/mindgard_shell/examples/mcp-config-filesystem.json +8 -0
  351. mg_shell-0.1.0/mindgard_shell/examples/mcp-inject-payloads.csv +27 -0
  352. mg_shell-0.1.0/mindgard_shell/examples/mcp-inject-test.macro +24 -0
  353. mg_shell-0.1.0/mindgard_shell/examples/mcp-scan-target.macro +30 -0
  354. mg_shell-0.1.0/mindgard_shell/examples/multi-target-sweep.macro +60 -0
  355. mg_shell-0.1.0/mindgard_shell/examples/nightly-ci.macro +33 -0
  356. mg_shell-0.1.0/mindgard_shell/examples/payloads.csv +7 -0
  357. mg_shell-0.1.0/mindgard_shell/examples/quick-test.macro +38 -0
  358. mg_shell-0.1.0/mindgard_shell/examples/recon-all.macro +39 -0
  359. mg_shell-0.1.0/mindgard_shell/examples/setup-openai-target.macro +38 -0
  360. mg_shell-0.1.0/mindgard_shell/hardware/__init__.py +56 -0
  361. mg_shell-0.1.0/mindgard_shell/hardware/bunny/__init__.py +54 -0
  362. mg_shell-0.1.0/mindgard_shell/hardware/bunny/compiler.py +315 -0
  363. mg_shell-0.1.0/mindgard_shell/hardware/bunny/device.py +149 -0
  364. mg_shell-0.1.0/mindgard_shell/hardware/bunny/files.py +251 -0
  365. mg_shell-0.1.0/mindgard_shell/hardware/bunny/serial_console.py +11 -0
  366. mg_shell-0.1.0/mindgard_shell/hardware/conversations.py +304 -0
  367. mg_shell-0.1.0/mindgard_shell/hardware/ducky/__init__.py +27 -0
  368. mg_shell-0.1.0/mindgard_shell/hardware/ducky/compiler.py +83 -0
  369. mg_shell-0.1.0/mindgard_shell/hardware/ducky/device.py +79 -0
  370. mg_shell-0.1.0/mindgard_shell/hardware/flipper/__init__.py +70 -0
  371. mg_shell-0.1.0/mindgard_shell/hardware/flipper/badusb.py +84 -0
  372. mg_shell-0.1.0/mindgard_shell/hardware/flipper/bluetooth.py +142 -0
  373. mg_shell-0.1.0/mindgard_shell/hardware/flipper/device.py +277 -0
  374. mg_shell-0.1.0/mindgard_shell/hardware/flipper/nfc.py +147 -0
  375. mg_shell-0.1.0/mindgard_shell/hardware/flipper/serial_console.py +87 -0
  376. mg_shell-0.1.0/mindgard_shell/hardware/flipper/subghz.py +139 -0
  377. mg_shell-0.1.0/mindgard_shell/hardware/generate.py +177 -0
  378. mg_shell-0.1.0/mindgard_shell/hardware/hak5/__init__.py +19 -0
  379. mg_shell-0.1.0/mindgard_shell/hardware/hak5/bunny_files.py +251 -0
  380. mg_shell-0.1.0/mindgard_shell/hardware/hak5/compiler_bunny.py +315 -0
  381. mg_shell-0.1.0/mindgard_shell/hardware/hak5/compiler_ducky.py +83 -0
  382. mg_shell-0.1.0/mindgard_shell/hardware/hak5/conversations.py +304 -0
  383. mg_shell-0.1.0/mindgard_shell/hardware/hak5/device.py +198 -0
  384. mg_shell-0.1.0/mindgard_shell/hardware/hak5/generate.py +178 -0
  385. mg_shell-0.1.0/mindgard_shell/hardware/hak5/payloads.py +577 -0
  386. mg_shell-0.1.0/mindgard_shell/hardware/hak5/serial_console.py +201 -0
  387. mg_shell-0.1.0/mindgard_shell/hardware/payloads.py +577 -0
  388. mg_shell-0.1.0/mindgard_shell/inject/__init__.py +43 -0
  389. mg_shell-0.1.0/mindgard_shell/inject/registry.py +195 -0
  390. mg_shell-0.1.0/mindgard_shell/inject/server.py +607 -0
  391. mg_shell-0.1.0/mindgard_shell/inject/tunnel.py +241 -0
  392. mg_shell-0.1.0/mindgard_shell/llm/__init__.py +64 -0
  393. mg_shell-0.1.0/mindgard_shell/llm/agent.py +210 -0
  394. mg_shell-0.1.0/mindgard_shell/llm/chat_history.py +69 -0
  395. mg_shell-0.1.0/mindgard_shell/llm/keys.py +497 -0
  396. mg_shell-0.1.0/mindgard_shell/llm/model_registry.py +462 -0
  397. mg_shell-0.1.0/mindgard_shell/llm/prompt_builder.py +352 -0
  398. mg_shell-0.1.0/mindgard_shell/llm/session_summary.py +133 -0
  399. mg_shell-0.1.0/mindgard_shell/macro/__init__.py +47 -0
  400. mg_shell-0.1.0/mindgard_shell/macro/models.py +103 -0
  401. mg_shell-0.1.0/mindgard_shell/macro/parser.py +107 -0
  402. mg_shell-0.1.0/mindgard_shell/macro/runner.py +632 -0
  403. mg_shell-0.1.0/mindgard_shell/macro/storage.py +132 -0
  404. mg_shell-0.1.0/mindgard_shell/macro/variables.py +294 -0
  405. mg_shell-0.1.0/mindgard_shell/macro/writer.py +346 -0
  406. mg_shell-0.1.0/mindgard_shell/mcp/__init__.py +1 -0
  407. mg_shell-0.1.0/mindgard_shell/mcp/bridge.py +289 -0
  408. mg_shell-0.1.0/mindgard_shell/mcp/config.py +158 -0
  409. mg_shell-0.1.0/mindgard_shell/mcp/inject.py +408 -0
  410. mg_shell-0.1.0/mindgard_shell/mcp/proxy.py +287 -0
  411. mg_shell-0.1.0/mindgard_shell/mcp/testing_server.py +453 -0
  412. mg_shell-0.1.0/mindgard_shell/notifications/__init__.py +133 -0
  413. mg_shell-0.1.0/mindgard_shell/notifications/center.py +296 -0
  414. mg_shell-0.1.0/mindgard_shell/plugin-registry.json +20 -0
  415. mg_shell-0.1.0/mindgard_shell/plugin.py +18 -0
  416. mg_shell-0.1.0/mindgard_shell/plugins/__init__.py +0 -0
  417. mg_shell-0.1.0/mindgard_shell/plugins/core/__init__.py +0 -0
  418. mg_shell-0.1.0/mindgard_shell/plugins/core/plugin.py +100 -0
  419. mg_shell-0.1.0/mindgard_shell/prompt/__init__.py +23 -0
  420. mg_shell-0.1.0/mindgard_shell/prompt/registry.py +357 -0
  421. mg_shell-0.1.0/mindgard_shell/state/__init__.py +1 -0
  422. mg_shell-0.1.0/mindgard_shell/state/aliases.py +110 -0
  423. mg_shell-0.1.0/mindgard_shell/state/audit.py +166 -0
  424. mg_shell-0.1.0/mindgard_shell/state/output_store.py +200 -0
  425. mg_shell-0.1.0/mindgard_shell/state/profile.py +988 -0
  426. mg_shell-0.1.0/mindgard_shell/state/session.py +336 -0
  427. mg_shell-0.1.0/mindgard_shell/state/settings.py +156 -0
  428. mg_shell-0.1.0/mindgard_shell/state/target_config.py +241 -0
  429. mg_shell-0.1.0/mindgard_shell/state/target_registry.py +321 -0
  430. mg_shell-0.1.0/mindgard_shell/state/task_manager.py +118 -0
  431. mg_shell-0.1.0/mindgard_shell/telemetry/__init__.py +18 -0
  432. mg_shell-0.1.0/mindgard_shell/telemetry/langfuse.py +224 -0
  433. mg_shell-0.1.0/mindgard_shell/ui/__init__.py +1 -0
  434. mg_shell-0.1.0/mindgard_shell/ui/a2a_watch.py +920 -0
  435. mg_shell-0.1.0/mindgard_shell/ui/a2a_watch_data.py +341 -0
  436. mg_shell-0.1.0/mindgard_shell/ui/banner.py +141 -0
  437. mg_shell-0.1.0/mindgard_shell/ui/completer.py +253 -0
  438. mg_shell-0.1.0/mindgard_shell/ui/dashboard.py +551 -0
  439. mg_shell-0.1.0/mindgard_shell/ui/dashboard_data.py +384 -0
  440. mg_shell-0.1.0/mindgard_shell/ui/output.py +201 -0
  441. mg_shell-0.1.0/mindgard_shell/ui/prompt.py +459 -0
  442. mg_shell-0.1.0/mindgard_shell/ui/theme.py +155 -0
  443. mg_shell-0.1.0/mindgard_shell/ui/themes/__init__.py +9 -0
  444. mg_shell-0.1.0/mindgard_shell/ui/themes/borland.py +50 -0
  445. mg_shell-0.1.0/mindgard_shell/ui/themes/halflife.py +50 -0
  446. mg_shell-0.1.0/mindgard_shell/ui/themes/matrix.py +50 -0
  447. mg_shell-0.1.0/mindgard_shell/ui/themes/mindgard.py +50 -0
  448. mg_shell-0.1.0/mindgard_shell/ui/themes/monokai.py +50 -0
  449. mg_shell-0.1.0/mindgard_shell/ui/themes/nord.py +50 -0
  450. mg_shell-0.1.0/mindgard_shell/ui/themes/vaporwave.py +50 -0
  451. mg_shell-0.1.0/mkdocs.yml +118 -0
  452. mg_shell-0.1.0/pyproject.toml +211 -0
  453. mg_shell-0.1.0/scripts/bump_version.py +77 -0
  454. mg_shell-0.1.0/tests/conftest.py +61 -0
  455. mg_shell-0.1.0/tests/core/__init__.py +0 -0
  456. mg_shell-0.1.0/tests/core/test_command.py +91 -0
  457. mg_shell-0.1.0/tests/core/test_exceptions.py +100 -0
  458. mg_shell-0.1.0/tests/core/test_plugin.py +23 -0
  459. mg_shell-0.1.0/tests/core/test_protocols.py +32 -0
  460. mg_shell-0.1.0/tests/core/test_target.py +53 -0
  461. mg_shell-0.1.0/tests/core/test_wrappers.py +64 -0
  462. mg_shell-0.1.0/tests/test_a2a.py +629 -0
  463. mg_shell-0.1.0/tests/test_a2a_discover.py +377 -0
  464. mg_shell-0.1.0/tests/test_a2a_honeypot.py +538 -0
  465. mg_shell-0.1.0/tests/test_a2a_watch.py +523 -0
  466. mg_shell-0.1.0/tests/test_audit.py +141 -0
  467. mg_shell-0.1.0/tests/test_banner.py +95 -0
  468. mg_shell-0.1.0/tests/test_barcode.py +421 -0
  469. mg_shell-0.1.0/tests/test_bunny_files.py +784 -0
  470. mg_shell-0.1.0/tests/test_chef.py +407 -0
  471. mg_shell-0.1.0/tests/test_cmd_auth.py +84 -0
  472. mg_shell-0.1.0/tests/test_cmd_info.py +246 -0
  473. mg_shell-0.1.0/tests/test_cmd_results.py +287 -0
  474. mg_shell-0.1.0/tests/test_cmd_shell.py +233 -0
  475. mg_shell-0.1.0/tests/test_cmd_target.py +119 -0
  476. mg_shell-0.1.0/tests/test_cmd_testing.py +184 -0
  477. mg_shell-0.1.0/tests/test_command_mode.py +396 -0
  478. mg_shell-0.1.0/tests/test_commands.py +311 -0
  479. mg_shell-0.1.0/tests/test_completer.py +243 -0
  480. mg_shell-0.1.0/tests/test_context_command.py +367 -0
  481. mg_shell-0.1.0/tests/test_copilot.py +454 -0
  482. mg_shell-0.1.0/tests/test_copilot_tools.py +747 -0
  483. mg_shell-0.1.0/tests/test_core_plugin.py +92 -0
  484. mg_shell-0.1.0/tests/test_dashboard.py +230 -0
  485. mg_shell-0.1.0/tests/test_discovery_migration.py +34 -0
  486. mg_shell-0.1.0/tests/test_dotenv.py +200 -0
  487. mg_shell-0.1.0/tests/test_embed.py +1878 -0
  488. mg_shell-0.1.0/tests/test_embed_audio.py +498 -0
  489. mg_shell-0.1.0/tests/test_embed_qr.py +234 -0
  490. mg_shell-0.1.0/tests/test_functional.py +869 -0
  491. mg_shell-0.1.0/tests/test_guide.py +367 -0
  492. mg_shell-0.1.0/tests/test_hak5.py +1100 -0
  493. mg_shell-0.1.0/tests/test_hooks.py +629 -0
  494. mg_shell-0.1.0/tests/test_hw_command.py +618 -0
  495. mg_shell-0.1.0/tests/test_inject.py +451 -0
  496. mg_shell-0.1.0/tests/test_inject_ngrok.py +389 -0
  497. mg_shell-0.1.0/tests/test_jobs.py +138 -0
  498. mg_shell-0.1.0/tests/test_known_plugins.py +31 -0
  499. mg_shell-0.1.0/tests/test_lazy_cache.py +94 -0
  500. mg_shell-0.1.0/tests/test_llm_keys.py +706 -0
  501. mg_shell-0.1.0/tests/test_macro_engine.py +916 -0
  502. mg_shell-0.1.0/tests/test_macro_writer.py +512 -0
  503. mg_shell-0.1.0/tests/test_mcp.py +755 -0
  504. mg_shell-0.1.0/tests/test_mcp_inject.py +517 -0
  505. mg_shell-0.1.0/tests/test_model_registry.py +678 -0
  506. mg_shell-0.1.0/tests/test_netinfo.py +579 -0
  507. mg_shell-0.1.0/tests/test_nl_agent.py +252 -0
  508. mg_shell-0.1.0/tests/test_no_mindgard_imports.py +49 -0
  509. mg_shell-0.1.0/tests/test_notifications.py +736 -0
  510. mg_shell-0.1.0/tests/test_output.py +182 -0
  511. mg_shell-0.1.0/tests/test_output_store.py +155 -0
  512. mg_shell-0.1.0/tests/test_plan.py +206 -0
  513. mg_shell-0.1.0/tests/test_plugin.py +126 -0
  514. mg_shell-0.1.0/tests/test_plugin_auth.py +137 -0
  515. mg_shell-0.1.0/tests/test_plugin_catalog.py +235 -0
  516. mg_shell-0.1.0/tests/test_plugin_command.py +544 -0
  517. mg_shell-0.1.0/tests/test_plugin_installer.py +202 -0
  518. mg_shell-0.1.0/tests/test_plugin_integration.py +22 -0
  519. mg_shell-0.1.0/tests/test_plugin_loader.py +338 -0
  520. mg_shell-0.1.0/tests/test_plugin_wizard.py +51 -0
  521. mg_shell-0.1.0/tests/test_profile.py +441 -0
  522. mg_shell-0.1.0/tests/test_prompt.py +304 -0
  523. mg_shell-0.1.0/tests/test_prompt_registry.py +503 -0
  524. mg_shell-0.1.0/tests/test_rec.py +476 -0
  525. mg_shell-0.1.0/tests/test_repl.py +124 -0
  526. mg_shell-0.1.0/tests/test_security.py +392 -0
  527. mg_shell-0.1.0/tests/test_session.py +279 -0
  528. mg_shell-0.1.0/tests/test_shell.py +252 -0
  529. mg_shell-0.1.0/tests/test_spinner.py +155 -0
  530. mg_shell-0.1.0/tests/test_streams.py +241 -0
  531. mg_shell-0.1.0/tests/test_target_registry.py +622 -0
  532. mg_shell-0.1.0/tests/test_telemetry.py +530 -0
  533. mg_shell-0.1.0/tests/test_theme.py +103 -0
@@ -0,0 +1,37 @@
1
+ # Mindgard Shell — default environment variables
2
+ # Copy this file to ~/.mindgard/.env (or ./.env) and fill in your values.
3
+ # Variables are only set if not already present in the environment.
4
+
5
+ # ── LLM API Keys ─────────────────────────────────────────────────
6
+ # Used by the copilot, ask, macro writer, and other LLM-powered features.
7
+ # You can also set these via 'model keys set <provider> <key>' inside the shell.
8
+
9
+ OPENAI_API_KEY=
10
+ ANTHROPIC_API_KEY=
11
+ GOOGLE_API_KEY=
12
+
13
+ # ── Langfuse — workflow integrations ─────────────────────────────
14
+ # Used by mindgard-cli workflows (e.g. auto_vuln_hunter).
15
+
16
+ LANGFUSE_SECRET_KEY=
17
+ LANGFUSE_PUBLIC_KEY=
18
+ LANGFUSE_HOST=https://cloud.langfuse.com
19
+
20
+ # ── Langfuse — shell agentic telemetry ──────────────────────────
21
+ # Separate keys for tracing copilot, ask, plan, macro, MCP, and NL
22
+ # query agents. Leave blank to disable telemetry (opt-in).
23
+
24
+ MINDGARD_SHELL_LANGFUSE_SECRET_KEY=
25
+ MINDGARD_SHELL_LANGFUSE_PUBLIC_KEY=
26
+ MINDGARD_SHELL_LANGFUSE_HOST=https://cloud.langfuse.com
27
+
28
+ # ── Mindgard API ─────────────────────────────────────────────────
29
+ # Override the default API base URL (rarely needed).
30
+
31
+ # MINDGARD_API_BASE=https://api.sandbox.mindgard.ai/api/v1
32
+
33
+ # ── Local LLM ────────────────────────────────────────────────────
34
+ # If you use Ollama, LM Studio, or another local provider.
35
+
36
+ # OLLAMA_HOST=http://localhost:11434
37
+ # LM_STUDIO_HOST=http://localhost:1234
mg_shell-0.1.0/.flake8 ADDED
@@ -0,0 +1,13 @@
1
+ [flake8]
2
+ max-line-length = 120
3
+ extend-ignore =
4
+ # E203: whitespace before ':' (conflicts with black)
5
+ E203,
6
+ # W503: line break before binary operator (conflicts with black)
7
+ W503,
8
+ # E501: line too long (black handles this)
9
+ E501,
10
+ per-file-ignores =
11
+ # F401: imported but unused (re-export shims, __init__ files)
12
+ mindgard_shell/__init__.py:F401
13
+ tests/*:F811
@@ -0,0 +1,196 @@
1
+ name: Auto Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ id-token: write
10
+
11
+ jobs:
12
+ detect:
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ shell_version: ${{ steps.check.outputs.shell_version }}
16
+ cloud_version: ${{ steps.check.outputs.cloud_version }}
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Detect changed packages
23
+ id: check
24
+ run: |
25
+ check_package() {
26
+ local pkg="$1"; shift
27
+ local latest_tag
28
+ latest_tag=$(git tag -l "${pkg}/v*" --sort=-v:refname | head -1)
29
+
30
+ if [ -z "$latest_tag" ]; then
31
+ echo "${pkg}: no prior tag → v0.1.0"
32
+ echo "${pkg}_version=0.1.0" >> "$GITHUB_OUTPUT"
33
+ return
34
+ fi
35
+
36
+ # Check if any of the listed paths changed since last tag
37
+ if git diff --quiet "${latest_tag}"..HEAD -- "$@"; then
38
+ echo "${pkg}: no changes since ${latest_tag}"
39
+ return
40
+ fi
41
+
42
+ local version="${latest_tag#${pkg}/v}"
43
+ local major minor patch
44
+ IFS='.' read -r major minor patch <<< "$version"
45
+ patch=$((patch + 1))
46
+ local next="${major}.${minor}.${patch}"
47
+ echo "${pkg}: changes since ${latest_tag} → v${next}"
48
+ echo "${pkg}_version=${next}" >> "$GITHUB_OUTPUT"
49
+ }
50
+
51
+ check_package "shell" mindgard_shell/ pyproject.toml
52
+ check_package "cloud" mindgard-cloud/
53
+
54
+ release-shell:
55
+ needs: detect
56
+ if: needs.detect.outputs.shell_version
57
+ runs-on: ubuntu-latest
58
+ environment: testpypi
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+ with:
62
+ fetch-depth: 0
63
+ - uses: astral-sh/setup-uv@v5
64
+ - uses: arduino/setup-task@v2
65
+ with:
66
+ version: 3.x
67
+
68
+ - name: Bump version
69
+ run: |
70
+ VERSION="${{ needs.detect.outputs.shell_version }}"
71
+ sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
72
+ sed -i "s/__version__ = \".*\"/__version__ = \"${VERSION}\"/" mindgard_shell/__init__.py
73
+
74
+ - name: Install and test
75
+ run: task install-dev && task test-shell
76
+
77
+ - name: Build
78
+ run: task build-shell
79
+
80
+ - name: Publish to TestPyPI
81
+ run: task test-publish-shell
82
+
83
+ publish-shell:
84
+ needs: [detect, release-shell]
85
+ runs-on: ubuntu-latest
86
+ environment: pypi
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+ with:
90
+ fetch-depth: 0
91
+ - uses: astral-sh/setup-uv@v5
92
+ - uses: arduino/setup-task@v2
93
+ with:
94
+ version: 3.x
95
+
96
+ - name: Bump version
97
+ run: |
98
+ VERSION="${{ needs.detect.outputs.shell_version }}"
99
+ sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
100
+ sed -i "s/__version__ = \".*\"/__version__ = \"${VERSION}\"/" mindgard_shell/__init__.py
101
+
102
+ - name: Build
103
+ run: task build-shell
104
+
105
+ - name: Publish to PyPI
106
+ run: task publish-shell
107
+
108
+ - name: Create GitHub Release
109
+ env:
110
+ GH_TOKEN: ${{ github.token }}
111
+ run: |
112
+ VERSION="${{ needs.detect.outputs.shell_version }}"
113
+ TAG="shell/v${VERSION}"
114
+
115
+ git config user.name "github-actions[bot]"
116
+ git config user.email "github-actions[bot]@users.noreply.github.com"
117
+ git add -A
118
+ git commit -m "chore(shell): bump version to ${VERSION} [skip ci]" || true
119
+ git push origin main || true
120
+
121
+ gh release create "$TAG" dist/shell/* \
122
+ --target main \
123
+ --title "mg-shell v${VERSION}" \
124
+ --generate-notes
125
+
126
+ release-cloud:
127
+ needs: [detect, publish-shell]
128
+ if: needs.detect.outputs.cloud_version
129
+ runs-on: ubuntu-latest
130
+ environment: testpypi
131
+ steps:
132
+ - uses: actions/checkout@v4
133
+ with:
134
+ fetch-depth: 0
135
+ - uses: astral-sh/setup-uv@v5
136
+ - uses: arduino/setup-task@v2
137
+ with:
138
+ version: 3.x
139
+
140
+ - name: Bump version
141
+ run: |
142
+ VERSION="${{ needs.detect.outputs.cloud_version }}"
143
+ sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" mindgard-cloud/pyproject.toml
144
+ sed -i "s/VERSION: str = \".*\"/VERSION: str = \"${VERSION}\"/" mindgard-cloud/mindgard_cloud/lib/constants.py
145
+
146
+ - name: Install and test
147
+ run: task install-dev && task test-cloud
148
+
149
+ - name: Build
150
+ run: task build-cloud
151
+
152
+ - name: Publish to TestPyPI
153
+ run: task test-publish-cloud
154
+
155
+ publish-cloud:
156
+ needs: [detect, release-cloud]
157
+ runs-on: ubuntu-latest
158
+ environment: pypi
159
+ steps:
160
+ - uses: actions/checkout@v4
161
+ with:
162
+ fetch-depth: 0
163
+ - uses: astral-sh/setup-uv@v5
164
+ - uses: arduino/setup-task@v2
165
+ with:
166
+ version: 3.x
167
+
168
+ - name: Bump version
169
+ run: |
170
+ VERSION="${{ needs.detect.outputs.cloud_version }}"
171
+ sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" mindgard-cloud/pyproject.toml
172
+ sed -i "s/VERSION: str = \".*\"/VERSION: str = \"${VERSION}\"/" mindgard-cloud/mindgard_cloud/lib/constants.py
173
+
174
+ - name: Build
175
+ run: task build-cloud
176
+
177
+ - name: Publish to PyPI
178
+ run: task publish-cloud
179
+
180
+ - name: Create GitHub Release
181
+ env:
182
+ GH_TOKEN: ${{ github.token }}
183
+ run: |
184
+ VERSION="${{ needs.detect.outputs.cloud_version }}"
185
+ TAG="cloud/v${VERSION}"
186
+
187
+ git config user.name "github-actions[bot]"
188
+ git config user.email "github-actions[bot]@users.noreply.github.com"
189
+ git add -A
190
+ git commit -m "chore(cloud): bump version to ${VERSION} [skip ci]" || true
191
+ git push origin main || true
192
+
193
+ gh release create "$TAG" dist/mindgard-cloud/* \
194
+ --target main \
195
+ --title "mg-cloud v${VERSION}" \
196
+ --generate-notes
@@ -0,0 +1,40 @@
1
+ name: Publish Plugin
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ plugin:
7
+ description: 'Plugin directory to publish (e.g., mindgard-cloud)'
8
+ required: true
9
+ type: string
10
+ version:
11
+ description: 'Version tag (e.g., v0.2.0)'
12
+ required: true
13
+ type: string
14
+
15
+ jobs:
16
+ publish:
17
+ name: Build and publish ${{ inputs.plugin }}
18
+ runs-on: ubuntu-latest
19
+ permissions:
20
+ contents: write
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: astral-sh/setup-uv@v5
24
+ - uses: arduino/setup-task@v2
25
+ with:
26
+ version: 3.x
27
+
28
+ - name: Install and test
29
+ run: task install-dev && task test-shell
30
+
31
+ - name: Build plugin
32
+ run: task build-plugin PLUGIN_DIR=${{ inputs.plugin }}
33
+
34
+ - name: Create release and upload .whl
35
+ uses: softprops/action-gh-release@v2
36
+ with:
37
+ tag_name: ${{ inputs.plugin }}/${{ inputs.version }}
38
+ name: "${{ inputs.plugin }} ${{ inputs.version }}"
39
+ files: dist/${{ inputs.plugin }}/*
40
+ draft: false
@@ -0,0 +1,71 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0
18
+
19
+ - uses: astral-sh/setup-uv@v5
20
+ - uses: arduino/setup-task@v2
21
+ with:
22
+ version: 3.x
23
+
24
+ - name: Install dependencies
25
+ run: task install-dev
26
+
27
+ - name: Run tests
28
+ run: task test-shell
29
+
30
+ - name: Extract version from tag
31
+ id: version
32
+ run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
33
+
34
+ - name: Extract changelog for this version
35
+ id: changelog
36
+ run: |
37
+ # Extract the section for this version from CHANGELOG.md
38
+ .venv/bin/python -c "
39
+ import re, sys
40
+ version = '${{ steps.version.outputs.version }}'
41
+ content = open('CHANGELOG.md').read()
42
+ # Match from ## [version] to the next ## [ or end of file
43
+ pattern = rf'## \[{re.escape(version)}\].*?\n(.*?)(?=\n## \[|\Z)'
44
+ match = re.search(pattern, content, re.DOTALL)
45
+ if match:
46
+ notes = match.group(1).strip()
47
+ # Write to file for the release body
48
+ with open('release_notes.md', 'w') as f:
49
+ f.write(notes)
50
+ print(f'Extracted {len(notes)} chars of release notes')
51
+ else:
52
+ with open('release_notes.md', 'w') as f:
53
+ f.write(f'Release v{version}')
54
+ print('No changelog entry found, using default')
55
+ "
56
+
57
+ - name: Create GitHub Release
58
+ uses: softprops/action-gh-release@v2
59
+ with:
60
+ name: "mindgard-shell v${{ steps.version.outputs.version }}"
61
+ body_path: release_notes.md
62
+ draft: false
63
+ prerelease: ${{ contains(steps.version.outputs.version, '-') }}
64
+
65
+ - name: Build package
66
+ run: uv pip install build && .venv/bin/python -m build
67
+
68
+ - name: Upload artifacts to release
69
+ uses: softprops/action-gh-release@v2
70
+ with:
71
+ files: dist/*
@@ -0,0 +1,50 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main, "feat/**"]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ shell-only:
11
+ name: Shell (no cloud plugin)
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: astral-sh/setup-uv@v5
16
+ - uses: arduino/setup-task@v2
17
+ with:
18
+ version: 3.x
19
+ - name: Install deps
20
+ run: task install-dev
21
+ - name: Run shell tests
22
+ run: task test-shell
23
+
24
+ shell-with-cloud:
25
+ name: Shell + Cloud plugin
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: astral-sh/setup-uv@v5
30
+ - uses: arduino/setup-task@v2
31
+ with:
32
+ version: 3.x
33
+ - name: Install deps
34
+ run: task install-dev && task install-cloud
35
+ - name: Run shell tests
36
+ run: task test-shell
37
+
38
+ cloud-plugin:
39
+ name: Cloud plugin tests
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - uses: astral-sh/setup-uv@v5
44
+ - uses: arduino/setup-task@v2
45
+ with:
46
+ version: 3.x
47
+ - name: Install deps
48
+ run: task install-dev && task install-cloud
49
+ - name: Run cloud tests
50
+ run: task test-cloud
@@ -0,0 +1,52 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ dist/
8
+ build/
9
+ .eggs/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+ .anamorpher-venv/
16
+ .chepy-venv/
17
+
18
+ # Embed batch output
19
+ embed-batch-*/
20
+
21
+ # IDE
22
+ .idea/
23
+ .vscode/
24
+ *.swp
25
+ *.swo
26
+ *~
27
+
28
+ # Testing
29
+ .pytest_cache/
30
+ .coverage
31
+ htmlcov/
32
+ .tox/
33
+
34
+ # MkDocs
35
+ site/
36
+
37
+ # Exported data files
38
+ mindgard-*.json
39
+
40
+ # Environment (secrets)
41
+ .env
42
+
43
+ # OS
44
+ .DS_Store
45
+ Thumbs.db
46
+ trace.jsonl
47
+ mindgard-profile.mgprofile
48
+ .chepy-venv/pyvenv.cfg
49
+ .notes.md
50
+
51
+ # Superpowers (AI planning artifacts — never commit)
52
+ docs/superpowers/