tinybird 0.0.1.dev288__tar.gz → 0.0.1.dev290__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.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/datafile/common.py +0 -10
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/sql_toolset.py +2 -2
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/agent.py +36 -3
- tinybird-0.0.1.dev290/tinybird/tb/modules/agent/file_agent.py +64 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/append.py +2 -1
- tinybird-0.0.1.dev290/tinybird/tb/modules/agent/tools/file.py +82 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/run_command.py +9 -3
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/utils.py +6 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/local_common.py +2 -1
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird.egg-info/SOURCES.txt +2 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/setup.cfg +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/service_datasources.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/client.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/config.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/__init__.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/animations.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/banner.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/command_agent.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/compactor.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/explore_agent.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/memory.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/mock_agent.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/models.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/prompts.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/testing_agent.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/build.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/mock.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/plan.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/secret.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/test.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/deployment_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/dev_server.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/info.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/mock_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -1877,16 +1877,6 @@ def parse(
|
|
|
1877
1877
|
doc.shared_with += workspaces
|
|
1878
1878
|
total_workspaces += len(workspaces)
|
|
1879
1879
|
|
|
1880
|
-
# Add warning once if any workspaces were found
|
|
1881
|
-
if total_workspaces > 0:
|
|
1882
|
-
warnings.append(
|
|
1883
|
-
DatafileParseWarning(
|
|
1884
|
-
message=(
|
|
1885
|
-
f"{kwargs['cmd'].upper()} is not fully implemented in Forward and will be ignored while this warning is present."
|
|
1886
|
-
)
|
|
1887
|
-
)
|
|
1888
|
-
)
|
|
1889
|
-
|
|
1890
1880
|
# Validate that at least one workspace was provided
|
|
1891
1881
|
if total_workspaces == 0:
|
|
1892
1882
|
raise DatafileSyntaxError(
|
|
@@ -144,7 +144,7 @@ def format_where_for_mutation_command(where_clause: str) -> str:
|
|
|
144
144
|
return f"DELETE WHERE {quoted_condition[1:-1]}"
|
|
145
145
|
|
|
146
146
|
|
|
147
|
-
@lru_cache(maxsize=2**
|
|
147
|
+
@lru_cache(maxsize=2**15)
|
|
148
148
|
def sql_get_used_tables_cached(
|
|
149
149
|
sql: str,
|
|
150
150
|
raising: bool = False,
|
|
@@ -301,7 +301,7 @@ def replacements_to_tuples(replacements: dict) -> dict:
|
|
|
301
301
|
return parsed_replacements
|
|
302
302
|
|
|
303
303
|
|
|
304
|
-
@lru_cache(maxsize=2**
|
|
304
|
+
@lru_cache(maxsize=2**15)
|
|
305
305
|
def replace_tables_chquery_cached(
|
|
306
306
|
sql: str,
|
|
307
307
|
sorted_replacements: Optional[tuple] = None,
|
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/forward/commands'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev290'
|
|
8
|
+
__revision__ = '4d1cca4'
|
|
@@ -23,6 +23,7 @@ from tinybird.tb.modules.agent.banner import display_banner
|
|
|
23
23
|
from tinybird.tb.modules.agent.command_agent import CommandAgent
|
|
24
24
|
from tinybird.tb.modules.agent.compactor import compact_messages
|
|
25
25
|
from tinybird.tb.modules.agent.explore_agent import ExploreAgent
|
|
26
|
+
from tinybird.tb.modules.agent.file_agent import FileAgent
|
|
26
27
|
from tinybird.tb.modules.agent.memory import (
|
|
27
28
|
clear_history,
|
|
28
29
|
clear_messages,
|
|
@@ -50,7 +51,13 @@ from tinybird.tb.modules.agent.tools.get_endpoint_stats import get_endpoint_stat
|
|
|
50
51
|
from tinybird.tb.modules.agent.tools.get_openapi_definition import get_openapi_definition
|
|
51
52
|
from tinybird.tb.modules.agent.tools.plan import complete_plan, plan
|
|
52
53
|
from tinybird.tb.modules.agent.tools.secret import create_or_update_secrets
|
|
53
|
-
from tinybird.tb.modules.agent.utils import
|
|
54
|
+
from tinybird.tb.modules.agent.utils import (
|
|
55
|
+
AgentRunCancelled,
|
|
56
|
+
SubAgentRunCancelled,
|
|
57
|
+
TinybirdAgentContext,
|
|
58
|
+
show_confirmation,
|
|
59
|
+
show_input,
|
|
60
|
+
)
|
|
54
61
|
from tinybird.tb.modules.build_common import process as build_process
|
|
55
62
|
from tinybird.tb.modules.common import (
|
|
56
63
|
_analyze,
|
|
@@ -179,6 +186,16 @@ class TinybirdAgent:
|
|
|
179
186
|
workspace_id=workspace_id,
|
|
180
187
|
project=self.project,
|
|
181
188
|
)
|
|
189
|
+
self.file_agent = FileAgent(
|
|
190
|
+
dangerously_skip_permissions=self.dangerously_skip_permissions,
|
|
191
|
+
prompt_mode=prompt_mode,
|
|
192
|
+
thinking_animation=self.thinking_animation,
|
|
193
|
+
token=self.token,
|
|
194
|
+
user_token=self.user_token,
|
|
195
|
+
host=self.host,
|
|
196
|
+
workspace_id=workspace_id,
|
|
197
|
+
project=self.project,
|
|
198
|
+
)
|
|
182
199
|
|
|
183
200
|
@self.agent.tool
|
|
184
201
|
def manage_tests(ctx: RunContext[TinybirdAgentContext], task: str) -> str:
|
|
@@ -207,8 +224,11 @@ class TinybirdAgent:
|
|
|
207
224
|
Returns:
|
|
208
225
|
str: The result of the command.
|
|
209
226
|
"""
|
|
210
|
-
|
|
211
|
-
|
|
227
|
+
try:
|
|
228
|
+
result = self.command_agent.run(task, deps=ctx.deps, usage=ctx.usage)
|
|
229
|
+
return f"Result: {result.output}\nDo not repeat in your response the result again, because it is already displayed in the terminal."
|
|
230
|
+
except SubAgentRunCancelled as e:
|
|
231
|
+
return f"User does not want to continue with the proposed solution. Reason: {e}"
|
|
212
232
|
|
|
213
233
|
@self.agent.tool
|
|
214
234
|
def explore_data(ctx: RunContext[TinybirdAgentContext], task: str) -> str:
|
|
@@ -242,6 +262,19 @@ class TinybirdAgent:
|
|
|
242
262
|
result = self.mock_agent.run(user_input, deps=ctx.deps, usage=ctx.usage)
|
|
243
263
|
return result.output or "No result returned"
|
|
244
264
|
|
|
265
|
+
@self.agent.tool
|
|
266
|
+
def manage_files(ctx: RunContext[TinybirdAgentContext], task: str) -> str:
|
|
267
|
+
"""List file/folders and read any type of file in the current directory. Use this tool when you need to list or read non Tinybird project files (e.g. .txt, .md).
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
task (str): The task to solve. Required.
|
|
271
|
+
|
|
272
|
+
Returns:
|
|
273
|
+
str: The result of the task.
|
|
274
|
+
"""
|
|
275
|
+
result = self.file_agent.run(task, deps=ctx.deps, usage=ctx.usage)
|
|
276
|
+
return result.output or "No result returned"
|
|
277
|
+
|
|
245
278
|
@self.agent.instructions
|
|
246
279
|
def get_local_host(ctx: RunContext[TinybirdAgentContext]) -> str:
|
|
247
280
|
return f"""
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from pydantic_ai import Agent, Tool
|
|
2
|
+
from pydantic_ai.messages import ModelMessage
|
|
3
|
+
from pydantic_ai.usage import Usage
|
|
4
|
+
|
|
5
|
+
from tinybird.tb.modules.agent.animations import ThinkingAnimation
|
|
6
|
+
from tinybird.tb.modules.agent.models import create_model
|
|
7
|
+
from tinybird.tb.modules.agent.prompts import tone_and_style_instructions
|
|
8
|
+
from tinybird.tb.modules.agent.tools.file import list_files, read_file
|
|
9
|
+
from tinybird.tb.modules.agent.utils import TinybirdAgentContext
|
|
10
|
+
from tinybird.tb.modules.project import Project
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class FileAgent:
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
token: str,
|
|
17
|
+
user_token: str,
|
|
18
|
+
host: str,
|
|
19
|
+
workspace_id: str,
|
|
20
|
+
project: Project,
|
|
21
|
+
dangerously_skip_permissions: bool,
|
|
22
|
+
prompt_mode: bool,
|
|
23
|
+
thinking_animation: ThinkingAnimation,
|
|
24
|
+
):
|
|
25
|
+
self.token = token
|
|
26
|
+
self.user_token = user_token
|
|
27
|
+
self.host = host
|
|
28
|
+
self.workspace_id = workspace_id
|
|
29
|
+
self.dangerously_skip_permissions = dangerously_skip_permissions or prompt_mode
|
|
30
|
+
self.project = project
|
|
31
|
+
self.thinking_animation = thinking_animation
|
|
32
|
+
self.messages: list[ModelMessage] = []
|
|
33
|
+
self.agent = Agent(
|
|
34
|
+
model=create_model(user_token, host, workspace_id),
|
|
35
|
+
deps_type=TinybirdAgentContext,
|
|
36
|
+
instructions=[
|
|
37
|
+
"""
|
|
38
|
+
You are part of Tinybird Code, an agentic CLI that can help users to work with Tinybird.
|
|
39
|
+
You are a sub-agent of the main Tinybird Code agent. You are responsible for managing files.
|
|
40
|
+
You can do the following:
|
|
41
|
+
- List files in a directory.
|
|
42
|
+
- Read a file.
|
|
43
|
+
|
|
44
|
+
IMPORTANT: Use the `list_files` tool always before `read_file` to get the correct file path.
|
|
45
|
+
""",
|
|
46
|
+
tone_and_style_instructions,
|
|
47
|
+
],
|
|
48
|
+
tools=[
|
|
49
|
+
Tool(list_files, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
|
|
50
|
+
Tool(read_file, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
|
|
51
|
+
],
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
def run(self, task: str, deps: TinybirdAgentContext, usage: Usage):
|
|
55
|
+
result = self.agent.run_sync(
|
|
56
|
+
task,
|
|
57
|
+
deps=deps,
|
|
58
|
+
usage=usage,
|
|
59
|
+
message_history=self.messages,
|
|
60
|
+
model=create_model(self.user_token, self.host, self.workspace_id, run_id=deps.run_id),
|
|
61
|
+
)
|
|
62
|
+
new_messages = result.new_messages()
|
|
63
|
+
self.messages.extend(new_messages)
|
|
64
|
+
return result
|
|
@@ -24,7 +24,7 @@ def append_file(
|
|
|
24
24
|
Args:
|
|
25
25
|
datasource_name: Name of the datasource to append fixture to
|
|
26
26
|
fixture_pathname: Path to the fixture file to append
|
|
27
|
-
cloud: Whether to append the fixture to the cloud or local environment. If None (user didn't specify), will ask user to clarify. Defaults to local (False) in dangerous skip permissions mode.
|
|
27
|
+
cloud: Whether to append the fixture to the cloud or local environment. If None (user didn't specify in a previous step), will ask user to clarify. Defaults to local (False) in dangerous skip permissions mode.
|
|
28
28
|
|
|
29
29
|
Returns:
|
|
30
30
|
str: Message indicating the success or failure of the appending
|
|
@@ -54,6 +54,7 @@ def append_file(
|
|
|
54
54
|
|
|
55
55
|
cloud_or_local = "Cloud" if cloud else "Local"
|
|
56
56
|
active_plan = ctx.deps.get_plan() is not None and not cloud
|
|
57
|
+
ctx.deps.thinking_animation.stop()
|
|
57
58
|
confirmation = show_confirmation(
|
|
58
59
|
title=f"Append fixture {fixture_pathname} to datasource '{datasource_name}' in Tinybird {cloud_or_local}?",
|
|
59
60
|
skip_confirmation=ctx.deps.dangerously_skip_permissions or active_plan,
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from glob import glob
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
import click
|
|
5
|
+
from pydantic_ai import RunContext
|
|
6
|
+
|
|
7
|
+
from tinybird.tb.modules.agent.utils import TinybirdAgentContext
|
|
8
|
+
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def list_files(
|
|
12
|
+
ctx: RunContext[TinybirdAgentContext],
|
|
13
|
+
folder_path: str = ".",
|
|
14
|
+
search_pattern: str = "*",
|
|
15
|
+
) -> str:
|
|
16
|
+
"""Lists all files and folders in a directory.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
folder_path (str): The path to the directory to list. If not provided, it will list the files in the current directory. Default: "."
|
|
20
|
+
search_pattern (str): The pattern to search for in the files and folders. Default: "*"
|
|
21
|
+
Returns:
|
|
22
|
+
str: The list of files in the directory.
|
|
23
|
+
"""
|
|
24
|
+
try:
|
|
25
|
+
ctx.deps.thinking_animation.stop()
|
|
26
|
+
if folder_path:
|
|
27
|
+
path = Path(folder_path)
|
|
28
|
+
else:
|
|
29
|
+
path = Path.cwd()
|
|
30
|
+
|
|
31
|
+
display_folder = "current directory" if (folder_path == "." or not folder_path) else folder_path
|
|
32
|
+
|
|
33
|
+
click.echo(
|
|
34
|
+
FeedbackManager.highlight(message=f"» Searching in {display_folder} with pattern '{search_pattern}'")
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
if not path.exists():
|
|
38
|
+
ctx.deps.thinking_animation.start()
|
|
39
|
+
return f"Folder {folder_path} does not exist"
|
|
40
|
+
|
|
41
|
+
result = glob(f"{path}/**/{search_pattern}", recursive=True)
|
|
42
|
+
folders = [f for f in result if Path(f).is_dir()]
|
|
43
|
+
files = [f for f in result if Path(f).is_file()]
|
|
44
|
+
|
|
45
|
+
ctx.deps.thinking_animation.start()
|
|
46
|
+
return f"Folders: {folders}\nFiles: {files}"
|
|
47
|
+
except Exception as e:
|
|
48
|
+
ctx.deps.thinking_animation.start()
|
|
49
|
+
return f"Error listing files: {e}"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def read_file(ctx: RunContext[TinybirdAgentContext], file_path: str) -> str:
|
|
53
|
+
"""Reads a file from the local filesystem. The file_path parameter must be an absolute path, not a relative path. Any lines longer than 2000 characters will be truncated.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
file_path (str): The path to the file to read.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
str: The content of the file.
|
|
60
|
+
"""
|
|
61
|
+
try:
|
|
62
|
+
ctx.deps.thinking_animation.stop()
|
|
63
|
+
click.echo(FeedbackManager.highlight(message=f"» Reading file {file_path}"))
|
|
64
|
+
path = Path(file_path)
|
|
65
|
+
|
|
66
|
+
if not path.exists():
|
|
67
|
+
ctx.deps.thinking_animation.start()
|
|
68
|
+
return f"File {file_path} does not exist"
|
|
69
|
+
|
|
70
|
+
content = path.read_text()
|
|
71
|
+
chunks = content.split("\n")
|
|
72
|
+
|
|
73
|
+
if len(chunks) > 2000:
|
|
74
|
+
first_2000 = "\n".join(chunks[0:2000])
|
|
75
|
+
ctx.deps.thinking_animation.start()
|
|
76
|
+
return f"This file is too large to be read by the agent. Showing first 2000 lines instead:\n\n{first_2000}"
|
|
77
|
+
|
|
78
|
+
ctx.deps.thinking_animation.start()
|
|
79
|
+
return content
|
|
80
|
+
except Exception as e:
|
|
81
|
+
ctx.deps.thinking_animation.start()
|
|
82
|
+
return f"Error reading file: {e}"
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/run_command.py
RENAMED
|
@@ -3,7 +3,13 @@ import subprocess
|
|
|
3
3
|
import click
|
|
4
4
|
from pydantic_ai import RunContext
|
|
5
5
|
|
|
6
|
-
from tinybird.tb.modules.agent.utils import
|
|
6
|
+
from tinybird.tb.modules.agent.utils import (
|
|
7
|
+
AgentRunCancelled,
|
|
8
|
+
SubAgentRunCancelled,
|
|
9
|
+
TinybirdAgentContext,
|
|
10
|
+
show_confirmation,
|
|
11
|
+
show_input,
|
|
12
|
+
)
|
|
7
13
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
8
14
|
|
|
9
15
|
|
|
@@ -24,7 +30,7 @@ def run_command(ctx: RunContext[TinybirdAgentContext], command: str):
|
|
|
24
30
|
if confirmation == "review":
|
|
25
31
|
feedback = show_input(ctx.deps.workspace_name)
|
|
26
32
|
ctx.deps.thinking_animation.start()
|
|
27
|
-
|
|
33
|
+
raise SubAgentRunCancelled(f"""User did not confirm the command `{command}`. Reason: {feedback}.""")
|
|
28
34
|
|
|
29
35
|
click.echo(FeedbackManager.highlight(message=f"» Running command: {command}"))
|
|
30
36
|
command = command.replace("tb", "tb --no-version-warning")
|
|
@@ -32,7 +38,7 @@ def run_command(ctx: RunContext[TinybirdAgentContext], command: str):
|
|
|
32
38
|
click.echo(result.stdout)
|
|
33
39
|
ctx.deps.thinking_animation.start()
|
|
34
40
|
return result.stdout
|
|
35
|
-
except AgentRunCancelled as e:
|
|
41
|
+
except (AgentRunCancelled, SubAgentRunCancelled) as e:
|
|
36
42
|
raise e
|
|
37
43
|
except Exception as e:
|
|
38
44
|
click.echo(FeedbackManager.error(message=f"Error running command: {e}"))
|
|
@@ -721,6 +721,12 @@ class AgentRunCancelled(Exception):
|
|
|
721
721
|
pass
|
|
722
722
|
|
|
723
723
|
|
|
724
|
+
class SubAgentRunCancelled(Exception):
|
|
725
|
+
"""Exception raised when sub-agent cancels an operation"""
|
|
726
|
+
|
|
727
|
+
pass
|
|
728
|
+
|
|
729
|
+
|
|
724
730
|
def show_confirmation(title: str, skip_confirmation: bool = False, show_review: bool = True) -> ConfirmationResult:
|
|
725
731
|
if skip_confirmation:
|
|
726
732
|
return "yes"
|
|
@@ -24,6 +24,7 @@ from tinybird.tb.modules.telemetry import add_telemetry_event
|
|
|
24
24
|
TB_IMAGE_NAME = "tinybirdco/tinybird-local:latest"
|
|
25
25
|
TB_CONTAINER_NAME = "tinybird-local"
|
|
26
26
|
TB_LOCAL_PORT = int(os.getenv("TB_LOCAL_PORT", 7181))
|
|
27
|
+
TB_LOCAL_CLICKHOUSE_INTERFACE_PORT = int(os.getenv("TB_LOCAL_CLICKHOUSE_INTERFACE_PORT", 7182))
|
|
27
28
|
TB_LOCAL_HOST = re.sub(r"^https?://", "", os.getenv("TB_LOCAL_HOST", "localhost"))
|
|
28
29
|
TB_LOCAL_ADDRESS = f"http://{TB_LOCAL_HOST}:{TB_LOCAL_PORT}"
|
|
29
30
|
TB_LOCAL_DEFAULT_WORKSPACE_NAME = "Tinybird_Local_Testing"
|
|
@@ -269,7 +270,7 @@ def start_tinybird_local(
|
|
|
269
270
|
TB_IMAGE_NAME,
|
|
270
271
|
name=TB_CONTAINER_NAME,
|
|
271
272
|
detach=True,
|
|
272
|
-
ports={"7181/tcp": TB_LOCAL_PORT},
|
|
273
|
+
ports={"7181/tcp": TB_LOCAL_PORT, "7182/tcp": TB_LOCAL_CLICKHOUSE_INTERFACE_PORT},
|
|
273
274
|
remove=False,
|
|
274
275
|
platform="linux/amd64",
|
|
275
276
|
environment=environment,
|
|
@@ -87,6 +87,7 @@ tinybird/tb/modules/agent/banner.py
|
|
|
87
87
|
tinybird/tb/modules/agent/command_agent.py
|
|
88
88
|
tinybird/tb/modules/agent/compactor.py
|
|
89
89
|
tinybird/tb/modules/agent/explore_agent.py
|
|
90
|
+
tinybird/tb/modules/agent/file_agent.py
|
|
90
91
|
tinybird/tb/modules/agent/memory.py
|
|
91
92
|
tinybird/tb/modules/agent/mock_agent.py
|
|
92
93
|
tinybird/tb/modules/agent/models.py
|
|
@@ -102,6 +103,7 @@ tinybird/tb/modules/agent/tools/deploy.py
|
|
|
102
103
|
tinybird/tb/modules/agent/tools/deploy_check.py
|
|
103
104
|
tinybird/tb/modules/agent/tools/diff_resource.py
|
|
104
105
|
tinybird/tb/modules/agent/tools/execute_query.py
|
|
106
|
+
tinybird/tb/modules/agent/tools/file.py
|
|
105
107
|
tinybird/tb/modules/agent/tools/get_endpoint_stats.py
|
|
106
108
|
tinybird/tb/modules/agent/tools/get_openapi_definition.py
|
|
107
109
|
tinybird/tb/modules/agent/tools/mock.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/deploy_check.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/diff_resource.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/execute_query.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/agent/tools/request_endpoint.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/datafile/pipe_checker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb/modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev288 → tinybird-0.0.1.dev290}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|