zrb 1.0.0a2__tar.gz → 1.0.0a3__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 (207) hide show
  1. {zrb-1.0.0a2 → zrb-1.0.0a3}/PKG-INFO +8 -5
  2. {zrb-1.0.0a2 → zrb-1.0.0a3}/pyproject.toml +15 -12
  3. zrb-1.0.0a3/src/zrb/__init__.py +105 -0
  4. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/__main__.py +3 -3
  5. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/attr/type.py +2 -1
  6. zrb-1.0.0a3/src/zrb/builtin/__init__.py +41 -0
  7. zrb-1.0.0a3/src/zrb/builtin/base64.py +32 -0
  8. zrb-1.0.0a3/src/zrb/builtin/git.py +156 -0
  9. zrb-1.0.0a3/src/zrb/builtin/git_subtree.py +88 -0
  10. zrb-1.0.0a3/src/zrb/builtin/group.py +34 -0
  11. zrb-1.0.0a3/src/zrb/builtin/llm.py +31 -0
  12. zrb-1.0.0a3/src/zrb/builtin/md5.py +34 -0
  13. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp.py +72 -0
  14. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/.gitignore +4 -0
  15. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/README.md +7 -0
  16. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/_zrb/config.py +17 -0
  17. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/_zrb/group.py +16 -0
  18. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/_zrb/helper.py +97 -0
  19. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/_zrb/main.py +132 -0
  20. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/_zrb/venv_task.py +22 -0
  21. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common/app.py +18 -0
  22. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common/db_engine.py +5 -0
  23. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common/db_repository.py +134 -0
  24. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common/error.py +8 -0
  25. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common/schema.py +5 -0
  26. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common/usecase.py +232 -0
  27. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/config.py +29 -0
  28. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/main.py +7 -0
  29. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/migrate.py +3 -0
  30. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/alembic.ini +117 -0
  31. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/client/api_client.py +7 -0
  32. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/client/base_client.py +27 -0
  33. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/client/direct_client.py +6 -0
  34. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/client/factory.py +9 -0
  35. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/README +1 -0
  36. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/env.py +108 -0
  37. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/script.py.mako +26 -0
  38. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/versions/3093c7336477_add_user_table.py +37 -0
  39. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/migration_metadata.py +6 -0
  40. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/route.py +22 -0
  41. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/db_repository.py +39 -0
  42. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/factory.py +13 -0
  43. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/repository.py +34 -0
  44. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/usecase.py +45 -0
  45. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/alembic.ini +117 -0
  46. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/README +1 -0
  47. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/env.py +108 -0
  48. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/script.py.mako +26 -0
  49. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration_metadata.py +3 -0
  50. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/route.py +27 -0
  51. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/requirements.txt +6 -0
  52. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/schema/role.py +31 -0
  53. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/schema/user.py +31 -0
  54. zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/template.env +2 -0
  55. zrb-1.0.0a3/src/zrb/builtin/project/create/create.py +41 -0
  56. zrb-1.0.0a3/src/zrb/builtin/project/create/project-template/README.md +3 -0
  57. zrb-1.0.0a3/src/zrb/builtin/project/create/project-template/zrb_init.py +7 -0
  58. zrb-1.0.0a3/src/zrb/builtin/python.py +11 -0
  59. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/builtin/shell/autocomplete/bash.py +5 -6
  60. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/builtin/shell/autocomplete/subcmd.py +7 -8
  61. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/builtin/shell/autocomplete/zsh.py +5 -6
  62. zrb-1.0.0a3/src/zrb/builtin/todo.py +186 -0
  63. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/callback/any_callback.py +1 -1
  64. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/callback/callback.py +5 -5
  65. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/cmd/cmd_val.py +2 -2
  66. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/config.py +4 -1
  67. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/content_transformer/any_content_transformer.py +1 -1
  68. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/content_transformer/content_transformer.py +2 -2
  69. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/context/any_context.py +1 -1
  70. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/context/any_shared_context.py +3 -3
  71. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/context/context.py +10 -8
  72. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/context/shared_context.py +9 -8
  73. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/env/any_env.py +1 -1
  74. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/env/env.py +3 -4
  75. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/env/env_file.py +4 -4
  76. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/env/env_map.py +2 -2
  77. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/group/any_group.py +3 -3
  78. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/group/group.py +7 -6
  79. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/any_input.py +1 -1
  80. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/base_input.py +4 -4
  81. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/bool_input.py +5 -5
  82. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/float_input.py +3 -3
  83. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/int_input.py +3 -3
  84. zrb-1.0.0a3/src/zrb/input/option_input.py +51 -0
  85. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/password_input.py +2 -2
  86. zrb-1.0.0a3/src/zrb/input/str_input.py +5 -0
  87. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/input/text_input.py +12 -10
  88. zrb-1.0.0a3/src/zrb/runner/__init__.py +0 -0
  89. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/cli.py +79 -45
  90. zrb-1.0.0a3/src/zrb/runner/web_app/__init__.py +0 -0
  91. zrb-1.0.0a3/src/zrb/runner/web_app/group_info_ui/__init__.py +0 -0
  92. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/group_info_ui/controller.py +7 -8
  93. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/group_info_ui/view.html +2 -2
  94. zrb-1.0.0a3/src/zrb/runner/web_app/home_page/__init__.py +0 -0
  95. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/home_page/controller.py +7 -6
  96. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/home_page/view.html +2 -2
  97. zrb-1.0.0a3/src/zrb/runner/web_app/task_ui/__init__.py +0 -0
  98. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/controller.py +8 -12
  99. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/view.html +2 -2
  100. zrb-1.0.0a3/src/zrb/runner/web_server.py +150 -0
  101. zrb-1.0.0a3/src/zrb/runner/web_util.py +16 -0
  102. zrb-1.0.0a3/src/zrb/session/__init__.py +0 -0
  103. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/session/any_session.py +13 -7
  104. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/session/session.py +78 -40
  105. zrb-1.0.0a3/src/zrb/session_state_log/__init__.py +0 -0
  106. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/session_state_log/session_state_log.py +7 -5
  107. zrb-1.0.0a3/src/zrb/session_state_logger/__init__.py +0 -0
  108. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/session_state_logger/any_session_state_logger.py +1 -1
  109. zrb-1.0.0a3/src/zrb/session_state_logger/default_session_state_logger.py +4 -0
  110. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/session_state_logger/file_session_state_logger.py +19 -27
  111. zrb-1.0.0a3/src/zrb/task/__init__.py +0 -0
  112. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/any_task.py +4 -4
  113. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/base_task.py +33 -23
  114. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/base_trigger.py +11 -12
  115. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/cmd_task.py +48 -39
  116. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/http_check.py +8 -8
  117. zrb-1.0.0a3/src/zrb/task/llm_task.py +160 -0
  118. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/make_task.py +9 -9
  119. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/rsync_task.py +7 -7
  120. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/scaffolder.py +14 -11
  121. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/scheduler.py +6 -7
  122. zrb-1.0.0a3/src/zrb/task/task.py +5 -0
  123. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task/tcp_check.py +8 -8
  124. zrb-1.0.0a3/src/zrb/task_status/__init__.py +0 -0
  125. zrb-1.0.0a3/src/zrb/util/__init__.py +0 -0
  126. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/attr.py +19 -3
  127. zrb-1.0.0a3/src/zrb/util/cli/__init__.py +0 -0
  128. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/cli/style.py +71 -2
  129. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/cli/subcommand.py +2 -2
  130. zrb-1.0.0a3/src/zrb/util/cmd/__init__.py +0 -0
  131. zrb-1.0.0a3/src/zrb/util/codemod/__init__.py +0 -0
  132. zrb-1.0.0a3/src/zrb/util/codemod/add_code_to_class.py +35 -0
  133. zrb-1.0.0a3/src/zrb/util/codemod/add_code_to_function.py +36 -0
  134. zrb-1.0.0a3/src/zrb/util/codemod/add_code_to_method.py +55 -0
  135. zrb-1.0.0a3/src/zrb/util/codemod/add_key_to_dict.py +51 -0
  136. zrb-1.0.0a3/src/zrb/util/codemod/add_param_to_function_call.py +39 -0
  137. zrb-1.0.0a3/src/zrb/util/codemod/add_property_to_class.py +55 -0
  138. zrb-1.0.0a3/src/zrb/util/git.py +156 -0
  139. zrb-1.0.0a3/src/zrb/util/git_subtree.py +94 -0
  140. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/group.py +2 -2
  141. zrb-1.0.0a3/src/zrb/util/llm/tool.py +63 -0
  142. zrb-1.0.0a3/src/zrb/util/string/__init__.py +0 -0
  143. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/string/conversion.py +7 -0
  144. zrb-1.0.0a3/src/zrb/util/todo.py +135 -0
  145. zrb-1.0.0a3/src/zrb/xcom/__init__.py +0 -0
  146. zrb-1.0.0a2/src/zrb/__init__.py +0 -96
  147. zrb-1.0.0a2/src/zrb/builtin/__init__.py +0 -3
  148. zrb-1.0.0a2/src/zrb/builtin/shell/__init__.py +0 -5
  149. zrb-1.0.0a2/src/zrb/builtin/shell/_group.py +0 -9
  150. zrb-1.0.0a2/src/zrb/builtin/shell/autocomplete/__init__.py +0 -9
  151. zrb-1.0.0a2/src/zrb/builtin/shell/autocomplete/_group.py +0 -6
  152. zrb-1.0.0a2/src/zrb/env/__init__.py +0 -3
  153. zrb-1.0.0a2/src/zrb/group/__init__.py +0 -3
  154. zrb-1.0.0a2/src/zrb/input/str_input.py +0 -5
  155. zrb-1.0.0a2/src/zrb/runner/web_app/any_request_handler.py +0 -24
  156. zrb-1.0.0a2/src/zrb/runner/web_server.py +0 -224
  157. zrb-1.0.0a2/src/zrb/runner/web_util.py +0 -46
  158. zrb-1.0.0a2/src/zrb/session_state_logger/default_session_state_logger.py +0 -4
  159. zrb-1.0.0a2/src/zrb/task/task.py +0 -5
  160. {zrb-1.0.0a2 → zrb-1.0.0a3}/README.md +0 -0
  161. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/attr/__init__.py +0 -0
  162. {zrb-1.0.0a2/src/zrb/callback → zrb-1.0.0a3/src/zrb/builtin/project}/__init__.py +0 -0
  163. {zrb-1.0.0a2/src/zrb/cmd → zrb-1.0.0a3/src/zrb/builtin/project/add}/__init__.py +0 -0
  164. {zrb-1.0.0a2/src/zrb/content_transformer → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template}/__init__.py +0 -0
  165. {zrb-1.0.0a2/src/zrb/context → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/common}/__init__.py +0 -0
  166. {zrb-1.0.0a2/src/zrb/dot_dict → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module}/__init__.py +0 -0
  167. {zrb-1.0.0a2/src/zrb/input → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service}/__init__.py +0 -0
  168. {zrb-1.0.0a2/src/zrb/runner → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user}/__init__.py +0 -0
  169. {zrb-1.0.0a2/src/zrb/runner/web_app → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository}/__init__.py +0 -0
  170. /zrb-1.0.0a2/src/zrb/runner/web_app/group_info_ui/__init__.py → /zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/versions/.gitkeep +0 -0
  171. {zrb-1.0.0a2/src/zrb/runner/web_app/home_page → zrb-1.0.0a3/src/zrb/builtin/project/add/fastapp_template/schema}/__init__.py +0 -0
  172. {zrb-1.0.0a2/src/zrb/runner/web_app/task_ui → zrb-1.0.0a3/src/zrb/builtin/project/create}/__init__.py +0 -0
  173. {zrb-1.0.0a2/src/zrb/session → zrb-1.0.0a3/src/zrb/builtin/shell}/__init__.py +0 -0
  174. {zrb-1.0.0a2/src/zrb/session_state_log → zrb-1.0.0a3/src/zrb/builtin/shell/autocomplete}/__init__.py +0 -0
  175. {zrb-1.0.0a2/src/zrb/session_state_logger → zrb-1.0.0a3/src/zrb/callback}/__init__.py +0 -0
  176. {zrb-1.0.0a2/src/zrb/task → zrb-1.0.0a3/src/zrb/cmd}/__init__.py +0 -0
  177. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/cmd/cmd_result.py +0 -0
  178. {zrb-1.0.0a2/src/zrb/task_status → zrb-1.0.0a3/src/zrb/content_transformer}/__init__.py +0 -0
  179. {zrb-1.0.0a2/src/zrb/util → zrb-1.0.0a3/src/zrb/context}/__init__.py +0 -0
  180. {zrb-1.0.0a2/src/zrb/util/cli → zrb-1.0.0a3/src/zrb/dot_dict}/__init__.py +0 -0
  181. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/dot_dict/dot_dict.py +0 -0
  182. {zrb-1.0.0a2/src/zrb/util/cmd → zrb-1.0.0a3/src/zrb/env}/__init__.py +0 -0
  183. {zrb-1.0.0a2/src/zrb/util/string → zrb-1.0.0a3/src/zrb/group}/__init__.py +0 -0
  184. {zrb-1.0.0a2/src/zrb/xcom → zrb-1.0.0a3/src/zrb/input}/__init__.py +0 -0
  185. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/group_info_ui/partial/group_info.html +0 -0
  186. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/group_info_ui/partial/group_li.html +0 -0
  187. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/group_info_ui/partial/task_info.html +0 -0
  188. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/group_info_ui/partial/task_li.html +0 -0
  189. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/home_page/partial/group_info.html +0 -0
  190. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/home_page/partial/group_li.html +0 -0
  191. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/home_page/partial/task_info.html +0 -0
  192. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/home_page/partial/task_li.html +0 -0
  193. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/static/favicon-32x32.png +0 -0
  194. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/static/pico.min.css +0 -0
  195. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/partial/common-util.js +0 -0
  196. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/partial/input.html +0 -0
  197. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/partial/main.js +0 -0
  198. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/partial/show-existing-session.js +0 -0
  199. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/runner/web_app/task_ui/partial/visualize-history.js +0 -0
  200. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/task_status/task_status.py +0 -0
  201. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/cmd/remote.py +0 -0
  202. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/cron.py +0 -0
  203. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/load.py +0 -0
  204. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/run.py +0 -0
  205. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/string/format.py +0 -0
  206. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/util/string/name.py +0 -0
  207. {zrb-1.0.0a2 → zrb-1.0.0a3}/src/zrb/xcom/xcom.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 1.0.0a2
