zrb 1.8.10__py3-none-any.whl → 1.21.29__py3-none-any.whl

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.

Potentially problematic release.


This version of zrb might be problematic. Click here for more details.

Files changed (147) hide show
  1. zrb/__init__.py +126 -113
  2. zrb/__main__.py +1 -1
  3. zrb/attr/type.py +10 -7
  4. zrb/builtin/__init__.py +2 -50
  5. zrb/builtin/git.py +12 -1
  6. zrb/builtin/group.py +31 -15
  7. zrb/builtin/http.py +7 -8
  8. zrb/builtin/llm/attachment.py +40 -0
  9. zrb/builtin/llm/chat_completion.py +274 -0
  10. zrb/builtin/llm/chat_session.py +152 -85
  11. zrb/builtin/llm/chat_session_cmd.py +288 -0
  12. zrb/builtin/llm/chat_trigger.py +79 -0
  13. zrb/builtin/llm/history.py +7 -9
  14. zrb/builtin/llm/llm_ask.py +221 -98
  15. zrb/builtin/llm/tool/api.py +74 -52
  16. zrb/builtin/llm/tool/cli.py +46 -17
  17. zrb/builtin/llm/tool/code.py +71 -90
  18. zrb/builtin/llm/tool/file.py +301 -241
  19. zrb/builtin/llm/tool/note.py +84 -0
  20. zrb/builtin/llm/tool/rag.py +38 -8
  21. zrb/builtin/llm/tool/sub_agent.py +67 -50
  22. zrb/builtin/llm/tool/web.py +146 -122
  23. zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/_zrb/entity/add_entity_util.py +7 -7
  24. zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/_zrb/module/add_module_util.py +5 -5
  25. zrb/builtin/project/add/fastapp/fastapp_util.py +1 -1
  26. zrb/builtin/searxng/config/settings.yml +5671 -0
  27. zrb/builtin/searxng/start.py +21 -0
  28. zrb/builtin/setup/latex/ubuntu.py +1 -0
  29. zrb/builtin/setup/ubuntu.py +1 -1
  30. zrb/builtin/shell/autocomplete/bash.py +4 -3
  31. zrb/builtin/shell/autocomplete/zsh.py +4 -3
  32. zrb/builtin/todo.py +13 -2
  33. zrb/config/config.py +614 -0
  34. zrb/config/default_prompt/file_extractor_system_prompt.md +112 -0
  35. zrb/config/default_prompt/interactive_system_prompt.md +29 -0
  36. zrb/config/default_prompt/persona.md +1 -0
  37. zrb/config/default_prompt/repo_extractor_system_prompt.md +112 -0
  38. zrb/config/default_prompt/repo_summarizer_system_prompt.md +29 -0
  39. zrb/config/default_prompt/summarization_prompt.md +57 -0
  40. zrb/config/default_prompt/system_prompt.md +38 -0
  41. zrb/config/llm_config.py +339 -0
  42. zrb/config/llm_context/config.py +166 -0
  43. zrb/config/llm_context/config_parser.py +40 -0
  44. zrb/config/llm_context/workflow.py +81 -0
  45. zrb/config/llm_rate_limitter.py +190 -0
  46. zrb/{runner → config}/web_auth_config.py +17 -22
  47. zrb/context/any_shared_context.py +17 -1
  48. zrb/context/context.py +16 -2
  49. zrb/context/shared_context.py +18 -8
  50. zrb/group/any_group.py +12 -5
  51. zrb/group/group.py +67 -3
  52. zrb/input/any_input.py +5 -1
  53. zrb/input/base_input.py +18 -6
  54. zrb/input/option_input.py +13 -1
  55. zrb/input/text_input.py +8 -25
  56. zrb/runner/cli.py +25 -23
  57. zrb/runner/common_util.py +24 -19
  58. zrb/runner/web_app.py +3 -3
  59. zrb/runner/web_route/docs_route.py +1 -1
  60. zrb/runner/web_route/error_page/serve_default_404.py +1 -1
  61. zrb/runner/web_route/error_page/show_error_page.py +1 -1
  62. zrb/runner/web_route/home_page/home_page_route.py +2 -2
  63. zrb/runner/web_route/login_api_route.py +1 -1
  64. zrb/runner/web_route/login_page/login_page_route.py +2 -2
  65. zrb/runner/web_route/logout_api_route.py +1 -1
  66. zrb/runner/web_route/logout_page/logout_page_route.py +2 -2
  67. zrb/runner/web_route/node_page/group/show_group_page.py +1 -1
  68. zrb/runner/web_route/node_page/node_page_route.py +1 -1
  69. zrb/runner/web_route/node_page/task/show_task_page.py +1 -1
  70. zrb/runner/web_route/refresh_token_api_route.py +1 -1
  71. zrb/runner/web_route/static/static_route.py +1 -1
  72. zrb/runner/web_route/task_input_api_route.py +6 -6
  73. zrb/runner/web_route/task_session_api_route.py +20 -12
  74. zrb/runner/web_util/cookie.py +1 -1
  75. zrb/runner/web_util/token.py +1 -1
  76. zrb/runner/web_util/user.py +8 -4
  77. zrb/session/any_session.py +24 -17
  78. zrb/session/session.py +50 -25
  79. zrb/session_state_logger/any_session_state_logger.py +9 -4
  80. zrb/session_state_logger/file_session_state_logger.py +16 -6
  81. zrb/session_state_logger/session_state_logger_factory.py +1 -1
  82. zrb/task/any_task.py +30 -9
  83. zrb/task/base/context.py +17 -9
  84. zrb/task/base/execution.py +15 -8
  85. zrb/task/base/lifecycle.py +8 -4
  86. zrb/task/base/monitoring.py +12 -7
  87. zrb/task/base_task.py +69 -5
  88. zrb/task/base_trigger.py +12 -5
  89. zrb/task/cmd_task.py +1 -1
  90. zrb/task/llm/agent.py +154 -161
  91. zrb/task/llm/agent_runner.py +152 -0
  92. zrb/task/llm/config.py +47 -18
  93. zrb/task/llm/conversation_history.py +209 -0
  94. zrb/task/llm/conversation_history_model.py +67 -0
  95. zrb/task/llm/default_workflow/coding/workflow.md +41 -0
  96. zrb/task/llm/default_workflow/copywriting/workflow.md +68 -0
  97. zrb/task/llm/default_workflow/git/workflow.md +118 -0
  98. zrb/task/llm/default_workflow/golang/workflow.md +128 -0
  99. zrb/task/llm/default_workflow/html-css/workflow.md +135 -0
  100. zrb/task/llm/default_workflow/java/workflow.md +146 -0
  101. zrb/task/llm/default_workflow/javascript/workflow.md +158 -0
  102. zrb/task/llm/default_workflow/python/workflow.md +160 -0
  103. zrb/task/llm/default_workflow/researching/workflow.md +153 -0
  104. zrb/task/llm/default_workflow/rust/workflow.md +162 -0
  105. zrb/task/llm/default_workflow/shell/workflow.md +299 -0
  106. zrb/task/llm/error.py +24 -10
  107. zrb/task/llm/file_replacement.py +206 -0
  108. zrb/task/llm/file_tool_model.py +57 -0
  109. zrb/task/llm/history_processor.py +206 -0
  110. zrb/task/llm/history_summarization.py +11 -166
  111. zrb/task/llm/print_node.py +193 -69
  112. zrb/task/llm/prompt.py +242 -45
  113. zrb/task/llm/subagent_conversation_history.py +41 -0
  114. zrb/task/llm/tool_wrapper.py +260 -57
  115. zrb/task/llm/workflow.py +76 -0
  116. zrb/task/llm_task.py +182 -171
  117. zrb/task/make_task.py +2 -3
  118. zrb/task/rsync_task.py +26 -11
  119. zrb/task/scheduler.py +4 -4
  120. zrb/util/attr.py +54 -39
  121. zrb/util/callable.py +23 -0
  122. zrb/util/cli/markdown.py +12 -0
  123. zrb/util/cli/text.py +30 -0
  124. zrb/util/file.py +29 -11
  125. zrb/util/git.py +8 -11
  126. zrb/util/git_diff_model.py +10 -0
  127. zrb/util/git_subtree.py +9 -14
  128. zrb/util/git_subtree_model.py +32 -0
  129. zrb/util/init_path.py +1 -1
  130. zrb/util/markdown.py +62 -0
  131. zrb/util/string/conversion.py +2 -2
  132. zrb/util/todo.py +17 -50
  133. zrb/util/todo_model.py +46 -0
  134. zrb/util/truncate.py +23 -0
  135. zrb/util/yaml.py +204 -0
  136. zrb/xcom/xcom.py +10 -0
  137. zrb-1.21.29.dist-info/METADATA +270 -0
  138. {zrb-1.8.10.dist-info → zrb-1.21.29.dist-info}/RECORD +140 -98
  139. {zrb-1.8.10.dist-info → zrb-1.21.29.dist-info}/WHEEL +1 -1
  140. zrb/config.py +0 -335
  141. zrb/llm_config.py +0 -411
  142. zrb/llm_rate_limitter.py +0 -125
  143. zrb/task/llm/context.py +0 -102
  144. zrb/task/llm/context_enrichment.py +0 -199
  145. zrb/task/llm/history.py +0 -211
  146. zrb-1.8.10.dist-info/METADATA +0 -264
  147. {zrb-1.8.10.dist-info → zrb-1.21.29.dist-info}/entry_points.txt +0 -0
