zrb 1.0.0a3__tar.gz → 1.0.0a4__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.
- {zrb-1.0.0a3 → zrb-1.0.0a4}/PKG-INFO +6 -1
- {zrb-1.0.0a3 → zrb-1.0.0a4}/pyproject.toml +9 -1
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/__init__.py +2 -2
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/__main__.py +3 -1
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/__init__.py +4 -2
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/base64.py +4 -2
- zrb-1.0.0a3/src/zrb/builtin/llm.py → zrb-1.0.0a4/src/zrb/builtin/llm/llm_chat.py +18 -2
- zrb-1.0.0a4/src/zrb/builtin/llm/tool/cli.py +9 -0
- zrb-1.0.0a4/src/zrb/builtin/llm/tool/rag.py +189 -0
- zrb-1.0.0a4/src/zrb/builtin/llm/tool/web.py +74 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/md5.py +4 -2
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp.py +1 -1
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/_zrb/helper.py +3 -3
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/_zrb/main.py +1 -1
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/create/create.py +1 -1
- zrb-1.0.0a4/src/zrb/builtin/todo.py +219 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/config.py +12 -2
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/runner/cli.py +8 -7
- zrb-1.0.0a3/src/zrb/runner/web_server.py → zrb-1.0.0a4/src/zrb/runner/web_app.py +13 -13
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/controller.py +2 -2
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/controller.py +2 -2
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/controller.py +2 -2
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/cmd_task.py +24 -26
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/http_check.py +5 -5
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/llm_task.py +91 -36
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/rsync_task.py +18 -18
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/scaffolder.py +4 -4
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/tcp_check.py +3 -5
- zrb-1.0.0a4/src/zrb/util/todo.py +259 -0
- zrb-1.0.0a3/src/zrb/builtin/todo.py +0 -186
- zrb-1.0.0a3/src/zrb/util/todo.py +0 -135
- {zrb-1.0.0a3 → zrb-1.0.0a4}/README.md +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/attr/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/attr/type.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/git.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/git_subtree.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/group.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/.gitignore +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/README.md +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/_zrb/config.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/_zrb/group.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/_zrb/venv_task.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/app.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/db_engine.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/db_repository.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/error.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/schema.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/common/usecase.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/config.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/main.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/migrate.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/alembic.ini +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/api_client.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/base_client.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/direct_client.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/client/factory.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/README +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/env.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/script.py.mako +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration/versions/3093c7336477_add_user_table.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/migration_metadata.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/route.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/db_repository.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/factory.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/repository/repository.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/auth/service/user/usecase.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/alembic.ini +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/README +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/env.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/script.py.mako +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration/versions/.gitkeep +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/migration_metadata.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/module/gateway/route.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/requirements.txt +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/schema/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/schema/role.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/schema/user.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/add/fastapp_template/template.env +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/create/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/create/project-template/README.md +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/project/create/project-template/zrb_init.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/python.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/shell/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/shell/autocomplete/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/shell/autocomplete/bash.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/shell/autocomplete/subcmd.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/builtin/shell/autocomplete/zsh.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/callback/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/callback/any_callback.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/callback/callback.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/cmd/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/cmd/cmd_result.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/cmd/cmd_val.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/content_transformer/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/content_transformer/any_content_transformer.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/content_transformer/content_transformer.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/context/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/context/any_context.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/context/any_shared_context.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/context/context.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/context/shared_context.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/dot_dict/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/dot_dict/dot_dict.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/env/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/env/any_env.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/env/env.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/env/env_file.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/env/env_map.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/group/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/group/any_group.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/group/group.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/any_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/base_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/bool_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/float_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/int_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/option_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/password_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/str_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/input/text_input.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/runner/__init__.py +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/__init__.py +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/__init__.py +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/partial/group_info.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/partial/group_li.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/partial/task_info.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/partial/task_li.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/group_info_ui/view.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/__init__.py +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/partial/group_info.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/partial/group_li.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/partial/task_info.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/partial/task_li.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/home_page/view.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/static/favicon-32x32.png +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/static/pico.min.css +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/__init__.py +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/partial/common-util.js +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/partial/input.html +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/partial/main.js +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/partial/show-existing-session.js +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/partial/visualize-history.js +0 -0
- {zrb-1.0.0a3/src/zrb/runner/web_app → zrb-1.0.0a4/src/zrb/runner/web_controller}/task_ui/view.html +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/runner/web_util.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session/any_session.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session/session.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session_state_log/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session_state_log/session_state_log.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session_state_logger/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session_state_logger/any_session_state_logger.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session_state_logger/default_session_state_logger.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/session_state_logger/file_session_state_logger.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/any_task.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/base_task.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/base_trigger.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/make_task.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/scheduler.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task/task.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task_status/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/task_status/task_status.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/attr.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/cli/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/cli/style.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/cli/subcommand.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/cmd/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/cmd/remote.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/add_code_to_class.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/add_code_to_function.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/add_code_to_method.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/add_key_to_dict.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/add_param_to_function_call.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/codemod/add_property_to_class.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/cron.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/git.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/git_subtree.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/group.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/llm/tool.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/load.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/run.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/string/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/string/conversion.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/string/format.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/util/string/name.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/xcom/__init__.py +0 -0
- {zrb-1.0.0a3 → zrb-1.0.0a4}/src/zrb/xcom/xcom.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: zrb
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.0a4
|
4
4
|
Summary: Your Automation Powerhouse
|
5
5
|
Home-page: https://github.com/state-alchemists/zrb
|
6
6
|
License: AGPL-3.0-or-later
|
@@ -13,11 +13,16 @@ 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
|
+
Provides-Extra: rag
|
16
17
|
Requires-Dist: autopep8 (>=2.0.4,<3.0.0)
|
18
|
+
Requires-Dist: beautifulsoup4 (>=4.12.3,<5.0.0)
|
17
19
|
Requires-Dist: black (>=24.10.0,<24.11.0)
|
20
|
+
Requires-Dist: chromadb (>=0.5.20,<0.6.0) ; extra == "rag"
|
21
|
+
Requires-Dist: fastapi[standard] (>=0.115.5,<0.116.0)
|
18
22
|
Requires-Dist: isort (>=5.13.2,<5.14.0)
|
19
23
|
Requires-Dist: libcst (>=1.5.0,<2.0.0)
|
20
24
|
Requires-Dist: litellm (>=1.52.12,<2.0.0)
|
25
|
+
Requires-Dist: pdfplumber (>=0.11.4,<0.12.0) ; extra == "rag"
|
21
26
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
22
27
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
23
28
|
Project-URL: Documentation, https://github.com/state-alchemists/zrb
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "zrb"
|
3
|
-
version = "1.0.
|
3
|
+
version = "1.0.0a4"
|
4
4
|
description = "Your Automation Powerhouse"
|
5
5
|
authors = ["Go Frendi Gunawan <gofrendiasgard@gmail.com>"]
|
6
6
|
license = "AGPL-3.0-or-later"
|
@@ -46,6 +46,14 @@ isort = "~5.13.2"
|
|
46
46
|
requests = "^2.32.3"
|
47
47
|
libcst = "^1.5.0"
|
48
48
|
litellm = "^1.52.12"
|
49
|
+
chromadb = {version = "^0.5.20", optional = true}
|
50
|
+
pdfplumber = {version = "^0.11.4", optional = true}
|
51
|
+
beautifulsoup4 = "^4.12.3"
|
52
|
+
fastapi = {extras = ["standard"], version = "^0.115.5"}
|
53
|
+
|
54
|
+
[tool.poetry.extras]
|
55
|
+
# poetry install -E rag
|
56
|
+
rag = ["chromadb", "pdfplumber"]
|
49
57
|
|
50
58
|
[tool.poetry.dev-dependencies]
|
51
59
|
flake8 = "~7.1.1"
|
@@ -11,7 +11,7 @@ from zrb.callback.any_callback import AnyCallback
|
|
11
11
|
from zrb.callback.callback import Callback
|
12
12
|
from zrb.cmd.cmd_result import CmdResult
|
13
13
|
from zrb.cmd.cmd_val import Cmd, CmdPath
|
14
|
-
from zrb.config import
|
14
|
+
from zrb.config import LOAD_BUILTIN
|
15
15
|
from zrb.content_transformer.any_content_transformer import AnyContentTransformer
|
16
16
|
from zrb.content_transformer.content_transformer import ContentTransformer
|
17
17
|
from zrb.context.any_context import AnyContext
|
@@ -99,7 +99,7 @@ assert Scheduler
|
|
99
99
|
assert cli
|
100
100
|
assert Xcom
|
101
101
|
|
102
|
-
if
|
102
|
+
if LOAD_BUILTIN:
|
103
103
|
from zrb import builtin
|
104
104
|
|
105
105
|
assert builtin
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import sys
|
2
2
|
|
3
3
|
from zrb.runner.cli import cli
|
4
|
-
from zrb.util.cli.style import stylize_error
|
4
|
+
from zrb.util.cli.style import stylize_error, stylize_warning
|
5
5
|
from zrb.util.group import NodeNotFoundError
|
6
6
|
|
7
7
|
|
8
8
|
def serve_cli():
|
9
9
|
try:
|
10
10
|
cli.run(sys.argv[1:])
|
11
|
+
except KeyboardInterrupt:
|
12
|
+
print(stylize_warning("\nStopped"), file=sys.stderr)
|
11
13
|
except NodeNotFoundError as e:
|
12
14
|
print(stylize_error(f"{e}"), file=sys.stderr)
|
@@ -7,7 +7,7 @@ from zrb.builtin.git import (
|
|
7
7
|
prune_local_branches,
|
8
8
|
)
|
9
9
|
from zrb.builtin.git_subtree import git_add_subtree, git_pull_subtree, git_push_subtree
|
10
|
-
from zrb.builtin.llm import llm_chat
|
10
|
+
from zrb.builtin.llm.llm_chat import llm_chat
|
11
11
|
from zrb.builtin.md5 import hash_md5, sum_md5
|
12
12
|
from zrb.builtin.project.add.fastapp import add_fastapp_to_project
|
13
13
|
from zrb.builtin.project.create.create import create_project
|
@@ -15,7 +15,7 @@ from zrb.builtin.python import format_python_code
|
|
15
15
|
from zrb.builtin.shell.autocomplete.bash import make_bash_autocomplete
|
16
16
|
from zrb.builtin.shell.autocomplete.subcmd import get_shell_subcommands
|
17
17
|
from zrb.builtin.shell.autocomplete.zsh import make_zsh_autocomplete
|
18
|
-
from zrb.builtin.todo import todo_add, todo_edit, todo_list
|
18
|
+
from zrb.builtin.todo import todo_add, todo_complete, todo_edit, todo_list, todo_log
|
19
19
|
|
20
20
|
assert create_project
|
21
21
|
assert add_fastapp_to_project
|
@@ -39,3 +39,5 @@ assert git_push_subtree
|
|
39
39
|
assert todo_list
|
40
40
|
assert todo_add
|
41
41
|
assert todo_edit
|
42
|
+
assert todo_complete
|
43
|
+
assert todo_log
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import base64
|
2
|
-
|
3
1
|
from zrb.builtin.group import base64_group
|
4
2
|
from zrb.context.any_context import AnyContext
|
5
3
|
from zrb.input.str_input import StrInput
|
@@ -14,6 +12,8 @@ from zrb.task.make_task import make_task
|
|
14
12
|
alias="encode",
|
15
13
|
)
|
16
14
|
def encode_base64(ctx: AnyContext) -> str:
|
15
|
+
import base64
|
16
|
+
|
17
17
|
result = base64.b64encode(ctx.input.text.encode()).decode()
|
18
18
|
ctx.print(result)
|
19
19
|
return result
|
@@ -27,6 +27,8 @@ def encode_base64(ctx: AnyContext) -> str:
|
|
27
27
|
alias="decode",
|
28
28
|
)
|
29
29
|
def decode_base64(ctx: AnyContext) -> str:
|
30
|
+
import base64
|
31
|
+
|
30
32
|
result = base64.b64decode(ctx.input.text.encode()).decode()
|
31
33
|
ctx.print(result)
|
32
34
|
return result
|
@@ -1,10 +1,18 @@
|
|
1
1
|
from zrb.builtin.group import llm_group
|
2
|
-
from zrb.
|
2
|
+
from zrb.builtin.llm.tool.cli import run_shell_command
|
3
|
+
from zrb.builtin.llm.tool.web import open_web_page, query_internet
|
4
|
+
from zrb.config import (
|
5
|
+
LLM_ALLOW_ACCESS_SHELL,
|
6
|
+
LLM_ALLOW_ACCESS_WEB,
|
7
|
+
LLM_HISTORY_FILE,
|
8
|
+
LLM_MODEL,
|
9
|
+
LLM_SYSTEM_PROMPT,
|
10
|
+
)
|
3
11
|
from zrb.input.str_input import StrInput
|
4
12
|
from zrb.input.text_input import TextInput
|
5
13
|
from zrb.task.llm_task import LLMTask
|
6
14
|
|
7
|
-
llm_chat = llm_group.add_task(
|
15
|
+
llm_chat: LLMTask = llm_group.add_task(
|
8
16
|
LLMTask(
|
9
17
|
name="llm-chat",
|
10
18
|
input=[
|
@@ -22,6 +30,7 @@ llm_chat = llm_group.add_task(
|
|
22
30
|
),
|
23
31
|
TextInput("message", description="User message", prompt="Your message"),
|
24
32
|
],
|
33
|
+
history_file=LLM_HISTORY_FILE,
|
25
34
|
description="Chat with LLM",
|
26
35
|
model="{ctx.input.model}",
|
27
36
|
system_prompt="{ctx.input['system-prompt']}",
|
@@ -29,3 +38,10 @@ llm_chat = llm_group.add_task(
|
|
29
38
|
),
|
30
39
|
alias="chat",
|
31
40
|
)
|
41
|
+
|
42
|
+
if LLM_ALLOW_ACCESS_SHELL:
|
43
|
+
llm_chat.add_tool(run_shell_command)
|
44
|
+
|
45
|
+
if LLM_ALLOW_ACCESS_WEB:
|
46
|
+
llm_chat.add_tool(open_web_page)
|
47
|
+
llm_chat.add_tool(query_internet)
|
@@ -0,0 +1,189 @@
|
|
1
|
+
import json
|
2
|
+
import os
|
3
|
+
import sys
|
4
|
+
from collections.abc import Callable, Iterable
|
5
|
+
|
6
|
+
import litellm
|
7
|
+
|
8
|
+
from zrb.config import (
|
9
|
+
RAG_CHUNK_SIZE,
|
10
|
+
RAG_EMBEDDING_MODEL,
|
11
|
+
RAG_MAX_RESULT_COUNT,
|
12
|
+
RAG_OVERLAP,
|
13
|
+
)
|
14
|
+
from zrb.util.cli.style import stylize_error, stylize_faint
|
15
|
+
from zrb.util.run import run_async
|
16
|
+
|
17
|
+
Document = str | Callable[[], str]
|
18
|
+
Documents = Callable[[], Iterable[Document]] | Iterable[Document]
|
19
|
+
|
20
|
+
|
21
|
+
def create_rag_from_directory(
|
22
|
+
tool_name: str,
|
23
|
+
tool_description: str,
|
24
|
+
document_dir_path: str = "./documents",
|
25
|
+
model: str = RAG_EMBEDDING_MODEL,
|
26
|
+
vector_db_path: str = "./chroma",
|
27
|
+
vector_db_collection: str = "documents",
|
28
|
+
chunk_size: int = RAG_CHUNK_SIZE,
|
29
|
+
overlap: int = RAG_OVERLAP,
|
30
|
+
max_result_count: int = RAG_MAX_RESULT_COUNT,
|
31
|
+
):
|
32
|
+
return create_rag(
|
33
|
+
tool_name=tool_name,
|
34
|
+
tool_description=tool_description,
|
35
|
+
documents=get_rag_documents(os.path.expanduser(document_dir_path)),
|
36
|
+
model=model,
|
37
|
+
vector_db_path=vector_db_path,
|
38
|
+
vector_db_collection=vector_db_collection,
|
39
|
+
reset_db=get_rag_reset_db(
|
40
|
+
document_dir_path=os.path.expanduser(document_dir_path),
|
41
|
+
vector_db_path=os.path.expanduser(vector_db_path),
|
42
|
+
),
|
43
|
+
chunk_size=chunk_size,
|
44
|
+
overlap=overlap,
|
45
|
+
max_result_count=max_result_count,
|
46
|
+
)
|
47
|
+
|
48
|
+
|
49
|
+
def create_rag(
|
50
|
+
tool_name: str,
|
51
|
+
tool_description: str,
|
52
|
+
documents: Documents = [],
|
53
|
+
model: str = RAG_EMBEDDING_MODEL,
|
54
|
+
vector_db_path: str = "./chroma",
|
55
|
+
vector_db_collection: str = "documents",
|
56
|
+
reset_db: Callable[[], bool] | bool = False,
|
57
|
+
chunk_size: int = RAG_CHUNK_SIZE,
|
58
|
+
overlap: int = RAG_OVERLAP,
|
59
|
+
max_result_count: int = RAG_MAX_RESULT_COUNT,
|
60
|
+
) -> Callable[[str], str]:
|
61
|
+
async def retrieve(query: str) -> str:
|
62
|
+
import chromadb
|
63
|
+
from chromadb.config import Settings
|
64
|
+
|
65
|
+
is_db_exist = os.path.isdir(vector_db_path)
|
66
|
+
client = chromadb.PersistentClient(
|
67
|
+
path=vector_db_path, settings=Settings(allow_reset=True)
|
68
|
+
)
|
69
|
+
should_reset_db = (
|
70
|
+
await run_async(reset_db()) if callable(reset_db) else reset_db
|
71
|
+
)
|
72
|
+
if (not is_db_exist) or should_reset_db:
|
73
|
+
client.reset()
|
74
|
+
collection = client.get_or_create_collection(vector_db_collection)
|
75
|
+
chunk_index = 0
|
76
|
+
print(stylize_faint("Scanning documents"), file=sys.stderr)
|
77
|
+
docs = await run_async(documents()) if callable(documents) else documents
|
78
|
+
for document in docs:
|
79
|
+
if callable(document):
|
80
|
+
try:
|
81
|
+
document = await run_async(document())
|
82
|
+
except Exception as error:
|
83
|
+
print(stylize_error(f"Error: {error}"), file=sys.stderr)
|
84
|
+
continue
|
85
|
+
for i in range(0, len(document), chunk_size - overlap):
|
86
|
+
chunk = document[i : i + chunk_size]
|
87
|
+
if len(chunk) > 0:
|
88
|
+
print(
|
89
|
+
stylize_faint(f"Vectorize chunk {chunk_index}"),
|
90
|
+
file=sys.stderr,
|
91
|
+
)
|
92
|
+
response = await litellm.aembedding(model=model, input=[chunk])
|
93
|
+
vector = response["data"][0]["embedding"]
|
94
|
+
print(
|
95
|
+
stylize_faint(f"Adding chunk {chunk_index} to db"),
|
96
|
+
file=sys.stderr,
|
97
|
+
)
|
98
|
+
collection.upsert(
|
99
|
+
ids=[f"id{chunk_index}"],
|
100
|
+
embeddings=[vector],
|
101
|
+
documents=[chunk],
|
102
|
+
)
|
103
|
+
chunk_index += 1
|
104
|
+
collection = client.get_or_create_collection(vector_db_collection)
|
105
|
+
# Generate embedding for the query
|
106
|
+
print(stylize_faint("Vectorize query"), file=sys.stderr)
|
107
|
+
query_response = await litellm.aembedding(model=model, input=[query])
|
108
|
+
print(stylize_faint("Search documents"), file=sys.stderr)
|
109
|
+
# Search for the top_k most similar documents
|
110
|
+
results = collection.query(
|
111
|
+
query_embeddings=query_response["data"][0]["embedding"],
|
112
|
+
n_results=max_result_count,
|
113
|
+
)
|
114
|
+
return json.dumps(results)
|
115
|
+
|
116
|
+
retrieve.__name__ = tool_name
|
117
|
+
retrieve.__doc__ = tool_description
|
118
|
+
return retrieve
|
119
|
+
|
120
|
+
|
121
|
+
def get_rag_documents(document_dir_path: str) -> Callable[[], list[Callable[[], str]]]:
|
122
|
+
def get_documents() -> list[Callable[[], str]]:
|
123
|
+
# Walk through the directory
|
124
|
+
readers = []
|
125
|
+
for root, _, files in os.walk(document_dir_path):
|
126
|
+
for file in files:
|
127
|
+
file_path = os.path.join(root, file)
|
128
|
+
if file_path.lower().endswith(".pdf"):
|
129
|
+
readers.append(_get_pdf_reader(file_path))
|
130
|
+
continue
|
131
|
+
readers.append(_get_text_reader(file_path))
|
132
|
+
return readers
|
133
|
+
|
134
|
+
return get_documents
|
135
|
+
|
136
|
+
|
137
|
+
def _get_text_reader(file_path: str):
|
138
|
+
def read():
|
139
|
+
print(stylize_faint(f"Start reading {file_path}"), file=sys.stderr)
|
140
|
+
with open(file_path, "r", encoding="utf-8") as f:
|
141
|
+
content = f.read()
|
142
|
+
print(stylize_faint(f"Complete reading {file_path}"), file=sys.stderr)
|
143
|
+
return content
|
144
|
+
|
145
|
+
return read
|
146
|
+
|
147
|
+
|
148
|
+
def _get_pdf_reader(file_path):
|
149
|
+
def read():
|
150
|
+
import pdfplumber
|
151
|
+
|
152
|
+
print(stylize_faint(f"Start reading {file_path}"), file=sys.stderr)
|
153
|
+
contents = []
|
154
|
+
with pdfplumber.open(file_path) as pdf:
|
155
|
+
for page in pdf.pages:
|
156
|
+
contents.append(page.extract_text())
|
157
|
+
print(stylize_faint(f"Complete reading {file_path}"), file=sys.stderr)
|
158
|
+
return "\n".join(contents)
|
159
|
+
|
160
|
+
return read
|
161
|
+
|
162
|
+
|
163
|
+
def get_rag_reset_db(
|
164
|
+
document_dir_path: str, vector_db_path: str = "./chroma"
|
165
|
+
) -> Callable[[], bool]:
|
166
|
+
def should_reset_db() -> bool:
|
167
|
+
document_exist = os.path.isdir(document_dir_path)
|
168
|
+
if not document_exist:
|
169
|
+
raise ValueError(f"Document directory not exists: {document_dir_path}")
|
170
|
+
vector_db_exist = os.path.isdir(vector_db_path)
|
171
|
+
if not vector_db_exist:
|
172
|
+
return True
|
173
|
+
document_mtime = _get_most_recent_mtime(document_dir_path)
|
174
|
+
vector_db_mtime = _get_most_recent_mtime(vector_db_path)
|
175
|
+
return document_mtime > vector_db_mtime
|
176
|
+
|
177
|
+
return should_reset_db
|
178
|
+
|
179
|
+
|
180
|
+
def _get_most_recent_mtime(directory):
|
181
|
+
most_recent_mtime = 0
|
182
|
+
for root, dirs, files in os.walk(directory):
|
183
|
+
# Check mtime for directories
|
184
|
+
for name in dirs + files:
|
185
|
+
file_path = os.path.join(root, name)
|
186
|
+
mtime = os.path.getmtime(file_path)
|
187
|
+
if mtime > most_recent_mtime:
|
188
|
+
most_recent_mtime = mtime
|
189
|
+
return most_recent_mtime
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import json
|
2
|
+
from typing import Annotated
|
3
|
+
|
4
|
+
|
5
|
+
def open_web_page(url: str) -> str:
|
6
|
+
"""Get content from a web page."""
|
7
|
+
import requests
|
8
|
+
|
9
|
+
response = requests.get(
|
10
|
+
url,
|
11
|
+
headers={
|
12
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" # noqa
|
13
|
+
},
|
14
|
+
)
|
15
|
+
if response.status_code != 200:
|
16
|
+
raise Exception(
|
17
|
+
f"Error: Unable to retrieve search results (status code: {response.status_code})" # noqa
|
18
|
+
)
|
19
|
+
return json.dumps(parse_html_text(response.text))
|
20
|
+
|
21
|
+
|
22
|
+
def query_internet(
|
23
|
+
query: Annotated[str, "Search query"],
|
24
|
+
num_results: Annotated[int, "Search result count, by default 10"] = 10,
|
25
|
+
) -> str:
|
26
|
+
"""Search factual information from the internet by using Google."""
|
27
|
+
import requests
|
28
|
+
|
29
|
+
response = requests.get(
|
30
|
+
"https://google.com/search",
|
31
|
+
headers={
|
32
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" # noqa
|
33
|
+
},
|
34
|
+
params={
|
35
|
+
"q": query,
|
36
|
+
"num": num_results,
|
37
|
+
"hl": "en",
|
38
|
+
"safe": "off",
|
39
|
+
},
|
40
|
+
)
|
41
|
+
if response.status_code != 200:
|
42
|
+
raise Exception(
|
43
|
+
f"Error: Unable to retrieve search results (status code: {response.status_code})" # noqa
|
44
|
+
)
|
45
|
+
return json.dumps(parse_html_text(response.text))
|
46
|
+
|
47
|
+
|
48
|
+
def parse_html_text(html_text: str) -> dict[str, str]:
|
49
|
+
from bs4 import BeautifulSoup
|
50
|
+
|
51
|
+
ignored_tags = [
|
52
|
+
"script",
|
53
|
+
"link",
|
54
|
+
"meta",
|
55
|
+
"style",
|
56
|
+
"code",
|
57
|
+
"footer",
|
58
|
+
"nav",
|
59
|
+
"header",
|
60
|
+
"aside",
|
61
|
+
]
|
62
|
+
soup = BeautifulSoup(html_text, "html.parser")
|
63
|
+
links = []
|
64
|
+
for anchor in soup.find_all("a"):
|
65
|
+
if not anchor or "href" not in anchor.attrs:
|
66
|
+
continue
|
67
|
+
link: str = anchor["href"]
|
68
|
+
if link.startswith("#") or link.startswith("/"):
|
69
|
+
continue
|
70
|
+
links.append(link)
|
71
|
+
for tag in soup(ignored_tags):
|
72
|
+
tag.decompose()
|
73
|
+
html_text = soup.get_text(separator=" ", strip=True)
|
74
|
+
return {"content": html_text, "links_on_page": links}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import hashlib
|
2
|
-
|
3
1
|
from zrb.builtin.group import md5_group
|
4
2
|
from zrb.context.any_context import AnyContext
|
5
3
|
from zrb.input.str_input import StrInput
|
@@ -14,6 +12,8 @@ from zrb.task.make_task import make_task
|
|
14
12
|
alias="hash",
|
15
13
|
)
|
16
14
|
def hash_md5(ctx: AnyContext) -> str:
|
15
|
+
import hashlib
|
16
|
+
|
17
17
|
result = hashlib.md5(ctx.input.text.encode()).hexdigest()
|
18
18
|
ctx.print(result)
|
19
19
|
return result
|
@@ -27,6 +27,8 @@ def hash_md5(ctx: AnyContext) -> str:
|
|
27
27
|
alias="sum",
|
28
28
|
)
|
29
29
|
def sum_md5(ctx: AnyContext) -> str:
|
30
|
+
import hashlib
|
31
|
+
|
30
32
|
with open(ctx.input.file, mode="rb") as file:
|
31
33
|
content = file.read()
|
32
34
|
result = hashlib.md5(content).hexdigest()
|
@@ -29,7 +29,7 @@ scaffold_fastapp = Scaffolder(
|
|
29
29
|
),
|
30
30
|
],
|
31
31
|
source_path=os.path.join(_DIR, "fastapp_template"),
|
32
|
-
|
32
|
+
render_source_path=False,
|
33
33
|
destination_path=lambda ctx: os.path.join(
|
34
34
|
ctx.input["project-dir"], ctx.input["app-name"]
|
35
35
|
),
|
@@ -39,7 +39,7 @@ def create_migration(name: str, module: str) -> Task:
|
|
39
39
|
auto_render=True,
|
40
40
|
),
|
41
41
|
],
|
42
|
-
|
42
|
+
render_cmd=False,
|
43
43
|
retries=2,
|
44
44
|
)
|
45
45
|
|
@@ -68,7 +68,7 @@ def migrate_module(name: str, module: str, as_microservices: bool) -> Task:
|
|
68
68
|
f"cd {os.path.join(APP_DIR, 'module', module)}",
|
69
69
|
"alembic upgrade head",
|
70
70
|
],
|
71
|
-
|
71
|
+
render_cmd=False,
|
72
72
|
retries=2,
|
73
73
|
)
|
74
74
|
|
@@ -92,6 +92,6 @@ def run_microservice(name: str, port: int, module: str) -> Task:
|
|
92
92
|
ACTIVATE_VENV_SCRIPT,
|
93
93
|
'fastapi dev main.py --port "${APP_NAME_PORT}"',
|
94
94
|
],
|
95
|
-
|
95
|
+
render_cmd=False,
|
96
96
|
retries=2,
|
97
97
|
)
|
@@ -25,7 +25,7 @@ scaffold_project = Scaffolder(
|
|
25
25
|
),
|
26
26
|
],
|
27
27
|
source_path=os.path.join(_DIR, "project-template"),
|
28
|
-
|
28
|
+
render_source_path=False,
|
29
29
|
destination_path="{ctx.input['project-dir']}",
|
30
30
|
transform_content={"Project Name": "{ctx.input['project-name'].title()}"},
|
31
31
|
retries=0,
|