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.
- zrb/__init__.py +126 -113
- zrb/__main__.py +1 -1
- zrb/attr/type.py +10 -7
- zrb/builtin/__init__.py +2 -50
- zrb/builtin/git.py +12 -1
- zrb/builtin/group.py +31 -15
- zrb/builtin/http.py +7 -8
- zrb/builtin/llm/attachment.py +40 -0
- zrb/builtin/llm/chat_completion.py +274 -0
- zrb/builtin/llm/chat_session.py +152 -85
- zrb/builtin/llm/chat_session_cmd.py +288 -0
- zrb/builtin/llm/chat_trigger.py +79 -0
- zrb/builtin/llm/history.py +7 -9
- zrb/builtin/llm/llm_ask.py +221 -98
- zrb/builtin/llm/tool/api.py +74 -52
- zrb/builtin/llm/tool/cli.py +46 -17
- zrb/builtin/llm/tool/code.py +71 -90
- zrb/builtin/llm/tool/file.py +301 -241
- zrb/builtin/llm/tool/note.py +84 -0
- zrb/builtin/llm/tool/rag.py +38 -8
- zrb/builtin/llm/tool/sub_agent.py +67 -50
- zrb/builtin/llm/tool/web.py +146 -122
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/_zrb/entity/add_entity_util.py +7 -7
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/_zrb/module/add_module_util.py +5 -5
- zrb/builtin/project/add/fastapp/fastapp_util.py +1 -1
- zrb/builtin/searxng/config/settings.yml +5671 -0
- zrb/builtin/searxng/start.py +21 -0
- zrb/builtin/setup/latex/ubuntu.py +1 -0
- zrb/builtin/setup/ubuntu.py +1 -1
- zrb/builtin/shell/autocomplete/bash.py +4 -3
- zrb/builtin/shell/autocomplete/zsh.py +4 -3
- zrb/builtin/todo.py +13 -2
- zrb/config/config.py +614 -0
- zrb/config/default_prompt/file_extractor_system_prompt.md +112 -0
- zrb/config/default_prompt/interactive_system_prompt.md +29 -0
- zrb/config/default_prompt/persona.md +1 -0
- zrb/config/default_prompt/repo_extractor_system_prompt.md +112 -0
- zrb/config/default_prompt/repo_summarizer_system_prompt.md +29 -0
- zrb/config/default_prompt/summarization_prompt.md +57 -0
- zrb/config/default_prompt/system_prompt.md +38 -0
- zrb/config/llm_config.py +339 -0
- zrb/config/llm_context/config.py +166 -0
- zrb/config/llm_context/config_parser.py +40 -0
- zrb/config/llm_context/workflow.py +81 -0
- zrb/config/llm_rate_limitter.py +190 -0
- zrb/{runner → config}/web_auth_config.py +17 -22
- zrb/context/any_shared_context.py +17 -1
- zrb/context/context.py +16 -2
- zrb/context/shared_context.py +18 -8
- zrb/group/any_group.py +12 -5
- zrb/group/group.py +67 -3
- zrb/input/any_input.py +5 -1
- zrb/input/base_input.py +18 -6
- zrb/input/option_input.py +13 -1
- zrb/input/text_input.py +8 -25
- zrb/runner/cli.py +25 -23
- zrb/runner/common_util.py +24 -19
- zrb/runner/web_app.py +3 -3
- zrb/runner/web_route/docs_route.py +1 -1
- zrb/runner/web_route/error_page/serve_default_404.py +1 -1
- zrb/runner/web_route/error_page/show_error_page.py +1 -1
- zrb/runner/web_route/home_page/home_page_route.py +2 -2
- zrb/runner/web_route/login_api_route.py +1 -1
- zrb/runner/web_route/login_page/login_page_route.py +2 -2
- zrb/runner/web_route/logout_api_route.py +1 -1
- zrb/runner/web_route/logout_page/logout_page_route.py +2 -2
- zrb/runner/web_route/node_page/group/show_group_page.py +1 -1
- zrb/runner/web_route/node_page/node_page_route.py +1 -1
- zrb/runner/web_route/node_page/task/show_task_page.py +1 -1
- zrb/runner/web_route/refresh_token_api_route.py +1 -1
- zrb/runner/web_route/static/static_route.py +1 -1
- zrb/runner/web_route/task_input_api_route.py +6 -6
- zrb/runner/web_route/task_session_api_route.py +20 -12
- zrb/runner/web_util/cookie.py +1 -1
- zrb/runner/web_util/token.py +1 -1
- zrb/runner/web_util/user.py +8 -4
- zrb/session/any_session.py +24 -17
- zrb/session/session.py +50 -25
- zrb/session_state_logger/any_session_state_logger.py +9 -4
- zrb/session_state_logger/file_session_state_logger.py +16 -6
- zrb/session_state_logger/session_state_logger_factory.py +1 -1
- zrb/task/any_task.py +30 -9
- zrb/task/base/context.py +17 -9
- zrb/task/base/execution.py +15 -8
- zrb/task/base/lifecycle.py +8 -4
- zrb/task/base/monitoring.py +12 -7
- zrb/task/base_task.py +69 -5
- zrb/task/base_trigger.py +12 -5
- zrb/task/cmd_task.py +1 -1
- zrb/task/llm/agent.py +154 -161
- zrb/task/llm/agent_runner.py +152 -0
- zrb/task/llm/config.py +47 -18
- zrb/task/llm/conversation_history.py +209 -0
- zrb/task/llm/conversation_history_model.py +67 -0
- zrb/task/llm/default_workflow/coding/workflow.md +41 -0
- zrb/task/llm/default_workflow/copywriting/workflow.md +68 -0
- zrb/task/llm/default_workflow/git/workflow.md +118 -0
- zrb/task/llm/default_workflow/golang/workflow.md +128 -0
- zrb/task/llm/default_workflow/html-css/workflow.md +135 -0
- zrb/task/llm/default_workflow/java/workflow.md +146 -0
- zrb/task/llm/default_workflow/javascript/workflow.md +158 -0
- zrb/task/llm/default_workflow/python/workflow.md +160 -0
- zrb/task/llm/default_workflow/researching/workflow.md +153 -0
- zrb/task/llm/default_workflow/rust/workflow.md +162 -0
- zrb/task/llm/default_workflow/shell/workflow.md +299 -0
- zrb/task/llm/error.py +24 -10
- zrb/task/llm/file_replacement.py +206 -0
- zrb/task/llm/file_tool_model.py +57 -0
- zrb/task/llm/history_processor.py +206 -0
- zrb/task/llm/history_summarization.py +11 -166
- zrb/task/llm/print_node.py +193 -69
- zrb/task/llm/prompt.py +242 -45
- zrb/task/llm/subagent_conversation_history.py +41 -0
- zrb/task/llm/tool_wrapper.py +260 -57
- zrb/task/llm/workflow.py +76 -0
- zrb/task/llm_task.py +182 -171
- zrb/task/make_task.py +2 -3
- zrb/task/rsync_task.py +26 -11
- zrb/task/scheduler.py +4 -4
- zrb/util/attr.py +54 -39
- zrb/util/callable.py +23 -0
- zrb/util/cli/markdown.py +12 -0
- zrb/util/cli/text.py +30 -0
- zrb/util/file.py +29 -11
- zrb/util/git.py +8 -11
- zrb/util/git_diff_model.py +10 -0
- zrb/util/git_subtree.py +9 -14
- zrb/util/git_subtree_model.py +32 -0
- zrb/util/init_path.py +1 -1
- zrb/util/markdown.py +62 -0
- zrb/util/string/conversion.py +2 -2
- zrb/util/todo.py +17 -50
- zrb/util/todo_model.py +46 -0
- zrb/util/truncate.py +23 -0
- zrb/util/yaml.py +204 -0
- zrb/xcom/xcom.py +10 -0
- zrb-1.21.29.dist-info/METADATA +270 -0
- {zrb-1.8.10.dist-info → zrb-1.21.29.dist-info}/RECORD +140 -98
- {zrb-1.8.10.dist-info → zrb-1.21.29.dist-info}/WHEEL +1 -1
- zrb/config.py +0 -335
- zrb/llm_config.py +0 -411
- zrb/llm_rate_limitter.py +0 -125
- zrb/task/llm/context.py +0 -102
- zrb/task/llm/context_enrichment.py +0 -199
- zrb/task/llm/history.py +0 -211
- zrb-1.8.10.dist-info/METADATA +0 -264
- {zrb-1.8.10.dist-info → zrb-1.21.29.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from zrb.builtin.group import searxng_group
|
|
4
|
+
from zrb.config.config import CFG
|
|
5
|
+
from zrb.input.int_input import IntInput
|
|
6
|
+
from zrb.task.cmd_task import CmdTask
|
|
7
|
+
from zrb.task.http_check import HttpCheck
|
|
8
|
+
|
|
9
|
+
start_searxng = searxng_group.add_task(
|
|
10
|
+
CmdTask(
|
|
11
|
+
name="start-searxng",
|
|
12
|
+
input=IntInput(name="port", default=CFG.SEARXNG_PORT),
|
|
13
|
+
cwd=os.path.dirname(__file__),
|
|
14
|
+
cmd="docker run --rm -p {ctx.input.port}:8080 -v ./config/:/etc/searxng/ docker.io/searxng/searxng:latest -d", # noqa
|
|
15
|
+
readiness_check=HttpCheck(
|
|
16
|
+
"check-searxng",
|
|
17
|
+
url="http://localhost:{ctx.input.port}",
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
alias="start",
|
|
21
|
+
)
|
zrb/builtin/setup/ubuntu.py
CHANGED
|
@@ -22,7 +22,7 @@ setup_ubuntu = setup_group.add_task(
|
|
|
22
22
|
description="🐧 Setup ubuntu",
|
|
23
23
|
cmd=[
|
|
24
24
|
"sudo apt install -y \\",
|
|
25
|
-
"build-essential
|
|
25
|
+
"build-essential libssl-dev zlib1g-dev \\"
|
|
26
26
|
"libbz2-dev libreadline-dev libsqlite3-dev libpq-dev python3-dev \\",
|
|
27
27
|
"llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \\",
|
|
28
28
|
"liblzma-dev python3-openssl libblas-dev liblapack-dev rustc \\",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from zrb.builtin.group import shell_autocomplete_group
|
|
2
|
-
from zrb.
|
|
2
|
+
from zrb.config.config import CFG
|
|
3
|
+
from zrb.context.context import AnyContext
|
|
3
4
|
from zrb.task.make_task import make_task
|
|
4
5
|
|
|
5
6
|
_COMPLETION_SCRIPT = """
|
|
@@ -36,5 +37,5 @@ complete -F _zrb_complete zrb
|
|
|
36
37
|
group=shell_autocomplete_group,
|
|
37
38
|
alias="bash",
|
|
38
39
|
)
|
|
39
|
-
def make_bash_autocomplete(ctx:
|
|
40
|
-
return _COMPLETION_SCRIPT
|
|
40
|
+
def make_bash_autocomplete(ctx: AnyContext):
|
|
41
|
+
return _COMPLETION_SCRIPT.replace("zrb", CFG.ROOT_GROUP_NAME)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from zrb.builtin.group import shell_autocomplete_group
|
|
2
|
-
from zrb.
|
|
2
|
+
from zrb.config.config import CFG
|
|
3
|
+
from zrb.context.context import AnyContext
|
|
3
4
|
from zrb.task.make_task import make_task
|
|
4
5
|
|
|
5
6
|
_COMPLETION_SCRIPT = """
|
|
@@ -33,5 +34,5 @@ compdef _zrb_complete zrb
|
|
|
33
34
|
group=shell_autocomplete_group,
|
|
34
35
|
alias="zsh",
|
|
35
36
|
)
|
|
36
|
-
def make_zsh_autocomplete(ctx:
|
|
37
|
-
return _COMPLETION_SCRIPT
|
|
37
|
+
def make_zsh_autocomplete(ctx: AnyContext):
|
|
38
|
+
return _COMPLETION_SCRIPT.replace("zrb", CFG.ROOT_GROUP_NAME)
|
zrb/builtin/todo.py
CHANGED
|
@@ -4,14 +4,13 @@ import os
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
from zrb.builtin.group import todo_group
|
|
7
|
-
from zrb.config import CFG
|
|
7
|
+
from zrb.config.config import CFG
|
|
8
8
|
from zrb.context.any_context import AnyContext
|
|
9
9
|
from zrb.input.str_input import StrInput
|
|
10
10
|
from zrb.input.text_input import TextInput
|
|
11
11
|
from zrb.task.make_task import make_task
|
|
12
12
|
from zrb.util.file import read_file, write_file
|
|
13
13
|
from zrb.util.todo import (
|
|
14
|
-
TodoTaskModel,
|
|
15
14
|
add_duration,
|
|
16
15
|
cascade_todo_task,
|
|
17
16
|
get_visual_todo_card,
|
|
@@ -72,6 +71,8 @@ def _get_filter_input(
|
|
|
72
71
|
alias="add",
|
|
73
72
|
)
|
|
74
73
|
def add_todo(ctx: AnyContext):
|
|
74
|
+
from zrb.util.todo_model import TodoTaskModel
|
|
75
|
+
|
|
75
76
|
todo_file_path = os.path.join(CFG.TODO_DIR, "todo.txt")
|
|
76
77
|
todo_list: list[TodoTaskModel] = []
|
|
77
78
|
if os.path.isfile(todo_file_path):
|
|
@@ -108,6 +109,8 @@ def add_todo(ctx: AnyContext):
|
|
|
108
109
|
alias="list",
|
|
109
110
|
)
|
|
110
111
|
def list_todo(ctx: AnyContext):
|
|
112
|
+
from zrb.util.todo_model import TodoTaskModel
|
|
113
|
+
|
|
111
114
|
todo_file_path = os.path.join(CFG.TODO_DIR, "todo.txt")
|
|
112
115
|
todo_list: list[TodoTaskModel] = []
|
|
113
116
|
if os.path.isfile(todo_file_path):
|
|
@@ -123,6 +126,8 @@ def list_todo(ctx: AnyContext):
|
|
|
123
126
|
alias="show",
|
|
124
127
|
)
|
|
125
128
|
def show_todo(ctx: AnyContext):
|
|
129
|
+
from zrb.util.todo_model import TodoTaskModel
|
|
130
|
+
|
|
126
131
|
todo_file_path = os.path.join(CFG.TODO_DIR, "todo.txt")
|
|
127
132
|
todo_list: list[TodoTaskModel] = []
|
|
128
133
|
todo_list: list[TodoTaskModel] = []
|
|
@@ -157,6 +162,8 @@ def show_todo(ctx: AnyContext):
|
|
|
157
162
|
alias="complete",
|
|
158
163
|
)
|
|
159
164
|
def complete_todo(ctx: AnyContext):
|
|
165
|
+
from zrb.util.todo_model import TodoTaskModel
|
|
166
|
+
|
|
160
167
|
todo_file_path = os.path.join(CFG.TODO_DIR, "todo.txt")
|
|
161
168
|
todo_list: list[TodoTaskModel] = []
|
|
162
169
|
if os.path.isfile(todo_file_path):
|
|
@@ -187,6 +194,8 @@ def complete_todo(ctx: AnyContext):
|
|
|
187
194
|
alias="archive",
|
|
188
195
|
)
|
|
189
196
|
def archive_todo(ctx: AnyContext):
|
|
197
|
+
from zrb.util.todo_model import TodoTaskModel
|
|
198
|
+
|
|
190
199
|
todo_file_path = os.path.join(CFG.TODO_DIR, "todo.txt")
|
|
191
200
|
todo_list: list[TodoTaskModel] = []
|
|
192
201
|
if os.path.isfile(todo_file_path):
|
|
@@ -248,6 +257,8 @@ def archive_todo(ctx: AnyContext):
|
|
|
248
257
|
alias="log",
|
|
249
258
|
)
|
|
250
259
|
def log_todo(ctx: AnyContext):
|
|
260
|
+
from zrb.util.todo_model import TodoTaskModel
|
|
261
|
+
|
|
251
262
|
todo_file_path = os.path.join(CFG.TODO_DIR, "todo.txt")
|
|
252
263
|
todo_list: list[TodoTaskModel] = []
|
|
253
264
|
if os.path.isfile(todo_file_path):
|