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.
- zrb/builtin/llm/llm_chat.py +1 -1
- zrb/builtin/llm/tool/__init__.py +0 -0
- zrb/builtin/llm/tool/file.py +22 -88
- zrb/builtin/llm/tool/sub_agent.py +125 -0
- zrb/builtin/llm/tool/web.py +0 -2
- zrb/config.py +0 -3
- zrb/llm_config.py +16 -2
- zrb/task/base_task.py +20 -0
- zrb/task/cmd_task.py +2 -2
- zrb/task/llm/agent.py +5 -8
- zrb/task/llm/context.py +17 -8
- zrb/task/llm/context_enrichment.py +52 -13
- zrb/task/llm/history_summarization.py +3 -5
- zrb/task/llm/prompt.py +7 -4
- zrb/task/llm/tool_wrapper.py +115 -53
- zrb/task/llm_task.py +16 -1
- zrb/util/attr.py +84 -1
- zrb/util/cli/style.py +147 -0
- zrb/util/cli/subcommand.py +22 -1
- zrb/util/cmd/command.py +18 -0
- zrb/util/cmd/remote.py +15 -0
- zrb/util/codemod/modification_mode.py +4 -0
- zrb/util/codemod/modify_class.py +72 -0
- zrb/util/codemod/modify_class_parent.py +68 -0
- zrb/util/codemod/modify_class_property.py +67 -0
- zrb/util/codemod/modify_dict.py +62 -0
- zrb/util/codemod/modify_function.py +75 -3
- zrb/util/codemod/modify_function_call.py +72 -0
- zrb/util/codemod/modify_method.py +77 -0
- zrb/util/codemod/modify_module.py +10 -0
- zrb/util/cron.py +37 -3
- zrb/util/file.py +32 -0
- zrb/util/git.py +113 -0
- zrb/util/git_subtree.py +58 -0
- zrb/util/group.py +64 -2
- zrb/util/load.py +29 -0
- zrb/util/run.py +9 -0
- zrb/util/string/conversion.py +86 -0
- zrb/util/string/format.py +20 -0
- zrb/util/string/name.py +12 -0
- zrb/util/todo.py +165 -4
- {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/METADATA +3 -3
- {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/RECORD +45 -44
- zrb/task/base/dependencies.py +0 -57
- {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/WHEEL +0 -0
- {zrb-1.5.10.dist-info → zrb-1.5.12.dist-info}/entry_points.txt +0 -0
zrb/task/base/dependencies.py
DELETED
@@ -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
|
File without changes
|