zrb 1.5.10__py3-none-any.whl → 1.5.12__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.
Files changed (46) hide show
  1. zrb/builtin/llm/llm_chat.py +1 -1
  2. zrb/builtin/llm/tool/__init__.py +0 -0
  3. zrb/builtin/llm/tool/file.py +22 -88
  4. zrb/builtin/llm/tool/sub_agent.py +125 -0
  5. zrb/builtin/llm/tool/web.py +0 -2
  6. zrb/config.py +0 -3
  7. zrb/llm_config.py +16 -2
  8. zrb/task/base_task.py +20 -0
  9. zrb/task/cmd_task.py +2 -2
  10. zrb/task/llm/agent.py +5 -8
  11. zrb/task/llm/context.py +17 -8
  12. zrb/task/llm/context_enrichment.py +52 -13
  13. zrb/task/llm/history_summarization.py +3 -5
  14. zrb/task/llm/prompt.py +7 -4
  15. zrb/task/llm/tool_wrapper.py +115 -53
  16. zrb/task/llm_task.py +16 -1
  17. zrb/util/attr.py +84 -1
  18. zrb/util/cli/style.py +147 -0
  19. zrb/util/cli/subcommand.py +22 -1
  20. zrb/util/cmd/command.py +18 -0
  21. zrb/util/cmd/remote.py +15 -0
  22. zrb/util/codemod/modification_mode.py +4 -0
  23. zrb/util/codemod/modify_class.py +72 -0
  24. zrb/util/codemod/modify_class_parent.py +68 -0
  25. zrb/util/codemod/modify_class_property.py +67 -0
  26. zrb/util/codemod/modify_dict.py +62 -0
  27. zrb/util/codemod/modify_function.py +75 -3
  28. zrb/util/codemod/modify_function_call.py +72 -0
  29. zrb/util/codemod/modify_method.py +77 -0
  30. zrb/util/codemod/modify_module.py +10 -0
  31. zrb/util/cron.py +37 -3
  32. zrb/util/file.py +32 -0
  33. zrb/util/git.py +113 -0
  34. zrb/util/git_subtree.py +58 -0
  35. zrb/util/group.py +64 -2
  36. zrb/util/load.py +29 -0
  37. zrb/util/run.py +9 -0
  38. zrb/util/string/conversion.py +86 -0
  39. zrb/util/string/format.py +20 -0
  40. zrb/util/string/name.py +12 -0
  41. zrb/util/todo.py +165 -4
  42. {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/METADATA +3 -3
  43. {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/RECORD +45 -44
  44. zrb/task/base/dependencies.py +0 -57
  45. {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/WHEEL +0 -0
  46. {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/entry_points.txt +0 -0
@@ -1,57 +0,0 @@
1
- from typing import TypeVar
2
-
3
- from zrb.task.any_task import AnyTask
4
-
5
- T = TypeVar("T", bound="AnyTask")
6
-
7
-
8
- def get_dependency_list(task: AnyTask, attr_name: str) -> list[AnyTask]:
9
- """
10
- Safely retrieves a list of dependencies (upstreams, fallbacks, etc.)
11
- from a task attribute, handling None or single-task values.
12
- """
13
- dependencies = getattr(task, attr_name, None)
14
- if dependencies is None:
15
- return []
16
- elif isinstance(dependencies, list):
17
- # Ensure all elements are AnyTask (or compatible) if needed,
18
- # but for now, assume the list contains tasks.
19
- return dependencies
20
- # Assume it's a single AnyTask instance
21
- return [dependencies]
22
-
23
-
24
- def append_dependency(
25
- task: T, attr_name: str, dependencies_to_add: AnyTask | list[AnyTask]
26
- ) -> None:
27
- """
28
- Appends one or more dependencies to the specified attribute list of a task,
29
- ensuring the attribute becomes a list and avoiding duplicates.
30
-
31
- Modifies the attribute on the task object directly.
32
- """
33
- # Retrieve the current list, handling None or single item cases
34
- current_deps_list = getattr(task, attr_name, None)
35
- if current_deps_list is None:
36
- current_deps_list = []
37
- elif not isinstance(current_deps_list, list):
38
- current_deps_list = [current_deps_list]
39
- else:
40
- # Create a copy to avoid modifying the original list if no changes occur
41
- current_deps_list = list(current_deps_list)
42
-
43
- if isinstance(dependencies_to_add, list):
44
- new_deps = dependencies_to_add
45
- else:
46
- new_deps = [dependencies_to_add] # Ensure it's always a list
47
-
48
- added = False
49
- for dep in new_deps:
50
- # Check for existence before appending
51
- if dep not in current_deps_list:
52
- current_deps_list.append(dep)
53
- added = True
54
-
55
- # Update the attribute on the task object only if changes were made
56
- if added:
57
- setattr(task, attr_name, current_deps_list)
File without changes