sapguimcp 1.0.1__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 (287) hide show
  1. sapguimcp-1.0.1/.claude/skills/readme-demo/SKILL.md +248 -0
  2. sapguimcp-1.0.1/.env.example +25 -0
  3. sapguimcp-1.0.1/.gitattributes +16 -0
  4. sapguimcp-1.0.1/.github/dependabot.yml +27 -0
  5. sapguimcp-1.0.1/.github/workflows/build_executable.yml +166 -0
  6. sapguimcp-1.0.1/.github/workflows/coverage.yml +31 -0
  7. sapguimcp-1.0.1/.github/workflows/dependabot_automerge.yml +18 -0
  8. sapguimcp-1.0.1/.github/workflows/dev_test.yml +23 -0
  9. sapguimcp-1.0.1/.github/workflows/formatting.yml +27 -0
  10. sapguimcp-1.0.1/.github/workflows/linting.yml +25 -0
  11. sapguimcp-1.0.1/.github/workflows/no_byte_order_mark.yml +15 -0
  12. sapguimcp-1.0.1/.github/workflows/packaging_test.yml +19 -0
  13. sapguimcp-1.0.1/.github/workflows/prettier.yml +26 -0
  14. sapguimcp-1.0.1/.github/workflows/python-publish.yml +62 -0
  15. sapguimcp-1.0.1/.github/workflows/pythonlint.yml +34 -0
  16. sapguimcp-1.0.1/.github/workflows/spell_check.yml +27 -0
  17. sapguimcp-1.0.1/.github/workflows/unittests.yml +38 -0
  18. sapguimcp-1.0.1/.gitignore +140 -0
  19. sapguimcp-1.0.1/.gitmodules +6 -0
  20. sapguimcp-1.0.1/.prettierrc +9 -0
  21. sapguimcp-1.0.1/ARCHITECTURE.md +298 -0
  22. sapguimcp-1.0.1/CLAUDE.md +80 -0
  23. sapguimcp-1.0.1/CONTRIBUTING.md +263 -0
  24. sapguimcp-1.0.1/LICENSE +21 -0
  25. sapguimcp-1.0.1/PKG-INFO +520 -0
  26. sapguimcp-1.0.1/README.md +487 -0
  27. sapguimcp-1.0.1/docs/SAP_TEST_PREREQUISITES.md +136 -0
  28. sapguimcp-1.0.1/docs/bulk-operations-performance.md +133 -0
  29. sapguimcp-1.0.1/docs/design/sap-quick-report-design.md +421 -0
  30. sapguimcp-1.0.1/docs/design/sap-quick-report-implementation-plan.md +1166 -0
  31. sapguimcp-1.0.1/docs/plans/2024-12-19-utilities-consulting-ai-tools-design.md +396 -0
  32. sapguimcp-1.0.1/docs/plans/2026-01-02-js-extraction-design.md +109 -0
  33. sapguimcp-1.0.1/docs/plans/2026-01-02-pydantic-tool-results-design.md +445 -0
  34. sapguimcp-1.0.1/docs/plans/2026-01-02-sap-fill-form-design.md +184 -0
  35. sapguimcp-1.0.1/docs/plans/2026-01-03-github-feedback-issues-design.md +109 -0
  36. sapguimcp-1.0.1/docs/plans/2026-01-03-intent-logging-design.md +204 -0
  37. sapguimcp-1.0.1/docs/plans/2026-01-04-dropdown-support-design.md +148 -0
  38. sapguimcp-1.0.1/docs/plans/2026-01-04-popup-handling-design.md +107 -0
  39. sapguimcp-1.0.1/docs/plans/2026-01-04-workflow-learning-design.md +374 -0
  40. sapguimcp-1.0.1/docs/plans/2026-01-05-popup-semantics-design.md +108 -0
  41. sapguimcp-1.0.1/docs/plans/2026-01-05-tool-capabilities-discovery-design.md +114 -0
  42. sapguimcp-1.0.1/docs/plans/2026-01-08-se11-lookup-tool-design.md +167 -0
  43. sapguimcp-1.0.1/docs/plans/2026-01-08-se16-data-browser-design.md +206 -0
  44. sapguimcp-1.0.1/docs/plans/2026-01-09-typed-test-helpers-design.md +136 -0
  45. sapguimcp-1.0.1/docs/plans/2026-01-09-typed-test-helpers.md +1124 -0
  46. sapguimcp-1.0.1/docs/plans/2026-01-12-fm-class-catalog-design.md +176 -0
  47. sapguimcp-1.0.1/docs/plans/2026-01-14-multi-session-implementation.md +1493 -0
  48. sapguimcp-1.0.1/docs/plans/2026-01-14-multi-session-support-design.md +319 -0
  49. sapguimcp-1.0.1/docs/plans/2026-01-21-agent-session-binding-design.md +152 -0
  50. sapguimcp-1.0.1/docs/plans/2026-01-21-agent-session-binding-impl.md +1177 -0
  51. sapguimcp-1.0.1/docs/plans/2026-01-23-abapgit-api-pull-design.md +231 -0
  52. sapguimcp-1.0.1/docs/plans/2026-01-27-mcp-prompts-design.md +85 -0
  53. sapguimcp-1.0.1/docs/plans/2026-02-13-logging-improvements-design.md +103 -0
  54. sapguimcp-1.0.1/docs/plans/2026-02-13-logging-improvements-plan.md +1002 -0
  55. sapguimcp-1.0.1/docs/plans/2026-02-13-onboarding-prompts-design.md +142 -0
  56. sapguimcp-1.0.1/docs/plans/2026-02-13-onboarding-prompts-plan.md +828 -0
  57. sapguimcp-1.0.1/docs/plans/2026-02-18-exe-bundling-design.md +174 -0
  58. sapguimcp-1.0.1/docs/plans/2026-02-18-exe-bundling-plan.md +462 -0
  59. sapguimcp-1.0.1/docs/plans/2026-02-18-sap-identity-log-correlation-design.md +95 -0
  60. sapguimcp-1.0.1/docs/plans/2026-02-18-sap-identity-log-correlation-plan.md +579 -0
  61. sapguimcp-1.0.1/docs/plans/2026-02-19-default-browser-mode-connect-design.md +26 -0
  62. sapguimcp-1.0.1/docs/plans/2026-02-19-pat-validation-design.md +95 -0
  63. sapguimcp-1.0.1/docs/plans/2026-02-19-pat-validation-plan.md +451 -0
  64. sapguimcp-1.0.1/docs/plans/2026-02-20-readme-env-vars-fix-design.md +85 -0
  65. sapguimcp-1.0.1/docs/plans/2026-02-20-readme-env-vars-fix-plan.md +429 -0
  66. sapguimcp-1.0.1/docs/plans/2026-02-20-se38-edit-tool-design.md +111 -0
  67. sapguimcp-1.0.1/docs/plans/2026-02-20-se38-edit-tool-plan.md +693 -0
  68. sapguimcp-1.0.1/docs/plans/2026-02-22-general-purpose-tools-design.md +422 -0
  69. sapguimcp-1.0.1/docs/plans/2026-02-22-se09-transport-tool-plan.md +1326 -0
  70. sapguimcp-1.0.1/docs/plans/2026-02-22-slg1-tool-plan.md +1330 -0
  71. sapguimcp-1.0.1/docs/plans/2026-02-22-sm30-tool-plan.md +1612 -0
  72. sapguimcp-1.0.1/docs/plans/2026-02-22-sm37-tool-plan.md +1646 -0
  73. sapguimcp-1.0.1/docs/plans/2026-02-22-st22-tool-plan.md +1786 -0
  74. sapguimcp-1.0.1/docs/plans/2026-02-24-sm30-finish-and-spro-search-plan.md +625 -0
  75. sapguimcp-1.0.1/docs/plans/2026-02-24-sm30-spro-search-design.md +112 -0
  76. sapguimcp-1.0.1/docs/plans/2026-02-26-abapgit-list-repos-design.md +63 -0
  77. sapguimcp-1.0.1/docs/plans/2026-02-26-abapgit-list-repos-plan.md +573 -0
  78. sapguimcp-1.0.1/docs/plans/2026-03-02-remove-sampling-design.md +73 -0
  79. sapguimcp-1.0.1/docs/plans/2026-03-02-remove-sampling-plan.md +372 -0
  80. sapguimcp-1.0.1/docs/plans/2026-03-03-abapgit-pull-status-bar-fix-design.md +52 -0
  81. sapguimcp-1.0.1/docs/plans/2026-03-03-abapgit-pull-status-bar-fix-plan.md +348 -0
  82. sapguimcp-1.0.1/docs/plans/2026-03-04-ui-backend-abstraction-design.md +259 -0
  83. sapguimcp-1.0.1/docs/plans/2026-03-04-ui-backend-abstraction-plan.md +1504 -0
  84. sapguimcp-1.0.1/docs/plans/2026-03-11-stateless-selection-screens-design.md +502 -0
  85. sapguimcp-1.0.1/docs/plans/2026-03-11-stateless-selection-screens-plan.md +1634 -0
  86. sapguimcp-1.0.1/docs/plans/PLAN_TRANSACTION_CATALOG.md +267 -0
  87. sapguimcp-1.0.1/docs/readme-demo.gif +0 -0
  88. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-12-protocol-cleanup-plan.md +878 -0
  89. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-14-pysapgui-library.md +3895 -0
  90. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-15-desktop-backend-phase1.md +1285 -0
  91. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-16-desktop-tools-remaining.md +293 -0
  92. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-17-desktop-multi-session.md +279 -0
  93. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-18-readme-desktop-backend.md +363 -0
  94. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-20-pysapgui-open-source-readiness.md +1600 -0
  95. sapguimcp-1.0.1/docs/superpowers/plans/2026-03-24-reduce-local-imports.md +395 -0
  96. sapguimcp-1.0.1/docs/superpowers/plans/2026-04-04-popup-rework-active-window.md +886 -0
  97. sapguimcp-1.0.1/docs/superpowers/plans/2026-04-05-full-depth-element-info.md +776 -0
  98. sapguimcp-1.0.1/docs/superpowers/plans/2026-04-07-sap-fill-form-desktop-perf.md +1070 -0
  99. sapguimcp-1.0.1/docs/superpowers/plans/2026-07-07-breakpoint-confirmation-elicitation.md +497 -0
  100. sapguimcp-1.0.1/docs/superpowers/plans/2026-10-02-se16-strict-filter-fields.md +1014 -0
  101. sapguimcp-1.0.1/docs/superpowers/plans/2026-10-03-issue-879-retry-partial-progress-design.md +53 -0
  102. sapguimcp-1.0.1/docs/superpowers/plans/2026-10-06-readme-demo.md +1237 -0
  103. sapguimcp-1.0.1/docs/superpowers/plans/2026-11-10-session-language.md +611 -0
  104. sapguimcp-1.0.1/docs/superpowers/plans/2026-11-11-language-packs-core.md +2893 -0
  105. sapguimcp-1.0.1/docs/superpowers/plans/2026-11-11-language-packs-guards.md +2350 -0
  106. sapguimcp-1.0.1/docs/superpowers/plans/2026-11-11-language-packs-migration.md +783 -0
  107. sapguimcp-1.0.1/docs/superpowers/plans/2026-11-11-language-packs-sources.md +1688 -0
  108. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-12-protocol-cleanup-design.md +146 -0
  109. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-13-backend-encapsulation-design.md +271 -0
  110. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-14-pysapgui-library-design.md +545 -0
  111. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-14-sapgui-login-fixture-design.md +204 -0
  112. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-15-desktop-backend-adapter-design.md +295 -0
  113. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-16-com-evaluate-tool-design.md +131 -0
  114. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-17-desktop-multi-session-design.md +126 -0
  115. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-18-readme-desktop-backend-design.md +106 -0
  116. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-20-pysapgui-open-source-readiness-design.md +186 -0
  117. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-24-architecture-docs-design.md +29 -0
  118. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-24-reduce-local-imports-design.md +124 -0
  119. sapguimcp-1.0.1/docs/superpowers/specs/2026-03-24-test-gating-design.md +47 -0
  120. sapguimcp-1.0.1/docs/superpowers/specs/2026-04-04-popup-rework-active-window-design.md +262 -0
  121. sapguimcp-1.0.1/docs/superpowers/specs/2026-04-05-full-depth-element-info-design.md +206 -0
  122. sapguimcp-1.0.1/docs/superpowers/specs/2026-04-07-sap-fill-form-desktop-perf-design.md +302 -0
  123. sapguimcp-1.0.1/docs/superpowers/specs/2026-04-30-breakpoint-tool-design.md +333 -0
  124. sapguimcp-1.0.1/docs/superpowers/specs/2026-05-20-sap-run-script-design.md +291 -0
  125. sapguimcp-1.0.1/docs/superpowers/specs/2026-07-07-breakpoint-confirmation-elicitation-design.md +188 -0
  126. sapguimcp-1.0.1/docs/superpowers/specs/2026-10-02-se16-strict-filter-fields-design.md +145 -0
  127. sapguimcp-1.0.1/docs/superpowers/specs/2026-10-02-statusbar-message-fields-design.md +58 -0
  128. sapguimcp-1.0.1/docs/superpowers/specs/2026-10-06-readme-demo-design.md +260 -0
  129. sapguimcp-1.0.1/docs/superpowers/specs/2026-11-10-language-packs-design.md +561 -0
  130. sapguimcp-1.0.1/docs/superpowers/specs/2026-11-17-desktop-webgui-repo-split-design.md +192 -0
  131. sapguimcp-1.0.1/domain-specific-terms.txt +93 -0
  132. sapguimcp-1.0.1/package-lock.json +29 -0
  133. sapguimcp-1.0.1/package.json +12 -0
  134. sapguimcp-1.0.1/pyproject.toml +294 -0
  135. sapguimcp-1.0.1/scripts/README.md +121 -0
  136. sapguimcp-1.0.1/scripts/add_inline_results.py +215 -0
  137. sapguimcp-1.0.1/scripts/consolidate_catalog.py +139 -0
  138. sapguimcp-1.0.1/scripts/explore_issue_717.py +292 -0
  139. sapguimcp-1.0.1/scripts/harvest_lang_texts.py +378 -0
  140. sapguimcp-1.0.1/scripts/probe_dcs_full_enum.py +209 -0
  141. sapguimcp-1.0.1/scripts/probe_tree_context_menu.py +377 -0
  142. sapguimcp-1.0.1/scripts/render_readme_demo.py +6 -0
  143. sapguimcp-1.0.1/scripts/smoke_test_exe.py +128 -0
  144. sapguimcp-1.0.1/scripts/validate_pr_629.py +453 -0
  145. sapguimcp-1.0.1/src/_sapguimcp_version.py +1 -0
  146. sapguimcp-1.0.1/src/sapguimcp/__init__.py +38 -0
  147. sapguimcp-1.0.1/src/sapguimcp/backend/__init__.py +21 -0
  148. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/__init__.py +2714 -0
  149. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_abap_editor.py +226 -0
  150. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_com_thread.py +972 -0
  151. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_element_finder.py +402 -0
  152. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_key_mapping.py +43 -0
  153. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_landscape.py +49 -0
  154. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_session_registry.py +297 -0
  155. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_snapshot_render.py +86 -0
  156. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_tree_helpers.py +321 -0
  157. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/_truncation.py +55 -0
  158. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/models/__init__.py +0 -0
  159. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/models/com_results.py +114 -0
  160. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/models/script_results.py +44 -0
  161. sapguimcp-1.0.1/src/sapguimcp/backend/desktop/types.py +12 -0
  162. sapguimcp-1.0.1/src/sapguimcp/backend/manager.py +160 -0
  163. sapguimcp-1.0.1/src/sapguimcp/catalog/__init__.py +78 -0
  164. sapguimcp-1.0.1/src/sapguimcp/catalog/loader.py +114 -0
  165. sapguimcp-1.0.1/src/sapguimcp/catalog/models.py +528 -0
  166. sapguimcp-1.0.1/src/sapguimcp/catalog/scraper.py +440 -0
  167. sapguimcp-1.0.1/src/sapguimcp/catalog/search.py +218 -0
  168. sapguimcp-1.0.1/src/sapguimcp/classcatalog/__init__.py +17 -0
  169. sapguimcp-1.0.1/src/sapguimcp/classcatalog/loader.py +66 -0
  170. sapguimcp-1.0.1/src/sapguimcp/classcatalog/models.py +36 -0
  171. sapguimcp-1.0.1/src/sapguimcp/classcatalog/search.py +83 -0
  172. sapguimcp-1.0.1/src/sapguimcp/data/__init__.py +1 -0
  173. sapguimcp-1.0.1/src/sapguimcp/data/classes.json +20 -0
  174. sapguimcp-1.0.1/src/sapguimcp/data/function_modules.json +27152 -0
  175. sapguimcp-1.0.1/src/sapguimcp/data/sap_field_registry.json +98 -0
  176. sapguimcp-1.0.1/src/sapguimcp/data/sap_knowledge.md +322 -0
  177. sapguimcp-1.0.1/src/sapguimcp/data/tables.json +4311 -0
  178. sapguimcp-1.0.1/src/sapguimcp/data/transactions.json +58824 -0
  179. sapguimcp-1.0.1/src/sapguimcp/demo/__init__.py +0 -0
  180. sapguimcp-1.0.1/src/sapguimcp/demo/render_readme_demo.py +510 -0
  181. sapguimcp-1.0.1/src/sapguimcp/fmcatalog/__init__.py +17 -0
  182. sapguimcp-1.0.1/src/sapguimcp/fmcatalog/loader.py +66 -0
  183. sapguimcp-1.0.1/src/sapguimcp/fmcatalog/models.py +80 -0
  184. sapguimcp-1.0.1/src/sapguimcp/fmcatalog/search.py +108 -0
  185. sapguimcp-1.0.1/src/sapguimcp/lang/ADDING_A_LANGUAGE.md +105 -0
  186. sapguimcp-1.0.1/src/sapguimcp/lang/__init__.py +175 -0
  187. sapguimcp-1.0.1/src/sapguimcp/lang/backends.py +175 -0
  188. sapguimcp-1.0.1/src/sapguimcp/lang/de.py +250 -0
  189. sapguimcp-1.0.1/src/sapguimcp/lang/en.py +241 -0
  190. sapguimcp-1.0.1/src/sapguimcp/lang/invariant.py +45 -0
  191. sapguimcp-1.0.1/src/sapguimcp/lang/it.py +268 -0
  192. sapguimcp-1.0.1/src/sapguimcp/lang/schema.py +489 -0
  193. sapguimcp-1.0.1/src/sapguimcp/lang/sources.py +244 -0
  194. sapguimcp-1.0.1/src/sapguimcp/lang/text.py +295 -0
  195. sapguimcp-1.0.1/src/sapguimcp/logging_config.py +382 -0
  196. sapguimcp-1.0.1/src/sapguimcp/loghandlers/__init__.py +5 -0
  197. sapguimcp-1.0.1/src/sapguimcp/loghandlers/feedback_issue_handler.py +247 -0
  198. sapguimcp-1.0.1/src/sapguimcp/mcp_session.py +43 -0
  199. sapguimcp-1.0.1/src/sapguimcp/middleware/__init__.py +5 -0
  200. sapguimcp-1.0.1/src/sapguimcp/middleware/logging.py +232 -0
  201. sapguimcp-1.0.1/src/sapguimcp/models/README.md +92 -0
  202. sapguimcp-1.0.1/src/sapguimcp/models/__init__.py +281 -0
  203. sapguimcp-1.0.1/src/sapguimcp/models/abapgit_models.py +128 -0
  204. sapguimcp-1.0.1/src/sapguimcp/models/alv_models.py +15 -0
  205. sapguimcp-1.0.1/src/sapguimcp/models/base.py +144 -0
  206. sapguimcp-1.0.1/src/sapguimcp/models/breakpoint_models.py +58 -0
  207. sapguimcp-1.0.1/src/sapguimcp/models/config.py +275 -0
  208. sapguimcp-1.0.1/src/sapguimcp/models/intent_models.py +68 -0
  209. sapguimcp-1.0.1/src/sapguimcp/models/middleware.py +139 -0
  210. sapguimcp-1.0.1/src/sapguimcp/models/sap_results.py +537 -0
  211. sapguimcp-1.0.1/src/sapguimcp/models/se09_models.py +59 -0
  212. sapguimcp-1.0.1/src/sapguimcp/models/se11_models.py +81 -0
  213. sapguimcp-1.0.1/src/sapguimcp/models/se16_models.py +63 -0
  214. sapguimcp-1.0.1/src/sapguimcp/models/se24_edit_models.py +15 -0
  215. sapguimcp-1.0.1/src/sapguimcp/models/se24_models.py +228 -0
  216. sapguimcp-1.0.1/src/sapguimcp/models/se37_edit_models.py +14 -0
  217. sapguimcp-1.0.1/src/sapguimcp/models/se37_models.py +89 -0
  218. sapguimcp-1.0.1/src/sapguimcp/models/se38_edit_models.py +15 -0
  219. sapguimcp-1.0.1/src/sapguimcp/models/se93_models.py +79 -0
  220. sapguimcp-1.0.1/src/sapguimcp/models/slg1_models.py +55 -0
  221. sapguimcp-1.0.1/src/sapguimcp/models/sm30_models.py +67 -0
  222. sapguimcp-1.0.1/src/sapguimcp/models/sm37_models.py +53 -0
  223. sapguimcp-1.0.1/src/sapguimcp/models/spro_models.py +51 -0
  224. sapguimcp-1.0.1/src/sapguimcp/models/st22_models.py +58 -0
  225. sapguimcp-1.0.1/src/sapguimcp/prompts/README.md +63 -0
  226. sapguimcp-1.0.1/src/sapguimcp/prompts/__init__.py +138 -0
  227. sapguimcp-1.0.1/src/sapguimcp/prompts/abapgit_workflow.md +144 -0
  228. sapguimcp-1.0.1/src/sapguimcp/prompts/create_business_partner.md +174 -0
  229. sapguimcp-1.0.1/src/sapguimcp/prompts/explore_class.md +65 -0
  230. sapguimcp-1.0.1/src/sapguimcp/prompts/explore_function_module.md +74 -0
  231. sapguimcp-1.0.1/src/sapguimcp/prompts/explore_table.md +82 -0
  232. sapguimcp-1.0.1/src/sapguimcp/prompts/se16_bulk_read.md +89 -0
  233. sapguimcp-1.0.1/src/sapguimcp/resources/__init__.py +7 -0
  234. sapguimcp-1.0.1/src/sapguimcp/resources/feedback_resource.py +35 -0
  235. sapguimcp-1.0.1/src/sapguimcp/resources/intent_resource.py +30 -0
  236. sapguimcp-1.0.1/src/sapguimcp/resources/sandbox_resource.py +30 -0
  237. sapguimcp-1.0.1/src/sapguimcp/server.py +372 -0
  238. sapguimcp-1.0.1/src/sapguimcp/session_language.py +92 -0
  239. sapguimcp-1.0.1/src/sapguimcp/skills/README.md +256 -0
  240. sapguimcp-1.0.1/src/sapguimcp/skills/__init__.py +13 -0
  241. sapguimcp-1.0.1/src/sapguimcp/skills/examples/create_business_partner_bp.md +221 -0
  242. sapguimcp-1.0.1/src/sapguimcp/skills/examples/create_contract_account_caa1.md +221 -0
  243. sapguimcp-1.0.1/src/sapguimcp/skills/examples/general_navigation.md +129 -0
  244. sapguimcp-1.0.1/src/sapguimcp/skills/examples/monitor_process_documents_idxgc.md +242 -0
  245. sapguimcp-1.0.1/src/sapguimcp/tables/__init__.py +39 -0
  246. sapguimcp-1.0.1/src/sapguimcp/tables/loader.py +71 -0
  247. sapguimcp-1.0.1/src/sapguimcp/tables/models.py +47 -0
  248. sapguimcp-1.0.1/src/sapguimcp/tables/scraper.py +241 -0
  249. sapguimcp-1.0.1/src/sapguimcp/tables/search.py +114 -0
  250. sapguimcp-1.0.1/src/sapguimcp/tools/README.md +253 -0
  251. sapguimcp-1.0.1/src/sapguimcp/tools/__init__.py +74 -0
  252. sapguimcp-1.0.1/src/sapguimcp/tools/abapgit_tools.py +1342 -0
  253. sapguimcp-1.0.1/src/sapguimcp/tools/breakpoint_tools.py +1011 -0
  254. sapguimcp-1.0.1/src/sapguimcp/tools/catalog_tools.py +156 -0
  255. sapguimcp-1.0.1/src/sapguimcp/tools/class_tools.py +115 -0
  256. sapguimcp-1.0.1/src/sapguimcp/tools/classic_list_helpers.py +188 -0
  257. sapguimcp-1.0.1/src/sapguimcp/tools/com_tools.py +465 -0
  258. sapguimcp-1.0.1/src/sapguimcp/tools/confirmation_helpers.py +111 -0
  259. sapguimcp-1.0.1/src/sapguimcp/tools/desktop_wait_predicates.py +161 -0
  260. sapguimcp-1.0.1/src/sapguimcp/tools/edit_helpers.py +37 -0
  261. sapguimcp-1.0.1/src/sapguimcp/tools/feedback_tools.py +203 -0
  262. sapguimcp-1.0.1/src/sapguimcp/tools/field_helpers.py +38 -0
  263. sapguimcp-1.0.1/src/sapguimcp/tools/fm_tools.py +158 -0
  264. sapguimcp-1.0.1/src/sapguimcp/tools/intent_tools.py +82 -0
  265. sapguimcp-1.0.1/src/sapguimcp/tools/sap_list_connections_impl.py +83 -0
  266. sapguimcp-1.0.1/src/sapguimcp/tools/sap_login_impl.py +66 -0
  267. sapguimcp-1.0.1/src/sapguimcp/tools/sap_tools.py +1615 -0
  268. sapguimcp-1.0.1/src/sapguimcp/tools/script_tools.py +728 -0
  269. sapguimcp-1.0.1/src/sapguimcp/tools/se09_tools.py +452 -0
  270. sapguimcp-1.0.1/src/sapguimcp/tools/se11_tools.py +367 -0
  271. sapguimcp-1.0.1/src/sapguimcp/tools/se16_tools.py +758 -0
  272. sapguimcp-1.0.1/src/sapguimcp/tools/se24_edit_tools.py +356 -0
  273. sapguimcp-1.0.1/src/sapguimcp/tools/se24_tools.py +487 -0
  274. sapguimcp-1.0.1/src/sapguimcp/tools/se37_tools.py +416 -0
  275. sapguimcp-1.0.1/src/sapguimcp/tools/se38_edit_tools.py +210 -0
  276. sapguimcp-1.0.1/src/sapguimcp/tools/se93_tools.py +261 -0
  277. sapguimcp-1.0.1/src/sapguimcp/tools/session_tools.py +259 -0
  278. sapguimcp-1.0.1/src/sapguimcp/tools/slg1_tools.py +398 -0
  279. sapguimcp-1.0.1/src/sapguimcp/tools/sm30_tools.py +265 -0
  280. sapguimcp-1.0.1/src/sapguimcp/tools/sm37_tools.py +468 -0
  281. sapguimcp-1.0.1/src/sapguimcp/tools/spro_tools.py +235 -0
  282. sapguimcp-1.0.1/src/sapguimcp/tools/st22_tools.py +554 -0
  283. sapguimcp-1.0.1/src/sapguimcp/tools/table_helpers.py +216 -0
  284. sapguimcp-1.0.1/src/sapguimcp/tools/table_tools.py +138 -0
  285. sapguimcp-1.0.1/src/sapguimcp/tools/tree_tools.py +348 -0
  286. sapguimcp-1.0.1/src/sapguimcp/utils.py +273 -0
  287. sapguimcp-1.0.1/uv.lock +2525 -0
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: readme-demo
3
+ description: >
4
+ End-to-end demo of this MCP server for the project README and for users who
5
+ want to see it in action: log into an SAP system, create a business partner
6
+ (Max Mustermann by default), save it with Ctrl+S, capture a screenshot for
7
+ the documentation, and verify the partner in SE16 (table BUT000). Use when
8
+ the user says "run the readme demo", "demo the SAP MCP server", or invokes
9
+ /readme-demo. Announce each step in one short chat sentence so the run reads
10
+ as a story, and capture a numbered screenshot after every SAP-visible step.
11
+ ---
12
+
13
+ # README Demo
14
+
15
+ You are demonstrating this MCP server end to end. The run produces two things:
16
+ a readable chat story (the sentences you say between steps) and the artifacts
17
+ that prove the work (screenshots, transcript).
18
+
19
+ **Work directory:** `/readme-demo/` (repo-root-relative, git-ignored). Create
20
+ it if missing. It receives `transcript.md` and `frames/` (create `frames/`
21
+ before the first capture).
22
+
23
+ **Data:** use obviously fake data — first name `Max`, last name `Mustermann`
24
+ (unless the user passed other values), street `Teststraße 1`, postal code
25
+ `12345`, city `Testhausen`, country `DE`. Never use real personal data.
26
+
27
+ **Optional arguments:** partner first/last name, address, system key
28
+ (default: the default system in `systems.json`).
29
+
30
+ ## How to run the demo
31
+
32
+ Work through the beats below. For every beat:
33
+
34
+ 1. Say one short chat sentence announcing what you are about to do (plain
35
+ language, no JSON, no internal jargon — the reader is a first-time user).
36
+ 2. Call the tool.
37
+ 3. If the beat captures a frame (see the list), save it to the named file
38
+ under `readme-demo/frames/` with the `hard_copy` script described below
39
+ (`sap_screenshot` only shows you the picture, it cannot save a file). For
40
+ beats with overlays, read the rectangles in that same script.
41
+ 4. Append the beat to `readme-demo/transcript.md` in the sidecar format
42
+ below. `tool=` names the beat's primary tool; `frame=` references the
43
+ screenshot file (relative to `readme-demo/`), when the beat has one.
44
+
45
+ **Prerequisites:** besides the SAP tools you need file write access (the
46
+ `sap_run_script` sandbox cannot create folders or write files other than via
47
+ `hard_copy`). Create `readme-demo/frames/` with your file tools before the
48
+ first frame; stop and tell the user if you have none.
49
+
50
+ **Once, right after `sap_login`:** note the `session_id` from its result
51
+ (`sap_login` always opens a *new* session) and pass `session=<that id>` on
52
+ **every** later call, including every `sap_run_script` — otherwise calls go to
53
+ the primary session, which may be an older login. Then shrink the SAP window so
54
+ its text stays legible at GIF size: `wnd.restore()` then
55
+ `wnd.resize_working_pane(100, 22, False)` via `sap_run_script` (gives a frame
56
+ of about 1045×900 px; check the first PNG's size). Do not resize again during
57
+ the run: the overlay coordinates below are only valid for the window size the
58
+ frame was captured at.
59
+
60
+ Do not add artificial waits between steps. Pacing happens later at GIF
61
+ assembly time, outside this skill.
62
+
63
+ ### How to capture frames (important)
64
+
65
+ `sap_screenshot` returns the picture to *you* (the agent sees it) but cannot
66
+ save it to disk. To write a frame file, use `sap_run_script`
67
+ with the COM `hard_copy` call — the same way the server itself implements
68
+ screenshots. Absolute path required:
69
+
70
+ ```python
71
+ # via sap_run_script, one shot per frame:
72
+ wnd = session.find_by_id("wnd[0]")
73
+ wnd.hard_copy(r"C:\<absolute path to repo>\readme-demo\frames\03_bp_initial.png", 2)
74
+ output("frame saved")
75
+ ```
76
+
77
+ (`2` = PNG. `open()`/`import` are sandbox-blocked, but the injected
78
+ `session` object writes the file through COM — no `open()` needed. After the
79
+ first frame, check that the PNG exists at that path before proceeding; if it
80
+ does not, the path form is wrong.)
81
+
82
+ ### Beats
83
+
84
+ | Beat | Say | Do | Frame (if any) |
85
+ | --- | --- | --- | --- |
86
+ | 1 | State the whole task in one sentence. | — (no tool call; transcript block is `role=user` with the user's prompt text) | none of its own — write `frame=frames/02_easy_access.png` (the later beat-2 frame) |
87
+ | 2 | "Logging into the dev system…" | `sap_login(system_key=…)` | `frames/02_easy_access.png` |
88
+ | 3 | "Opening transaction BP…" | `sap_transaction(tcode="bp")` | `frames/03_bp_initial.png` |
89
+ | 4 | "Creating a person…" | `sap_press_key(key="F5")` (if a type-selection popup appears — visible as `wnd[1]` in the `sap_press_key` response's `active_window` — confirm it with `sap_press_key(key="Enter")`) | `frames/04_bp_empty.png` |
90
+ | 5 | "Filling in name and address…" | `sap_fill_form({...})` — see field table | `frames/05_bp_filled.png` |
91
+ | 6 | "Saving…" | `sap_press_key(key="Ctrl+S")` | none of its own — write `frame=frames/07_bp_saved.png` (the later beat-7 frame) |
92
+ | 7 | "Capturing a screenshot for the documentation…" | `sap_screenshot` (shows you the picture) + `sap_run_script` `hard_copy` → `frames/07_bp_saved.png`, and a second `hard_copy` in the same script → `readme-demo/BP_<Nachname>.png` | `frames/07_bp_saved.png` |
93
+ | 8 | "Now verifying it exists in SE16…" | `sap_se16_query(table="BUT000", filters={"PARTNER": "<GP number>"})` (leaves the result list on screen for the frame) | `frames/08_se16_result.png` |
94
+ | 9 | "✓ Partner <GP number> exists in BUT000, screenshot saved as BP_<Nachname>.png." | — (report to the user) | none of its own — repeat `frame=frames/08_se16_result.png` |
95
+
96
+ Beat numbering in `transcript.md` follows the table. If a step needs extra
97
+ tool calls (field discovery, popup handling), fold them into the narrative of
98
+ the current beat — do not invent new beats.
99
+
100
+ ### BP form fields (labels are the keys for `sap_fill_form`)
101
+
102
+ | Key | Value |
103
+ | --- | --- |
104
+ | `Vorname` | `<first name>` |
105
+ | `Nachname` | `<last name>` |
106
+ | `Straße/Hausnummer` | `<street>` |
107
+ | `Postleitzahl/Ort` | `<postal code>` |
108
+ | `Ort` | `<city>` |
109
+ | `Land` | `DE` |
110
+
111
+ > `Postleitzahl/Ort` labels the whole address row and resolves to the postal
112
+ > code field; `Ort` addresses the city field in the same row, which has no
113
+ > separate visible label. Both keys are required. Do not fill `Anrede`
114
+ > (salutation) unless the user asked for it.
115
+
116
+ If `sap_fill_form` reports `not_found` fields, call `sap_discover_fields` to
117
+ read the system's actual labels, adjust the keys, and retry. If the status
118
+ bar reports a duplicate or validation error after `Ctrl+S`, or if
119
+ `active_window` in the `Ctrl+S` response is `wnd[1]` (e.g. the duplicate-check
120
+ dialog), do not confirm anything: take a `sap_screenshot`, show it and the
121
+ message to the user and stop — do not create duplicates on purpose. (Running
122
+ the demo again with the default name creates another "Max Mustermann".) If the flow needs
123
+ repeated manual correction that this file did not anticipate, report that
124
+ upstream instead of silently patching this skill.
125
+
126
+ ### Save and result evaluation
127
+
128
+ `Ctrl+S` is the save action. The `sap_press_key(key="Ctrl+S")` response
129
+ carries `status_bar_type` and `status_bar_message` — read the result directly
130
+ from that response; no separate `sap_read_status_bar` call is needed. On
131
+ `type=S` (success), extract the business partner number from the message. If
132
+ the message carries no partner number or the type is not `S`, show it to the
133
+ user and stop (you may re-read the status bar with `sap_read_status_bar`).
134
+ Report it in beat 9 and use it as the `PARTNER` filter in beat 8. Note: run
135
+ beat 7's screenshot *after* the successful save so the status bar shows the
136
+ success message.
137
+
138
+ ### Transcript sidecar format
139
+
140
+ ```markdown
141
+ [beat 1] role=user frame=frames/02_easy_access.png
142
+ <the user's one-sentence task>
143
+
144
+ [beat 2] role=assistant frame=frames/02_easy_access.png
145
+ Logging into the dev system…
146
+ tool=sap_login
147
+
148
+ [beat 3] role=assistant frame=frames/03_bp_initial.png
149
+ Opening transaction BP…
150
+ tool=sap_transaction
151
+ mark=20,91,156,26 Transaction: BP
152
+
153
+ [beat 6] role=assistant frame=frames/07_bp_saved.png
154
+ Saving…
155
+ tool=sap_press_key
156
+ status=8,853,1029,40 <status bar message>
157
+ ```
158
+
159
+ Rules:
160
+
161
+ - One block per beat; blocks are separated by a blank line, so there are no
162
+ blank lines inside a block.
163
+ - The header is `[beat N] role=… frame=…`. `role=` is `user` or `assistant`
164
+ (`title` exists for a title card, which the demo does not use). `frame=` is
165
+ optional, relative to `readme-demo/`, and may repeat an earlier file.
166
+ - Then the message text, then — each on its own line, never in the header —
167
+ `tool=` (assistant beats only; the beat's primary tool, fold retries and
168
+ popup handling under it) and the overlay lines below.
169
+
170
+ **Overlays (assistant beats only, optional):** `mark=x,y,w,h caption` draws an
171
+ orange ring and caption pill around an element of the frame; `status=x,y,w,h text`
172
+ draws the status-bar message (the screenshot does not render it; at most one
173
+ per beat). `x,y,w,h` are four plain integers separated by commas — no spaces,
174
+ brackets or minus signs — in pixels *of the captured frame*. A malformed line
175
+ is a parse error in the renderer.
176
+
177
+ Which beats get overlays: beat 3 marks the command field (`Transaction: BP`),
178
+ beat 4 the `Person` toolbar button (`F5 = Person`), beat 5 each filled field
179
+ (caption = the value, e.g. `Max`), beat 6 and beat 7 carry the same `status=`
180
+ line (the status bar text after the save; read in beat 7's script, so write
181
+ beat 6's block only after that script has run and copy its `status=` line),
182
+ beat 8 and beat 9 mark the result list if you can locate that control (its id
183
+ differs between SE16 variants; if `wnd[0]` does not show the result grid, take
184
+ the frame anyway and leave out the marks). Beats 1 and 2 have none.
185
+
186
+ Read the rectangles live via COM in the **same `sap_run_script` call that saves
187
+ the frame**, after the beat's SAP action. This script prints ready-made lines:
188
+
189
+ ```python
190
+ wnd = session.find_by_id("wnd[0]")
191
+ wx, wy = wnd.screen_left, wnd.screen_top
192
+
193
+ def rect(el): # element position relative to the window = pixel position in the frame
194
+ return "%d,%d,%d,%d" % (el.screen_left - wx, el.screen_top - wy, el.width, el.height)
195
+
196
+ wnd.hard_copy(r"C:\<absolute path to repo>\readme-demo\frames\03_bp_initial.png", 2)
197
+ output("mark=" + rect(session.find_by_id("wnd[0]/tbar[0]/okcd")) + " Transaction: BP")
198
+ sbar = session.find_by_id("wnd[0]/sbar")
199
+ output("status=" + rect(sbar) + " " + sbar.text) # beats 6 and 7
200
+ ```
201
+
202
+ Toolbar buttons are under `wnd[0]/tbar[1]` (match on `.text`, e.g. `Person`).
203
+ Form fields are nested deep in subscreens: take their ids from
204
+ `sap_discover_fields`, or find them with a recursive walk over `.children`
205
+ that matches the end of the id (`txtBUT000-NAME_FIRST`, `txtBUT000-NAME_LAST`,
206
+ `txtADDR2_DATA-STREET`, `txtADDR2_DATA-POST_CODE1`, `txtADDR2_DATA-CITY1`,
207
+ `ctxtADDR2_DATA-COUNTRY`). Each walk traverses the whole screen tree, so
208
+ collect all fields in one script and pass `timeout=120` to `sap_run_script`:
209
+
210
+ ```python
211
+ def find_by_suffix(node, suffix, depth=0):
212
+ if depth > 14:
213
+ return None
214
+ try:
215
+ kids = node.children
216
+ except Exception:
217
+ return None
218
+ for kid in kids:
219
+ if kid.id.endswith(suffix):
220
+ return kid
221
+ hit = find_by_suffix(kid, suffix, depth + 1)
222
+ if hit is not None:
223
+ return hit
224
+ return None
225
+ ```
226
+
227
+ If an element cannot be found or reports a zero size, skip that mark — marks
228
+ are optional and must never block the run.
229
+
230
+ ### After the run
231
+
232
+ Before anyone publishes the frames, open each PNG and check it for a person's
233
+ name (the Easy Access user menu can show one), a logon ID (`CRUSR`/`CHUSR`
234
+ columns in the BUT000 grid), a client column or a hostname. If one is visible,
235
+ crop the frame or re-capture with a narrower view, and tell the user.
236
+
237
+ Tell the user: partner number, screenshot path, SE16 confirmation, and where
238
+ the artifacts live (`readme-demo/`). If the user wants the README GIF, point
239
+ them to `scripts/README.md` (render + ffmpeg commands) — that step is
240
+ maintainer-side.
241
+
242
+ ### An improved internal recipe
243
+
244
+ An improved internal skill for creating business partners may be installed in
245
+ this environment (it is not part of this repository). If present, you may
246
+ prefer it for the beat 3–6 flow; it handles more edge cases (role/grouping
247
+ prompts, company-code data). When in doubt or when fields mismatch, fall back
248
+ to the flow above — it is authoritative for this demo.
@@ -0,0 +1,25 @@
1
+ # SAP system credentials are configured in ~/.config/sap-mcp/systems.json
2
+ # (or set SAP_CONFIG_FILE to point to a different location).
3
+ # See: https://github.com/Hochfrequenz/sap-mcp-config
4
+
5
+ # GitHub integration
6
+ # GITHUB_PAT is used for two things:
7
+ # 1. Feedback: creating GitHub issues via log_feedback (needs 'issues' scope on GITHUB_REPO)
8
+ # 2. abapGit: authenticating pulls from private repos (needs 'repo' scope on your ABAP repos)
9
+ # If you only set GITHUB_PAT, it is used for both.
10
+ # Generate token at: https://github.com/settings/tokens
11
+ GITHUB_USER=your-github-username
12
+ GITHUB_PAT=ghp_your_token_here
13
+ # GITHUB_REPO=Hochfrequenz/sapgui.mcp
14
+
15
+ # Optional: separate PAT for abapGit only (overrides GITHUB_PAT for pulls).
16
+ # Use this if you want different scopes for abapGit vs feedback/issues.
17
+ # ABAPGIT_PAT=ghp_your_abapgit_token_here
18
+
19
+ # Papertrail logging (optional)
20
+ # Disabled by default. Uncomment and fill in your Papertrail destination to enable:
21
+ # PAPERTRAIL_HOST=logsN.papertrailapp.com
22
+ # PAPERTRAIL_PORT=12345
23
+
24
+ # Audit logging (optional)
25
+ # AUDIT_LOG_DIR=/path/to/audit/logs
@@ -0,0 +1,16 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
3
+
4
+ # Ensure HTML snapshots use LF line endings on all platforms
5
+ *.html text eol=lf
6
+
7
+ # Python files
8
+ *.py text eol=lf
9
+
10
+ # Config files
11
+ *.yml text eol=lf
12
+ *.yaml text eol=lf
13
+ *.toml text eol=lf
14
+ *.ini text eol=lf
15
+ *.json text eol=lf
16
+ *.md text eol=lf
@@ -0,0 +1,27 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "uv" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
12
+ reviewers:
13
+ - "@Hochfrequenz/python-developers-review-team"
14
+ - package-ecosystem: "github-actions"
15
+ directory: "/"
16
+ schedule:
17
+ interval: "weekly"
18
+ - package-ecosystem: "npm"
19
+ directory: "/"
20
+ schedule:
21
+ interval: "weekly"
22
+
23
+ # Keep git submodules up to date
24
+ - package-ecosystem: "gitsubmodule"
25
+ directory: "/"
26
+ schedule:
27
+ interval: "weekly"
@@ -0,0 +1,166 @@
1
+ name: Build Executable
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ release:
9
+ types: [created]
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: windows-latest
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v7
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v10.3.3
20
+ with:
21
+ python-version: "3.15"
22
+
23
+ - name: Build Executable
24
+ run: uv run --locked --group build_executable pyinstaller --noconfirm sapgui_mcp_windows.spec
25
+
26
+ - name: Freeze build dependencies
27
+ run: uv pip freeze > dist/build-dependencies.txt
28
+
29
+ - name: Upload Executable as Artifact
30
+ uses: actions/upload-artifact@v7
31
+ with:
32
+ name: sapgui_mcp_windows
33
+ path: |
34
+ dist/sapgui_mcp_windows.exe
35
+ dist/build-dependencies.txt
36
+
37
+ build_with_remote_logging:
38
+ runs-on: windows-latest
39
+ name: "Build (with_remote_logging)"
40
+ # Repository secrets are not available to PRs from forks, so skip this
41
+ # variant in that case. Public forks can still build the public binary.
42
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
43
+ steps:
44
+ - name: Checkout code
45
+ uses: actions/checkout@v7
46
+
47
+ - name: Install uv
48
+ uses: astral-sh/setup-uv@v10.3.3
49
+ with:
50
+ python-version: "3.15"
51
+
52
+ - name: Write .env.production from secrets
53
+ env:
54
+ PAPERTRAIL_HOST: ${{ secrets.PAPERTRAIL_HOST }}
55
+ PAPERTRAIL_PORT: ${{ secrets.PAPERTRAIL_PORT }}
56
+ shell: pwsh
57
+ run: |
58
+ if (-not $env:PAPERTRAIL_HOST -or -not $env:PAPERTRAIL_PORT) {
59
+ Write-Error "PAPERTRAIL_HOST and PAPERTRAIL_PORT secrets must be configured for the with_remote_logging build."
60
+ exit 1
61
+ }
62
+ $content = "PAPERTRAIL_HOST=$env:PAPERTRAIL_HOST`nPAPERTRAIL_PORT=$env:PAPERTRAIL_PORT`n"
63
+ [System.IO.File]::WriteAllText(".env.production", $content, [System.Text.Encoding]::UTF8)
64
+
65
+ - name: Build Executable
66
+ env:
67
+ SAPGUI_BUILD_NAME: sapgui_mcp_windows_with_remote_logging
68
+ run: uv run --locked --group build_executable pyinstaller --noconfirm sapgui_mcp_windows.spec
69
+
70
+ - name: Freeze build dependencies
71
+ run: uv pip freeze > dist/build-dependencies.txt
72
+
73
+ - name: Upload Executable as Artifact
74
+ uses: actions/upload-artifact@v7
75
+ with:
76
+ name: sapgui_mcp_windows_with_remote_logging
77
+ path: |
78
+ dist/sapgui_mcp_windows_with_remote_logging.exe
79
+ dist/build-dependencies.txt
80
+
81
+ smoke_test:
82
+ # The two Windows variants share all non-logging code paths, so smoke-testing
83
+ # the public binary is sufficient — HF-specific behaviour (Papertrail) cannot
84
+ # be smoke-tested without a live Papertrail collector anyway.
85
+ needs: build
86
+ runs-on: windows-latest
87
+ name: "Smoke Test (windows-latest)"
88
+ steps:
89
+ - name: Checkout code
90
+ uses: actions/checkout@v7
91
+
92
+ - name: Install uv
93
+ uses: astral-sh/setup-uv@v10.3.3
94
+ with:
95
+ python-version: "3.15"
96
+
97
+ - name: Download Executable
98
+ uses: actions/download-artifact@v8
99
+ with:
100
+ name: sapgui_mcp_windows
101
+ path: dist
102
+
103
+ - name: Smoke Test
104
+ run: uv run --no-project --python 3.15 python scripts/smoke_test_exe.py dist/sapgui_mcp_windows.exe
105
+
106
+ release:
107
+ needs: [build, build_with_remote_logging, smoke_test]
108
+ # always() lets this job run even when build_with_remote_logging was skipped
109
+ # (fork PRs have no secret access and skip that job). The shell script and
110
+ # fail_on_unmatched_files: false already handle missing artifacts gracefully.
111
+ if: always() && github.event_name == 'release'
112
+ runs-on: ubuntu-latest
113
+ permissions:
114
+ contents: write
115
+ steps:
116
+ - name: Download Windows (public) Executable
117
+ uses: actions/download-artifact@v8
118
+ with:
119
+ name: sapgui_mcp_windows
120
+ path: dist/windows
121
+ continue-on-error: true
122
+
123
+ - name: Download Windows (with_remote_logging) Executable
124
+ uses: actions/download-artifact@v8
125
+ with:
126
+ name: sapgui_mcp_windows_with_remote_logging
127
+ path: dist/windows_with_remote_logging
128
+ continue-on-error: true
129
+
130
+ # Rename each binary independently so a missing artifact from one
131
+ # variant does not prevent the other from being attached to the release.
132
+ - name: Rename Executables with version
133
+ run: |
134
+ set -eu
135
+ mkdir -p dist/release
136
+ if [ -f ./dist/windows/sapgui_mcp_windows.exe ]; then
137
+ mv ./dist/windows/sapgui_mcp_windows.exe ./dist/release/sapgui_mcp_windows_${{ github.ref_name }}.exe
138
+ else
139
+ echo "::warning::Windows (public) artifact missing; skipping"
140
+ fi
141
+ if [ -f ./dist/windows_with_remote_logging/sapgui_mcp_windows_with_remote_logging.exe ]; then
142
+ mv ./dist/windows_with_remote_logging/sapgui_mcp_windows_with_remote_logging.exe ./dist/release/sapgui_mcp_windows_with_remote_logging_${{ github.ref_name }}.exe
143
+ else
144
+ echo "::warning::Windows (with_remote_logging) artifact missing; skipping"
145
+ fi
146
+ ls -la dist/release/
147
+
148
+ - name: Generate release checksums
149
+ run: |
150
+ cd dist/release
151
+ shopt -s nullglob
152
+ assets=(./*)
153
+ if ((${#assets[@]})); then
154
+ sha256sum "${assets[@]}" > checksums.txt
155
+ else
156
+ : > checksums.txt
157
+ fi
158
+
159
+ - name: Upload Executables to Release
160
+ uses: softprops/action-gh-release@v3
161
+ with:
162
+ files: |
163
+ ./dist/release/sapgui_mcp_windows_${{ github.ref_name }}.exe
164
+ ./dist/release/sapgui_mcp_windows_with_remote_logging_${{ github.ref_name }}.exe
165
+ ./dist/release/checksums.txt
166
+ fail_on_unmatched_files: false
@@ -0,0 +1,31 @@
1
+ name: Coverage
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ coverage:
11
+ # Windows, so that the desktop (COM) unit tests run instead of skipping.
12
+ # The job name stays "coverage" (required status check).
13
+ runs-on: windows-latest
14
+
15
+ env:
16
+ PYTHONPATH: src
17
+
18
+ steps:
19
+ - uses: actions/checkout@v7
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v10.3.3
23
+ with:
24
+ python-version: "3.15"
25
+
26
+ - name: Run coverage
27
+ shell: bash
28
+ run: |
29
+ uv run --locked --group coverage coverage run -m pytest -m "not integration"
30
+ uv run --locked --group coverage coverage html --omit '.venv/*,unittests/*'
31
+ uv run --locked --group coverage coverage report --fail-under 20 --omit '.venv/*,unittests/*'
@@ -0,0 +1,18 @@
1
+ name: Dependabot auto-approve / -merge
2
+ on: pull_request
3
+
4
+ jobs:
5
+ dependabot:
6
+ permissions:
7
+ contents: write
8
+ pull-requests: write
9
+ runs-on: ubuntu-latest
10
+ env:
11
+ PR_URL: ${{github.event.pull_request.html_url}}
12
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13
+ if: ${{ github.actor == 'dependabot[bot]' }}
14
+ steps:
15
+ - name: Approve a PR
16
+ run: gh pr review --approve "$PR_URL"
17
+ - name: Enable auto-merge for Dependabot PRs
18
+ run: gh pr merge --auto --squash "$PR_URL"
@@ -0,0 +1,23 @@
1
+ name: "Test Dev Environment"
2
+ # Checks that the dev environment (uv sync --group dev) can be set up.
3
+ # This might not work, if different linting/testing groups refer to different versions of the same lib (e.g. typing-extensions).
4
+ # Different versions of the same package might work for isolated specific groups (only linting, only testing...) but the dev environment inherits from all of them.
5
+ on:
6
+ push:
7
+ branches: [main]
8
+ pull_request: {}
9
+ jobs:
10
+ check:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
15
+ os: [ubuntu-latest]
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v10.3.3
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+ - name: Create a Dev Environment
23
+ run: uv sync --locked --group dev
@@ -0,0 +1,27 @@
1
+ name: Formatting
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ formatting:
11
+ runs-on: ubuntu-latest
12
+
13
+ env:
14
+ PYTHONPATH: src
15
+
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v10.3.3
21
+ with:
22
+ python-version: "3.15"
23
+
24
+ - name: Check formatting
25
+ run: |
26
+ uv run --locked --group linting ruff format --check .
27
+ uv run --locked --group linting ruff check --select I .
@@ -0,0 +1,25 @@
1
+ name: Linting
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ linting:
11
+ runs-on: ubuntu-latest
12
+
13
+ env:
14
+ PYTHONPATH: src
15
+
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v10.3.3
21
+ with:
22
+ python-version: "3.15"
23
+
24
+ - name: Run ruff check
25
+ run: uv run --locked --group linting ruff check .
@@ -0,0 +1,15 @@
1
+ name: Prevent ByteOrderMarks
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request: {}
8
+
9
+ jobs:
10
+ bom-check:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v7
14
+ - uses: arma-actions/bom-check@v1
15
+ name: Check for BOM
@@ -0,0 +1,19 @@
1
+ name: "Packaging Test"
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request: {}
7
+ jobs:
8
+ check_packaging:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v7
12
+ - name: Install uv
13
+ uses: astral-sh/setup-uv@v10.3.3
14
+ with:
15
+ python-version: "3.15"
16
+ - name: Build package
17
+ run: uv build
18
+ - name: Check package
19
+ run: uv publish --dry-run dist/*
@@ -0,0 +1,26 @@
1
+ name: Prettier
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ prettier:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v7
15
+
16
+ - name: Set up Node.js
17
+ uses: actions/setup-node@v7
18
+ with:
19
+ node-version: "22"
20
+ cache: "npm"
21
+
22
+ - name: Install dependencies
23
+ run: npm ci
24
+
25
+ - name: Check formatting (Markdown)
26
+ run: npm run format:check