@@ -204,7 +204,7 @@ def update_migration_metadata_file(ctx: AnyContext, migration_metadata_file_path
204
204
  app_name = os.path.basename(APP_DIR)
205
205
  existing_migration_metadata_code = read_file(migration_metadata_file_path)
206
206
  write_file(
207
- file_path=migration_metadata_file_path,
207
+ abs_file_path=migration_metadata_file_path,
208
208
  content=[
209
209
  _get_migration_import_schema_code(
210
210
  existing_migration_metadata_code, app_name, ctx.input.entity
@@ -251,7 +251,7 @@ def update_client_file(ctx: AnyContext, client_file_path: str):
251
251
  snake_plural_entity_name = to_snake_case(ctx.input.plural)
252
252
  pascal_entity_name = to_pascal_case(ctx.input.entity)
253
253
  write_file(
254
- file_path=client_file_path,
254
+ abs_file_path=client_file_path,
255
255
  content=[
256
256
  _get_import_schema_for_client_code(
257
257
  existing_code=existing_client_code, entity_name=ctx.input.entity
@@ -305,7 +305,7 @@ def update_api_client_file(ctx: AnyContext, api_client_file_path: str):
305
305
  snake_module_name = to_snake_case(ctx.input.module)
306
306
  pascal_module_name = to_pascal_case(ctx.input.module)
307
307
  write_file(
308
- file_path=api_client_file_path,
308
+ abs_file_path=api_client_file_path,
309
309
  content=[
310
310
  f"from {app_name}.module.{snake_module_name}.service.{snake_entity_name}.{snake_entity_name}_service_factory import {snake_entity_name}_service", # noqa
311
311
  prepend_code_to_module(
@@ -327,7 +327,7 @@ def update_direct_client_file(ctx: AnyContext, direct_client_file_path: str):
327
327
  snake_module_name = to_snake_case(ctx.input.module)
328
328
  pascal_module_name = to_pascal_case(ctx.input.module)
329
329
  write_file(
330
- file_path=direct_client_file_path,
330
+ abs_file_path=direct_client_file_path,
331
331
  content=[
332
332
  f"from {app_name}.module.{snake_module_name}.service.{snake_entity_name}.{snake_entity_name}_service_factory import {snake_entity_name}_service", # noqa
333
333
  prepend_code_to_module(
@@ -348,7 +348,7 @@ def update_route_file(ctx: AnyContext, route_file_path: str):
348
348
  app_name = os.path.basename(APP_DIR)
349
349
  module_name = to_snake_case(ctx.input.module)
350
350
  write_file(
351
- file_path=route_file_path,
351
+ abs_file_path=route_file_path,
352
352
  content=[
353
353
  f"from {app_name}.module.{module_name}.service.{entity_name}.{entity_name}_service_factory import {entity_name}_service", # noqa
354
354
  append_code_to_function(
@@ -370,7 +370,7 @@ def update_gateway_subroute_file(ctx: AnyContext, module_gateway_subroute_path:
370
370
  pascal_entity_name = to_pascal_case(ctx.input.entity)
371
371
  existing_gateway_subroute_code = read_file(module_gateway_subroute_path)
372
372
  write_file(
373
- file_path=module_gateway_subroute_path,
373
+ abs_file_path=module_gateway_subroute_path,
374
374
  content=[
375
375
  _get_import_client_for_gateway_subroute_code(
376
376
  existing_gateway_subroute_code, module_name=ctx.input.module
@@ -456,7 +456,7 @@ def update_gateway_navigation_config_file(
456
456
  },
457
457
  ).strip()
458
458
  write_file(
459
- file_path=gateway_navigation_config_file_path,
459
+ abs_file_path=gateway_navigation_config_file_path,
460
460
  content=[
461
461
  existing_gateway_navigation_config_code,
462
462
  new_navigation_config_code,
@@ -73,7 +73,7 @@ def update_app_zrb_config_file(ctx: AnyContext, zrb_config_file_path: str):
73
73
  ]
74
74
  )
75
75
  write_file(
76
- file_path=zrb_config_file_path,
76
+ abs_file_path=zrb_config_file_path,
77
77
  content=append_key_to_dict(
78
78
  original_code=existing_zrb_config_code,
79
79
  dictionary_name="MICROSERVICES_ENV_VARS",
@@ -86,7 +86,7 @@ def update_app_zrb_config_file(ctx: AnyContext, zrb_config_file_path: str):
86
86
  def update_app_zrb_task_file(ctx: AnyContext, zrb_task_file_path: str):
87
87
  existing_zrb_task_code = read_file(zrb_task_file_path)
88
88
  write_file(
89
- file_path=zrb_task_file_path,
89
+ abs_file_path=zrb_task_file_path,
90
90
  content=[
91
91
  existing_zrb_task_code.strip(),
92
92
  "",
@@ -126,7 +126,7 @@ def _get_task_definition_code(existing_code: str, module_name: str) -> str | Non
126
126
  def update_app_main_file(ctx: AnyContext, app_main_file_path: str):
127
127
  existing_app_main_code = read_file(app_main_file_path)
128
128
  write_file(
129
- file_path=app_main_file_path,
129
+ abs_file_path=app_main_file_path,
130
130
  content=[
131
131
  _get_import_module_route_code(existing_app_main_code, ctx.input.module),
132
132
  existing_app_main_code,
@@ -187,7 +187,7 @@ def update_gateway_route_file(ctx: AnyContext, gateway_route_file_path: str):
187
187
  existing_gateway_route_code = read_file(gateway_route_file_path)
188
188
  snake_module_name = to_snake_case(ctx.input.module)
189
189
  write_file(
190
- file_path=gateway_route_file_path,
190
+ abs_file_path=gateway_route_file_path,
191
191
  content=[
192
192
  _get_module_subroute_import(existing_gateway_route_code, ctx.input.module),
193
193
  append_code_to_function(
@@ -233,7 +233,7 @@ def update_gateway_navigation_config_file(
233
233
  },
234
234
  ).strip()
235
235
  write_file(
236
- file_path=gateway_navigation_config_file_path,
236
+ abs_file_path=gateway_navigation_config_file_path,
237
237
  content=[
238
238
  existing_gateway_navigation_config_code,
239
239
  new_navigation_config_code,
@@ -22,7 +22,7 @@ def is_project_zrb_init_file(ctx: AnyContext, file_path: str) -> bool:
22
22
  def update_project_zrb_init_file(ctx: AnyContext, zrb_init_path: str):
23
23
  existing_zrb_init_code = read_file(zrb_init_path)
24
24
  write_file(
25
- file_path=zrb_init_path,
25
+ abs_file_path=zrb_init_path,
26
26
  content=[
27
27
  _get_import_load_file_code(existing_zrb_init_code),
28
28
  existing_zrb_init_code.strip(),