4
- Summary: A Framework to Enhance Your Workflow
3
+ Version: 1.0.0a3
4
+ Summary: Your Automation Powerhouse
5
5
  Home-page: https://github.com/state-alchemists/zrb
6
6
  License: AGPL-3.0-or-later
7
7
  Keywords: Automation,Task Runner,Code Generator,Monorepo,Low Code
@@ -13,10 +13,13 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
- Requires-Dist: autopep8 (>=2.0.4,<2.1.0)
17
- Requires-Dist: python-dotenv (>=1.0.1,<1.1.0)
16
+ Requires-Dist: autopep8 (>=2.0.4,<3.0.0)
17
+ Requires-Dist: black (>=24.10.0,<24.11.0)
18
+ Requires-Dist: isort (>=5.13.2,<5.14.0)
19
+ Requires-Dist: libcst (>=1.5.0,<2.0.0)
20
+ Requires-Dist: litellm (>=1.52.12,<2.0.0)
21
+ Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
18
22
  Requires-Dist: requests (>=2.32.3,<3.0.0)
19
- Requires-Dist: tomlkit (>=0.12.4,<0.13.0)
20
23
  Project-URL: Documentation, https://github.com/state-alchemists/zrb
21
24
  Project-URL: Repository, https://github.com/state-alchemists/zrb
22
25
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "zrb"
3
- version = "1.0.0a2"
4
- description = "A Framework to Enhance Your Workflow"
3
+ version = "1.0.0a3"
4
+ description = "Your Automation Powerhouse"
5
5
  authors = ["Go Frendi Gunawan <gofrendiasgard@gmail.com>"]
6
6
  license = "AGPL-3.0-or-later"
7
7
  readme = "README.md"
@@ -39,19 +39,22 @@ exclude = [
39
39
 
40
40
  [tool.poetry.dependencies]
41
41
  python = ">=3.10.0,<4.0.0"
42
- python-dotenv = "~1.0.1"
43
- autopep8 = "~2.0.4"
44
- tomlkit = "^0.12.4"
42
+ python-dotenv = "^1.0.1"
43
+ autopep8 = "^2.0.4"
44
+ black = "~24.10.0"
45
+ isort = "~5.13.2"
45
46
  requests = "^2.32.3"
47
+ libcst = "^1.5.0"
48
+ litellm = "^1.52.12"
46
49
 
47
50
  [tool.poetry.dev-dependencies]
48
- flake8 = "~7.0.0"
49
- black = "~24.4.2"
50
- isort = "~5.13.2"
51
- pytest = "~7.4.0"
52
- pytest-cov = "~4.1.0"
53
- pytest-asyncio = "~0.21.0"
54
- flameprof = "~0.4"
51
+ flake8 = "~7.1.1"
52
+ pytest = "~8.3.3"
53
+ pytest-cov = "~6.0.0"
54
+ pytest-asyncio = "~0.24.0"
55
+
56
+ [tool.pytest.ini_options]
57
+ asyncio_default_fixture_loop_scope = "function"
55
58
 
56
59
  [tool.poetry.scripts]
57
60
  zrb = "zrb.__main__:serve_cli"
@@ -0,0 +1,105 @@
1
+ from zrb.attr.type import (
2
+ AnyAttr,
3
+ BoolAttr,
4
+ FloatAttr,
5
+ IntAttr,
6
+ StrAttr,
7
+ StrDictAttr,
8
+ fstring,
9
+ )
10
+ from zrb.callback.any_callback import AnyCallback
11
+ from zrb.callback.callback import Callback
12
+ from zrb.cmd.cmd_result import CmdResult
13
+ from zrb.cmd.cmd_val import Cmd, CmdPath
14
+ from zrb.config import SHOULD_LOAD_BUILTIN
15
+ from zrb.content_transformer.any_content_transformer import AnyContentTransformer
16
+ from zrb.content_transformer.content_transformer import ContentTransformer
17
+ from zrb.context.any_context import AnyContext
18
+ from zrb.context.any_shared_context import AnySharedContext
19
+ from zrb.context.context import Context
20
+ from zrb.context.shared_context import SharedContext
21
+ from zrb.env.any_env import AnyEnv
22
+ from zrb.env.env import Env
23
+ from zrb.env.env_file import EnvFile
24
+ from zrb.env.env_map import EnvMap
25
+ from zrb.group.any_group import AnyGroup
26
+ from zrb.group.group import Group
27
+ from zrb.input.any_input import AnyInput
28
+ from zrb.input.base_input import BaseInput
29
+ from zrb.input.bool_input import BoolInput
30
+ from zrb.input.int_input import IntInput
31
+ from zrb.input.option_input import OptionInput
32
+ from zrb.input.password_input import PasswordInput
33
+ from zrb.input.str_input import StrInput
34
+ from zrb.input.text_input import TextInput
35
+ from zrb.runner.cli import cli
36
+ from zrb.session.session import Session
37
+ from zrb.task.any_task import AnyTask
38
+ from zrb.task.base_task import BaseTask
39
+ from zrb.task.base_trigger import BaseTrigger
40
+ from zrb.task.cmd_task import CmdTask
41
+ from zrb.task.http_check import HttpCheck
42
+ from zrb.task.llm_task import LLMTask
43
+ from zrb.task.make_task import make_task
44
+ from zrb.task.rsync_task import RsyncTask
45
+ from zrb.task.scaffolder import Scaffolder
46
+ from zrb.task.scheduler import Scheduler
47
+ from zrb.task.task import Task
48
+ from zrb.task.tcp_check import TcpCheck
49
+ from zrb.util.load import load_file, load_module
50
+ from zrb.xcom.xcom import Xcom
51
+
52
+ assert load_file
53
+ assert load_module
54
+ assert fstring
55
+ assert AnyAttr
56
+ assert BoolAttr
57
+ assert IntAttr
58
+ assert FloatAttr
59
+ assert StrAttr
60
+ assert StrDictAttr
61
+ assert AnyCallback
62
+ assert Callback
63
+ assert AnyEnv
64
+ assert Env
65
+ assert EnvFile
66
+ assert EnvMap
67
+ assert AnyInput
68
+ assert BaseInput
69
+ assert BoolInput
70
+ assert Cmd
71
+ assert CmdPath
72
+ assert CmdResult
73
+ assert CmdTask
74
+ assert HttpCheck
75
+ assert TcpCheck
76
+ assert IntInput
77
+ assert OptionInput
78
+ assert PasswordInput
79
+ assert StrInput
80
+ assert TextInput
81
+ assert AnyGroup
82
+ assert Group
83
+ assert AnyTask
84
+ assert BaseTask
85
+ assert BaseTrigger
86
+ assert RsyncTask
87
+ assert Task
88
+ assert LLMTask
89
+ assert Session
90
+ assert AnyContext
91
+ assert Context
92
+ assert AnySharedContext
93
+ assert SharedContext
94
+ assert make_task
95
+ assert AnyContentTransformer
96
+ assert ContentTransformer
97
+ assert Scaffolder
98
+ assert Scheduler
99
+ assert cli
100
+ assert Xcom
101
+
102
+ if SHOULD_LOAD_BUILTIN:
103
+ from zrb import builtin
104
+
105
+ assert builtin
@@ -1,8 +1,8 @@
1
1
  import sys
2
2
 
3
- from .runner.cli import cli
4
- from .util.cli.style import stylize_error
5
- from .util.group import NodeNotFoundError
3
+ from zrb.runner.cli import cli
4
+ from zrb.util.cli.style import stylize_error
5
+ from zrb.util.group import NodeNotFoundError
6
6
 
7
7
 
8
8
  def serve_cli():
@@ -1,6 +1,6 @@
1
1
  from typing import Any, Callable
2
2
 
3
- from ..context.any_shared_context import AnySharedContext
3
+ from zrb.context.any_shared_context import AnySharedContext
4
4
 
5
5
  fstring = str
6
6
  AnyAttr = Any | fstring | Callable[[AnySharedContext], Any]
@@ -9,3 +9,4 @@ BoolAttr = bool | fstring | Callable[[AnySharedContext], bool]
9
9
  IntAttr = int | fstring | Callable[[AnySharedContext], int]
10
10
  FloatAttr = float | fstring | Callable[[AnySharedContext], float]
11
11
  StrDictAttr = dict[str, StrAttr] | Callable[[AnySharedContext], dict[str, Any]]
12
+ StrListAttr = list[StrAttr] | Callable[[AnySharedContext], list[str]]
@@ -0,0 +1,41 @@
1
+ from zrb.builtin.base64 import decode_base64, encode_base64
2
+ from zrb.builtin.git import (
3
+ get_git_diff,
4
+ git_commit,
5
+ git_pull,
6
+ git_push,
7
+ prune_local_branches,
8
+ )
9
+ from zrb.builtin.git_subtree import git_add_subtree, git_pull_subtree, git_push_subtree
10
+ from zrb.builtin.llm import llm_chat
11
+ from zrb.builtin.md5 import hash_md5, sum_md5
12
+ from zrb.builtin.project.add.fastapp import add_fastapp_to_project
13
+ from zrb.builtin.project.create.create import create_project
14
+ from zrb.builtin.python import format_python_code
15
+ from zrb.builtin.shell.autocomplete.bash import make_bash_autocomplete
16
+ from zrb.builtin.shell.autocomplete.subcmd import get_shell_subcommands
17
+ from zrb.builtin.shell.autocomplete.zsh import make_zsh_autocomplete
18
+ from zrb.builtin.todo import todo_add, todo_edit, todo_list
19
+
20
+ assert create_project
21
+ assert add_fastapp_to_project
22
+ assert get_shell_subcommands
23
+ assert make_bash_autocomplete
24
+ assert make_zsh_autocomplete
25
+ assert encode_base64
26
+ assert decode_base64
27
+ assert llm_chat
28
+ assert hash_md5
29
+ assert sum_md5
30
+ assert get_git_diff
31
+ assert prune_local_branches
32
+ assert format_python_code
33
+ assert git_commit
34
+ assert git_pull
35
+ assert git_push
36
+ assert git_add_subtree
37
+ assert git_pull_subtree
38
+ assert git_push_subtree
39
+ assert todo_list
40
+ assert todo_add
41
+ assert todo_edit
@@ -0,0 +1,32 @@
1
+ import base64
2
+
3
+ from zrb.builtin.group import base64_group
4
+ from zrb.context.any_context import AnyContext
5
+ from zrb.input.str_input import StrInput
6
+ from zrb.task.make_task import make_task
7
+
8
+
9
+ @make_task(
10
+ name="encode-base64",
11
+ input=StrInput(name="text", description="Text", prompt="Text to encode"),
12
+ description="🔐 Encode text to base64",
13
+ group=base64_group,
14
+ alias="encode",
15
+ )
16
+ def encode_base64(ctx: AnyContext) -> str:
17
+ result = base64.b64encode(ctx.input.text.encode()).decode()
18
+ ctx.print(result)
19
+ return result
20
+
21
+
22
+ @make_task(
23
+ name="decode-base64",
24
+ input=StrInput(name="text", description="Text", prompt="Text to encode"),
25
+ description="🔓 Decode base64 text",
26
+ group=base64_group,
27
+ alias="decode",
28
+ )
29
+ def decode_base64(ctx: AnyContext) -> str:
30
+ result = base64.b64decode(ctx.input.text.encode()).decode()
31
+ ctx.print(result)
32
+ return result
@@ -0,0 +1,156 @@
1
+ from zrb.builtin.group import git_branch_group, git_group
2
+ from zrb.context.any_context import AnyContext
3
+ from zrb.input.bool_input import BoolInput
4
+ from zrb.input.str_input import StrInput
5
+ from zrb.task.make_task import make_task
6
+ from zrb.util.cli.style import stylize_green, stylize_red, stylize_yellow
7
+ from zrb.util.git import (
8
+ add,
9
+ commit,
10
+ delete_branch,
11
+ get_branches,
12
+ get_current_branch,
13
+ get_diff,
14
+ pull,
15
+ push,
16
+ )
17
+
18
+
19
+ @make_task(
20
+ name="get-git-diff",
21
+ input=[
22
+ StrInput(
23
+ name="source",
24
+ description="Source branch/tag/commit",
25
+ prompt="Source branch/tag/commit",
26
+ default_str="main",
27
+ ),
28
+ StrInput(
29
+ name="current",
30
+ description="Current branch/tag/commit",
31
+ prompt="Current branch/tag/commit",
32
+ default_str="HEAD",
33
+ ),
34
+ BoolInput(
35
+ name="created",
36
+ description="Include created files",
37
+ prompt="Include created files",
38
+ default_str="True",
39
+ ),
40
+ BoolInput(
41
+ name="removed",
42
+ description="Include removed files",
43
+ prompt="Include removed files",
44
+ default_str="True",
45
+ ),
46
+ BoolInput(
47
+ name="updated",
48
+ description="Include updated files",
49
+ prompt="Include updated files",
50
+ default_str="True",
51
+ ),
52
+ ],
53
+ description="🔍 Get modified files",
54
+ group=git_group,
55
+ alias="diff",
56
+ )
57
+ def get_git_diff(ctx: AnyContext):
58
+ diff = get_diff(ctx.input.source, ctx.input.current)
59
+ result = []
60
+ decorated = []
61
+ if ctx.input.created and diff.created:
62
+ decorated += [stylize_green(f"++ {name}") for name in diff.created]
63
+ result += diff.created
64
+ if ctx.input.updated and diff.updated:
65
+ decorated += [stylize_yellow(f"+- {name}") for name in diff.updated]
66
+ result += diff.updated
67
+ if ctx.input.removed and diff.removed:
68
+ decorated += [stylize_red(f"-- {name}") for name in diff.removed]
69
+ result += diff.removed
70
+ if len(decorated) > 0:
71
+ decorated = [""] + decorated + [""]
72
+ ctx.print(
73
+ "\n" + "\n".join((f" {decorated_line}" for decorated_line in decorated))
74
+ )
75
+ return "\n".join(result)
76
+
77
+
78
+ @make_task(
79
+ name="prune-local-git-branches",
80
+ description="🧹 Prune local branches",
81
+ group=git_branch_group,
82
+ alias="prune",
83
+ )
84
+ def prune_local_branches(ctx: AnyContext):
85
+ branches = get_branches()
86
+ current_branch = get_current_branch()
87
+ for branch in branches:
88
+ if branch == current_branch or branch == "main" or branch == "master":
89
+ continue
90
+ ctx.print(stylize_yellow(f"Removing local branch: {branch}"))
91
+ try:
92
+ delete_branch(branch)
93
+ except Exception as e:
94
+ ctx.log_error(e)
95
+
96
+
97
+ @make_task(
98
+ name="git-commit",
99
+ input=StrInput(
100
+ name="message",
101
+ description="Commit message",
102
+ prompt="Commit message",
103
+ default_str="Add feature/fix bug",
104
+ ),
105
+ description="📝 Commit changes",
106
+ group=git_group,
107
+ alias="commit",
108
+ )
109
+ def git_commit(ctx: AnyContext):
110
+ ctx.print("Add changes to staging")
111
+ add()
112
+ ctx.print("Commit changes")
113
+ try:
114
+ commit(ctx.input.message)
115
+ except Exception as e:
116
+ ctx.log_error(e)
117
+
118
+
119
+ @make_task(
120
+ name="git-pull",
121
+ description="📥 Pull changes from remote repository",
122
+ input=StrInput(
123
+ name="remote",
124
+ description="Remote name",
125
+ prompt="Remote name",
126
+ default_str="origin",
127
+ ),
128
+ upstream=git_commit,
129
+ group=git_group,
130
+ alias="pull",
131
+ )
132
+ def git_pull(ctx: AnyContext):
133
+ remote = ctx.input.remote
134
+ current_branch = get_current_branch()
135
+ ctx.print(f"Pulling from {remote}/{current_branch}")
136
+ pull(remote, current_branch)
137
+
138
+
139
+ @make_task(
140
+ name="git-push",
141
+ description="📤 Push changes to remote repository",
142
+ input=StrInput(
143
+ name="remote",
144
+ description="Remote name",
145
+ prompt="Remote name",
146
+ default_str="origin",
147
+ ),
148
+ upstream=git_commit,
149
+ group=git_group,
150
+ alias="push",
151
+ )
152
+ def git_push(ctx: AnyContext):
153
+ remote = ctx.input.remote
154
+ current_branch = get_current_branch()
155
+ ctx.print(f"Pushing to {remote}/{current_branch}")
156
+ push(remote, current_branch)
@@ -0,0 +1,88 @@
1
+ from zrb.builtin.git import git_commit
2
+ from zrb.builtin.group import git_subtree_group
3
+ from zrb.context.any_context import AnyContext
4
+ from zrb.input.str_input import StrInput
5
+ from zrb.task.make_task import make_task
6
+ from zrb.util.git_subtree import add_subtree, load_config, pull_subtree, push_subtree
7
+
8
+
9
+ @make_task(
10
+ name="git-add-subtree",
11
+ input=[
12
+ StrInput(
13
+ name="name", description="Subtree config name", prompt="Subtree config name"
14
+ ),
15
+ StrInput(
16
+ name="repo-url", description="Subtree repo URL", prompt="Subtree repo URL"
17
+ ),
18
+ StrInput(
19
+ name="repo-branch",
20
+ description="Subtree repo branch",
21
+ prompt="Subtree repo branch",
22
+ ),
23
+ StrInput(
24
+ name="repo-prefix",
25
+ description="Subtree repo prefix",
26
+ prompt="Subtree repo prefix",
27
+ ),
28
+ ],
29
+ description="➕ Add subtree",
30
+ upstream=git_commit,
31
+ group=git_subtree_group,
32
+ alias="add",
33
+ )
34
+ def git_add_subtree(ctx: AnyContext):
35
+ add_subtree(
36
+ name=ctx.input.name,
37
+ repo_url=ctx.input["repo-url"],
38
+ branch=ctx.input["repo-branch"],
39
+ prefix=ctx.input["repo-prefix"],
40
+ )
41
+
42
+
43
+ @make_task(
44
+ name="git-pull-subtree",
45
+ description="📥 Pull subtree",
46
+ upstream=git_commit,
47
+ group=git_subtree_group,
48
+ alias="pull",
49
+ )
50
+ def git_pull_subtree(ctx: AnyContext):
51
+ config = load_config()
52
+ if not config.data:
53
+ raise ValueError("No subtree config found")
54
+ first_err: Exception | None = None
55
+ for name, detail in config.data.items():
56
+ try:
57
+ ctx.print(f"Pull from subtree {name}")
58
+ pull_subtree(detail.prefix, detail.repo_url, detail.branch)
59
+ except Exception as e:
60
+ if first_err is None:
61
+ first_err = e
62
+ ctx.log_error(e)
63
+ if first_err is not None:
64
+ raise first_err
65
+
66
+
67
+ @make_task(
68
+ name="git-push-subtree",
69
+ description="📤 Push subtree",
70
+ upstream=git_commit,
71
+ group=git_subtree_group,
72
+ alias="push",
73
+ )
74
+ def git_push_subtree(ctx: AnyContext):
75
+ config = load_config()
76
+ if not config.data:
77
+ raise ValueError("No subtree config found")
78
+ first_err: Exception | None = None
79
+ for name, detail in config.data.items():
80
+ try:
81
+ ctx.print(f"Push to subtree {name}")
82
+ push_subtree(detail.prefix, detail.repo_url, detail.branch)
83
+ except Exception as e:
84
+ if first_err is None:
85
+ first_err = e
86
+ ctx.log_error(e)
87
+ if first_err is not None:
88
+ raise first_err
@@ -0,0 +1,34 @@
1
+ from zrb.group.group import Group
2
+ from zrb.runner.cli import cli
3
+
4
+ base64_group = cli.add_group(Group(name="base64", description="📄 Base64 operations"))
5
+ git_group = cli.add_group(Group(name="git", description="🌱 Git related commands"))
6
+ git_branch_group = git_group.add_group(
7
+ Group(name="branch", description="🌿 Git branch related commands")
8
+ )
9
+ git_subtree_group = git_group.add_group(
10
+ Group(name="subtree", description="🌳 Git subtree related commands")
11
+ )
12
+ llm_group = cli.add_group(Group(name="llm", description="🤖 LLM operations"))
13
+ md5_group = cli.add_group(Group(name="md5", description="🔢 Md5 operations"))
14
+ python_group = cli.add_group(
15
+ Group(name="python", description="🐍 Python related commands")
16
+ )
17
+ todo_group = cli.add_group(Group(name="todo", description="✅ Todo management"))
18
+
19
+ shell_group = cli.add_group(
20
+ Group(name="shell", description="💬 Shell related commands")
21
+ )
22
+ shell_autocomplete_group: Group = shell_group.add_group(
23
+ Group(name="autocomplete", description="⌨️ Shell autocomplete related commands")
24
+ )
25
+
26
+ project_group = cli.add_group(
27
+ Group(name="project", description="📁 Project related commands")
28
+ )
29
+ add_to_project_group = project_group.add_group(
30
+ Group(name="add", description="➕ Add things to project")
31
+ )
32
+ add_fastapp_to_project_group = add_to_project_group.add_group(
33
+ Group(name="fastapp", description="🚀 Add Fastapp resources")
34
+ )
@@ -0,0 +1,31 @@
1
+ from zrb.builtin.group import llm_group
2
+ from zrb.config import LLM_MODEL, LLM_SYSTEM_PROMPT
3
+ from zrb.input.str_input import StrInput
4
+ from zrb.input.text_input import TextInput
5
+ from zrb.task.llm_task import LLMTask
6
+
7
+ llm_chat = llm_group.add_task(
8
+ LLMTask(
9
+ name="llm-chat",
10
+ input=[
11
+ StrInput(
12
+ "model",
13
+ description="LLM Model",
14
+ prompt="LLM Model",
15
+ default_str=LLM_MODEL,
16
+ ),
17
+ StrInput(
18
+ "system-prompt",
19
+ description="System prompt",
20
+ prompt="System prompt",
21
+ default_str=LLM_SYSTEM_PROMPT,
22
+ ),
23
+ TextInput("message", description="User message", prompt="Your message"),
24
+ ],
25
+ description="Chat with LLM",
26
+ model="{ctx.input.model}",
27
+ system_prompt="{ctx.input['system-prompt']}",
28
+ message="{ctx.input.message}",
29
+ ),
30
+ alias="chat",
31
+ )
@@ -0,0 +1,34 @@
1
+ import hashlib
2
+
3
+ from zrb.builtin.group import md5_group
4
+ from zrb.context.any_context import AnyContext
5
+ from zrb.input.str_input import StrInput
6
+ from zrb.task.make_task import make_task
7
+
8
+
9
+ @make_task(
10
+ name="hash-md5",
11
+ input=StrInput(name="text", description="Text", prompt="Text to encode"),
12
+ description="🧩 Hash text to md5",
13
+ group=md5_group,
14
+ alias="hash",
15
+ )
16
+ def hash_md5(ctx: AnyContext) -> str:
17
+ result = hashlib.md5(ctx.input.text.encode()).hexdigest()
18
+ ctx.print(result)
19
+ return result
20
+
21
+
22
+ @make_task(
23
+ name="sum-md5",
24
+ input=StrInput(name="file", description="File name", prompt="File name"),
25
+ description="➕ Get md5 checksum of a file",
26
+ group=md5_group,
27
+ alias="sum",
28
+ )
29
+ def sum_md5(ctx: AnyContext) -> str:
30
+ with open(ctx.input.file, mode="rb") as file:
31
+ content = file.read()
32
+ result = hashlib.md5(content).hexdigest()
33
+ ctx.print(result)
34
+ return result