tinybird 0.0.1.dev266__tar.gz → 0.0.1.dev268__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.

Files changed (149) hide show
  1. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/PKG-INFO +2 -1
  2. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/config.py +0 -4
  3. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/__cli__.py +2 -2
  4. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/agent.py +70 -55
  5. tinybird-0.0.1.dev268/tinybird/tb/modules/agent/banner.py +87 -0
  6. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/command_agent.py +8 -1
  7. tinybird-0.0.1.dev268/tinybird/tb/modules/agent/compactor.py +311 -0
  8. tinybird-0.0.1.dev268/tinybird/tb/modules/agent/explore_agent.py +86 -0
  9. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/memory.py +11 -1
  10. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/prompts.py +51 -36
  11. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/testing_agent.py +8 -1
  12. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/append.py +16 -6
  13. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/create_datafile.py +17 -4
  14. tinybird-0.0.1.dev268/tinybird/tb/modules/agent/tools/execute_query.py +207 -0
  15. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/mock.py +30 -22
  16. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/request_endpoint.py +16 -3
  17. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/run_command.py +3 -1
  18. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/utils.py +42 -0
  19. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/cli.py +5 -9
  20. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/deployment_common.py +4 -1
  21. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird.egg-info/PKG-INFO +2 -1
  22. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird.egg-info/SOURCES.txt +2 -2
  23. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird.egg-info/requires.txt +1 -0
  24. tinybird-0.0.1.dev266/tinybird/tb/modules/agent/banner.py +0 -104
  25. tinybird-0.0.1.dev266/tinybird/tb/modules/agent/tools/execute_query.py +0 -80
  26. tinybird-0.0.1.dev266/tinybird/tb/modules/agent/tools/explore.py +0 -15
  27. tinybird-0.0.1.dev266/tinybird/tb/modules/agent/tools/preview_datafile.py +0 -24
  28. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/setup.cfg +0 -0
  29. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/__cli__.py +0 -0
  30. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/ch_utils/constants.py +0 -0
  31. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/ch_utils/engine.py +0 -0
  32. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/check_pypi.py +0 -0
  33. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/client.py +0 -0
  34. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/connectors.py +0 -0
  35. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/context.py +0 -0
  36. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/datafile/common.py +0 -0
  37. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/datafile/exceptions.py +0 -0
  38. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/datafile/parse_connection.py +0 -0
  39. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/datafile/parse_datasource.py +0 -0
  40. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/datafile/parse_pipe.py +0 -0
  41. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/datatypes.py +0 -0
  42. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/feedback_manager.py +0 -0
  43. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/git_settings.py +0 -0
  44. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/prompts.py +0 -0
  45. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/sql.py +0 -0
  46. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/sql_template.py +0 -0
  47. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/sql_template_fmt.py +0 -0
  48. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/sql_toolset.py +0 -0
  49. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/syncasync.py +0 -0
  50. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/check_pypi.py +0 -0
  51. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/cli.py +0 -0
  52. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/client.py +0 -0
  53. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/config.py +0 -0
  54. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/__init__.py +0 -0
  55. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/animations.py +0 -0
  56. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/models.py +0 -0
  57. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  58. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
  59. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/build.py +0 -0
  60. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  61. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
  62. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
  63. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
  64. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  65. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  66. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/agent/tools/test.py +0 -0
  67. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/build.py +0 -0
  68. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/build_common.py +0 -0
  69. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/cicd.py +0 -0
  70. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/common.py +0 -0
  71. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/config.py +0 -0
  72. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/connection.py +0 -0
  73. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/copy.py +0 -0
  74. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/create.py +0 -0
  75. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/build.py +0 -0
  76. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/build_common.py +0 -0
  77. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  78. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  79. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/diff.py +0 -0
  80. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/fixture.py +0 -0
  81. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/format_common.py +0 -0
  82. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  83. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  84. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  85. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/playground.py +0 -0
  86. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datafile/pull.py +0 -0
  87. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/datasource.py +0 -0
  88. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/deployment.py +0 -0
  89. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/deprecations.py +0 -0
  90. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/dev_server.py +0 -0
  91. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/endpoint.py +0 -0
  92. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/exceptions.py +0 -0
  93. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/feedback_manager.py +0 -0
  94. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/info.py +0 -0
  95. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/infra.py +0 -0
  96. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/job.py +0 -0
  97. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/llm.py +0 -0
  98. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/llm_utils.py +0 -0
  99. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/local.py +0 -0
  100. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/local_common.py +0 -0
  101. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/login.py +0 -0
  102. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/login_common.py +0 -0
  103. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/logout.py +0 -0
  104. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/materialization.py +0 -0
  105. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/mock.py +0 -0
  106. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/mock_common.py +0 -0
  107. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/open.py +0 -0
  108. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/pipe.py +0 -0
  109. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/project.py +0 -0
  110. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/regions.py +0 -0
  111. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/secret.py +0 -0
  112. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/secret_common.py +0 -0
  113. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/shell.py +0 -0
  114. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/sink.py +0 -0
  115. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/table.py +0 -0
  116. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/telemetry.py +0 -0
  117. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/test.py +0 -0
  118. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/test_common.py +0 -0
  119. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  120. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  121. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/token.py +0 -0
  122. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/watch.py +0 -0
  123. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/workspace.py +0 -0
  124. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb/modules/workspace_members.py +0 -0
  125. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli.py +0 -0
  126. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/auth.py +0 -0
  127. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/branch.py +0 -0
  128. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/cicd.py +0 -0
  129. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/cli.py +0 -0
  130. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/common.py +0 -0
  131. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/config.py +0 -0
  132. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/connection.py +0 -0
  133. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/datasource.py +0 -0
  134. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/exceptions.py +0 -0
  135. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/fmt.py +0 -0
  136. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/job.py +0 -0
  137. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/pipe.py +0 -0
  138. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/regions.py +0 -0
  139. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/tag.py +0 -0
  140. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/telemetry.py +0 -0
  141. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/test.py +0 -0
  142. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  143. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  144. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/workspace.py +0 -0
  145. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  146. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird/tornado_template.py +0 -0
  147. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird.egg-info/dependency_links.txt +0 -0
  148. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird.egg-info/entry_points.txt +0 -0
  149. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev268}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev266
3
+ Version: 0.0.1.dev268
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -19,6 +19,7 @@ Requires-Dist: croniter==1.3.15
19
19
  Requires-Dist: docker==7.1.0
20
20
  Requires-Dist: GitPython~=3.1.32
21
21
  Requires-Dist: humanfriendly~=8.2
22
+ Requires-Dist: plotext==5.3.2
22
23
  Requires-Dist: prompt_toolkit==3.0.48
23
24
  Requires-Dist: pydantic~=2.11.7
24
25
  Requires-Dist: pydantic-ai-slim[anthropic]~=0.4.2
@@ -33,7 +33,6 @@ LEGACY_HOSTS = {
33
33
  "https://api.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
34
34
  "https://api.ap-east.aws.tinybird.co": "https://app.tinybird.co/aws/ap-east",
35
35
  "https://api.northamerica-northeast2.gcp.tinybird.co": "https://app.tinybird.co/gcp/northamerica-northeast2",
36
- "https://api.us-west1.gcp.tinybird.co": "https://app.tinybird.co/gcp/us-west1",
37
36
  "https://api.wadus1.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus1",
38
37
  "https://api.wadus2.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus2",
39
38
  "https://api.wadus3.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus3",
@@ -56,7 +55,6 @@ LEGACY_HOSTS = {
56
55
  "https://ui.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
57
56
  "https://ui.split.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/split-us-west-2",
58
57
  "https://ui.northamerica-northeast2.gcp.tinybird.co": "https://app.tinybird.co/gcp/northamerica-northeast2",
59
- "https://ui.us-west1.gcp.tinybird.co": "https://app.tinybird.co/gcp/us-west1",
60
58
  "https://api.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
61
59
  "https://api.split.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/split-us-west-2",
62
60
  "https://ui.wadus1.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus1",
@@ -83,7 +81,6 @@ CLOUD_HOSTS = {
83
81
  "https://api.eu-west-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-west-1",
84
82
  "https://api.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
85
83
  "https://api.northamerica-northeast2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/northamerica-northeast2",
86
- "https://api.us-west1.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/us-west1",
87
84
  "https://api.ap-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/ap-east",
88
85
  "https://ui.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west3",
89
86
  "https://ui.us-east.tinybird.co": "https://cloud.tinybird.co/gcp/us-east4",
@@ -92,7 +89,6 @@ CLOUD_HOSTS = {
92
89
  "https://ui.eu-central-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-central-1",
93
90
  "https://ui.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
94
91
  "https://ui.northamerica-northeast2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/northamerica-northeast2",
95
- "https://ui.us-west1.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/us-west1",
96
92
  }
97
93
 
98
94
 
@@ -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.dev266'
8
- __revision__ = 'b4193e9'
7
+ __version__ = '0.0.1.dev268'
8
+ __revision__ = '22adccb'
@@ -11,7 +11,6 @@ from typing import Any, Optional
11
11
  import click
12
12
  import humanfriendly
13
13
  from pydantic_ai import Agent, RunContext, Tool
14
- from pydantic_ai.agent import AgentRunResult
15
14
  from pydantic_ai.messages import ModelMessage, ModelRequest, UserPromptPart
16
15
  from requests import Response
17
16
 
@@ -19,7 +18,14 @@ from tinybird.tb.client import TinyB
19
18
  from tinybird.tb.modules.agent.animations import ThinkingAnimation
20
19
  from tinybird.tb.modules.agent.banner import display_banner
21
20
  from tinybird.tb.modules.agent.command_agent import CommandAgent
22
- from tinybird.tb.modules.agent.memory import clear_history, clear_messages, load_messages, save_messages
21
+ from tinybird.tb.modules.agent.compactor import compact_messages
22
+ from tinybird.tb.modules.agent.explore_agent import ExploreAgent
23
+ from tinybird.tb.modules.agent.memory import (
24
+ clear_history,
25
+ clear_messages,
26
+ get_last_messages_from_last_user_prompt,
27
+ save_messages,
28
+ )
23
29
  from tinybird.tb.modules.agent.models import create_model
24
30
  from tinybird.tb.modules.agent.prompts import agent_system_prompt, load_custom_project_rules, resources_prompt
25
31
  from tinybird.tb.modules.agent.testing_agent import TestingAgent
@@ -30,13 +36,10 @@ from tinybird.tb.modules.agent.tools.create_datafile import create_datafile, ren
30
36
  from tinybird.tb.modules.agent.tools.deploy import deploy
31
37
  from tinybird.tb.modules.agent.tools.deploy_check import deploy_check
32
38
  from tinybird.tb.modules.agent.tools.diff_resource import diff_resource
33
- from tinybird.tb.modules.agent.tools.execute_query import execute_query
34
39
  from tinybird.tb.modules.agent.tools.get_endpoint_stats import get_endpoint_stats
35
40
  from tinybird.tb.modules.agent.tools.get_openapi_definition import get_openapi_definition
36
41
  from tinybird.tb.modules.agent.tools.mock import mock
37
42
  from tinybird.tb.modules.agent.tools.plan import plan
38
- from tinybird.tb.modules.agent.tools.preview_datafile import preview_datafile
39
- from tinybird.tb.modules.agent.tools.request_endpoint import request_endpoint
40
43
  from tinybird.tb.modules.agent.utils import AgentRunCancelled, TinybirdAgentContext, show_confirmation, show_input
41
44
  from tinybird.tb.modules.build_common import process as build_process
42
45
  from tinybird.tb.modules.common import _analyze, _get_tb_client, echo_safe_humanfriendly_tables_format_pretty_table
@@ -64,20 +67,21 @@ class TinybirdAgent:
64
67
  ):
65
68
  self.token = token
66
69
  self.user_token = user_token
70
+ self.workspace_id = workspace_id
67
71
  self.host = host
68
72
  self.dangerously_skip_permissions = dangerously_skip_permissions or prompt_mode
69
73
  self.project = project
70
74
  self.thinking_animation = ThinkingAnimation()
71
75
  if prompt_mode:
72
- self.messages: list[ModelMessage] = load_messages()[-5:]
76
+ self.messages: list[ModelMessage] = get_last_messages_from_last_user_prompt()
73
77
  else:
74
78
  self.messages = []
79
+
75
80
  self.agent = Agent(
76
81
  model=create_model(user_token, host, workspace_id),
77
82
  deps_type=TinybirdAgentContext,
78
83
  system_prompt=agent_system_prompt,
79
84
  tools=[
80
- Tool(preview_datafile, docstring_format="google", require_parameter_descriptions=True, takes_ctx=False),
81
85
  Tool(create_datafile, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
82
86
  Tool(
83
87
  rename_datafile_or_fixture,
@@ -103,11 +107,9 @@ class TinybirdAgent:
103
107
  require_parameter_descriptions=True,
104
108
  takes_ctx=True,
105
109
  ),
106
- Tool(execute_query, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
107
- Tool(request_endpoint, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
108
110
  Tool(diff_resource, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
109
111
  ],
110
- history_processors=[self._context_aware_processor],
112
+ history_processors=[compact_messages],
111
113
  )
112
114
 
113
115
  self.testing_agent = TestingAgent(
@@ -130,6 +132,16 @@ class TinybirdAgent:
130
132
  workspace_id=workspace_id,
131
133
  project=self.project,
132
134
  )
135
+ self.explore_agent = ExploreAgent(
136
+ dangerously_skip_permissions=self.dangerously_skip_permissions,
137
+ prompt_mode=prompt_mode,
138
+ thinking_animation=self.thinking_animation,
139
+ token=self.token,
140
+ user_token=self.user_token,
141
+ host=self.host,
142
+ workspace_id=workspace_id,
143
+ project=self.project,
144
+ )
133
145
 
134
146
  @self.agent.tool
135
147
  def manage_tests(ctx: RunContext[TinybirdAgentContext], task: str) -> str:
@@ -161,6 +173,20 @@ class TinybirdAgent:
161
173
  result = self.command_agent.run(task, deps=ctx.deps, usage=ctx.usage)
162
174
  return result.output
163
175
 
176
+ @self.agent.tool
177
+ def explore_data(ctx: RunContext[TinybirdAgentContext], task: str) -> str:
178
+ """Explore the data in the project by executing SQL queries or requesting endpoints or exporting data or visualizing data as a chart.
179
+
180
+ Args:
181
+ task (str): The task to solve. Required.
182
+
183
+ Returns:
184
+ str: The summary of the result.
185
+ """
186
+ result = self.explore_agent.run(task, deps=ctx.deps, usage=ctx.usage)
187
+ self.explore_agent.clear_messages()
188
+ return result.output or "No result returned"
189
+
164
190
  @self.agent.instructions
165
191
  def get_local_host(ctx: RunContext[TinybirdAgentContext]) -> str:
166
192
  return f"Tinybird Local host: {ctx.deps.local_host}"
@@ -175,7 +201,7 @@ class TinybirdAgent:
175
201
 
176
202
  @self.agent.instructions
177
203
  def get_cloud_token(ctx: RunContext[TinybirdAgentContext]) -> str:
178
- return f"Tinybird Cloud token: {ctx.deps.token}"
204
+ return "When using in the output the Tinybird Cloud token, use the placeholder __TB_CLOUD_TOKEN__. Do not mention that it is a placeholder, because it will be replaced by the actual token by code."
179
205
 
180
206
  @self.agent.instructions
181
207
  def get_project_files(ctx: RunContext[TinybirdAgentContext]) -> str:
@@ -184,24 +210,7 @@ class TinybirdAgent:
184
210
  def add_message(self, message: ModelMessage) -> None:
185
211
  self.messages.append(message)
186
212
 
187
- def _context_aware_processor(
188
- self,
189
- ctx: RunContext[TinybirdAgentContext],
190
- messages: list[ModelMessage],
191
- ) -> list[ModelMessage]:
192
- # Access current usage
193
- if not ctx.usage:
194
- return messages
195
-
196
- current_tokens = ctx.usage.total_tokens or 0
197
-
198
- # Filter messages based on context
199
- if current_tokens < 200_000:
200
- return messages
201
-
202
- return messages[-10:] # Keep only recent messages when token usage is high
203
-
204
- def _build_agent_deps(self, config: dict[str, Any]) -> TinybirdAgentContext:
213
+ def _build_agent_deps(self, config: dict[str, Any], run_id: Optional[str] = None) -> TinybirdAgentContext:
205
214
  client = TinyB(token=self.token, host=self.host)
206
215
  project = self.project
207
216
  folder = self.project.folder
@@ -233,6 +242,7 @@ class TinybirdAgent:
233
242
  run_tests=partial(run_tests, project=project, client=test_client),
234
243
  folder=folder,
235
244
  thinking_animation=self.thinking_animation,
245
+ workspace_id=self.workspace_id,
236
246
  workspace_name=self.project.workspace_name,
237
247
  dangerously_skip_permissions=self.dangerously_skip_permissions,
238
248
  token=self.token,
@@ -240,6 +250,7 @@ class TinybirdAgent:
240
250
  host=self.host,
241
251
  local_host=local_client.host,
242
252
  local_token=local_client.token,
253
+ run_id=run_id,
243
254
  )
244
255
 
245
256
  def run(self, user_prompt: str, config: dict[str, Any]) -> None:
@@ -255,9 +266,10 @@ class TinybirdAgent:
255
266
  save_messages(new_messages)
256
267
  self.thinking_animation.stop()
257
268
  click.echo(result.output)
258
- self._echo_usage(config, result)
269
+ self.echo_usage(config)
259
270
 
260
- async def run_iter(self, user_prompt: str, config: dict[str, Any], model: Any) -> None:
271
+ async def run_iter(self, user_prompt: str, config: dict[str, Any], run_id: Optional[str] = None) -> None:
272
+ model = create_model(self.user_token, self.host, self.workspace_id, run_id=run_id)
261
273
  user_prompt = f"{user_prompt}\n\n{load_custom_project_rules(self.project.folder)}"
262
274
  self.thinking_animation.start()
263
275
  deps = self._build_agent_deps(config)
@@ -270,7 +282,9 @@ class TinybirdAgent:
270
282
  animation_running = self.thinking_animation.running
271
283
  if animation_running:
272
284
  self.thinking_animation.stop()
273
- click.echo(FeedbackManager.info(message=part.content))
285
+ click.echo(
286
+ FeedbackManager.info(message=part.content.replace("__TB_CLOUD_TOKEN__", self.token))
287
+ )
274
288
  if animation_running:
275
289
  self.thinking_animation.start()
276
290
 
@@ -279,31 +293,28 @@ class TinybirdAgent:
279
293
  self.messages.extend(new_messages)
280
294
  save_messages(new_messages)
281
295
  self.thinking_animation.stop()
282
- self._echo_usage(config, agent_run.result)
296
+ self.echo_usage(config)
283
297
 
284
- def _echo_usage(self, config: dict[str, Any], result: AgentRunResult) -> None:
298
+ def echo_usage(self, config: dict[str, Any]) -> None:
285
299
  try:
286
300
  client = _get_tb_client(config["user_token"], config["host"])
287
301
  workspace_id = config.get("id", "")
288
302
  workspace = client.workspace(workspace_id, with_organization=True, version="v1")
289
303
  limits_data = client.organization_limits(workspace["organization"]["id"])
290
304
  ai_requests_limits = limits_data.get("limits", {}).get("ai_requests", {})
291
- current_ai_requests = ai_requests_limits.get("quantity", 0)
292
- max_ai_requests = ai_requests_limits.get("max", 0)
305
+ current_ai_requests = ai_requests_limits.get("quantity") or 0
306
+ max_ai_requests = ai_requests_limits.get("max") or 0
307
+ remaining_requests = max(max_ai_requests - current_ai_requests, 0)
308
+ current_ai_requests = min(max_ai_requests, current_ai_requests)
293
309
  if not max_ai_requests:
294
310
  return
295
- remaining_requests = max(max_ai_requests - current_ai_requests, 0)
296
311
  warning_threshold = max_ai_requests * 0.8
297
- if current_ai_requests >= warning_threshold:
298
- message_color = FeedbackManager.warning
299
- else:
300
- message_color = FeedbackManager.gray
301
-
302
- current_ai_requests = min(max_ai_requests, current_ai_requests)
303
-
312
+ message_color = (
313
+ FeedbackManager.warning if current_ai_requests >= warning_threshold else FeedbackManager.gray
314
+ )
304
315
  click.echo(
305
316
  message_color(
306
- message=f"{remaining_requests} agent requests left ({current_ai_requests}/{max_ai_requests}). This message is informative. Limits will be enforced soon."
317
+ message=f"{remaining_requests} requests left ({current_ai_requests}/{max_ai_requests}). You can continue using Tinybird Code. Limits will be enforced soon."
307
318
  )
308
319
  )
309
320
  except Exception:
@@ -339,7 +350,7 @@ def run_agent(
339
350
  workspace_id = cli_config.get("id", "")
340
351
  workspace_name = cli_config.get("name", "")
341
352
 
342
- if not token or not host or not user_token:
353
+ if not token or not host or not user_token or not workspace_id:
343
354
  click.echo(
344
355
  FeedbackManager.error(message="Tinybird Code requires authentication. Run 'tb login' first.")
345
356
  )
@@ -383,8 +394,17 @@ def run_agent(
383
394
 
384
395
  # Interactive mode: show banner and enter interactive loop
385
396
  display_banner()
386
- click.echo(FeedbackManager.info(message="Describe what you want to create and I'll help you build it"))
387
- click.echo(FeedbackManager.info(message="Run /help for more commands"))
397
+ click.echo(
398
+ FeedbackManager.info(
399
+ message="""Tips for getting started:
400
+ - Describe what you want to build or ask for specific resources.
401
+ - Run tb commands directly without leaving interactive mode.
402
+ - Create a TINYBIRD.md file to customize your interactions.
403
+ """
404
+ )
405
+ )
406
+ agent.echo_usage(config)
407
+ click.echo()
388
408
 
389
409
  except Exception as e:
390
410
  click.echo(FeedbackManager.error(message=f"Failed to initialize agent: {e}"))
@@ -431,18 +451,13 @@ def run_agent(
431
451
 
432
452
  continue
433
453
  elif user_input.lower() == "/help":
434
- click.echo(" Describe what you want to create: 'Create a user analytics system'")
435
- click.echo("• Ask for specific resources: 'Create a pipe to aggregate daily clicks'")
436
- click.echo("• Connect to external services: 'Set up a Kafka connection for events'")
437
- click.echo("• Type '/exit' or '/quit' to leave")
438
-
454
+ subprocess.run(["tb", "--help"], check=True)
439
455
  continue
440
456
  elif user_input.strip() == "":
441
457
  continue
442
458
  else:
443
459
  run_id = str(uuid.uuid4())
444
- model = create_model(user_token, host, workspace_id, run_id=run_id)
445
- asyncio.run(agent.run_iter(user_input, config, model))
460
+ asyncio.run(agent.run_iter(user_input, config, run_id))
446
461
  except AgentRunCancelled:
447
462
  click.echo(FeedbackManager.info(message="User cancelled the operation"))
448
463
  agent.add_message(
@@ -0,0 +1,87 @@
1
+ import os
2
+ import sys
3
+
4
+ import click
5
+
6
+
7
+ def detect_terminal_capabilities():
8
+ """Detect terminal color and Unicode capabilities"""
9
+ # Check for true color support
10
+ colorterm = os.environ.get("COLORTERM", "").lower()
11
+ term = os.environ.get("TERM", "").lower()
12
+ term_program = os.environ.get("TERM_PROGRAM", "").lower()
13
+
14
+ # Known terminals with good true color support
15
+ modern_terminals = ["warp", "ghostty", "iterm2", "alacritty", "kitty", "hyper"]
16
+
17
+ # Check for true color support
18
+ has_truecolor = (
19
+ colorterm in ["truecolor", "24bit"]
20
+ or term_program in modern_terminals
21
+ or "truecolor" in term
22
+ or "24bit" in term
23
+ )
24
+
25
+ # Check if it's standard macOS Terminal
26
+ is_macos_terminal = term_program == "apple_terminal"
27
+
28
+ # Check for Unicode support (most modern terminals support this)
29
+ has_unicode = sys.stdout.encoding and "utf" in sys.stdout.encoding.lower()
30
+
31
+ return {
32
+ "truecolor": has_truecolor and not is_macos_terminal,
33
+ "unicode": has_unicode,
34
+ "is_macos_terminal": is_macos_terminal,
35
+ }
36
+
37
+
38
+ def display_banner():
39
+ reset = "\033[0m"
40
+ capabilities = detect_terminal_capabilities()
41
+
42
+ click.echo("\n")
43
+
44
+ banner = [
45
+ " ████████╗██╗███╗ ██╗██╗ ██╗██████╗ ██╗██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗",
46
+ " ╚══██╔══╝██║████╗ ██║╚██╗ ██╔╝██╔══██╗██║██╔══██╗██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝",
47
+ " ██║ ██║██╔██╗ ██║ ╚████╔╝ ██████╔╝██║██████╔╝██║ ██║ ██║ ██║ ██║██║ ██║█████╗ ",
48
+ " ██║ ██║██║╚██╗██║ ╚██╔╝ ██╔══██╗██║██╔══██╗██║ ██║ ██║ ██║ ██║██║ ██║██╔══╝ ",
49
+ " ██║ ██║██║ ╚████║ ██║ ██████╔╝██║██║ ██║██████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗",
50
+ " ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝",
51
+ ]
52
+
53
+ def rgb_to_ansi(r: int, g: int, b: int, use_truecolor: bool):
54
+ """Convert RGB values to ANSI escape code"""
55
+ if use_truecolor:
56
+ return f"\033[38;2;{r};{g};{b}m"
57
+ else:
58
+ # Convert to 8-bit color (256 color palette)
59
+ # Simple approximation: map RGB to 216-color cube + grayscale
60
+ if r == g == b:
61
+ # Grayscale
62
+ gray = int(r / 255 * 23) + 232
63
+ return f"\033[38;5;{gray}m"
64
+ else:
65
+ # Color cube (6x6x6)
66
+ r_idx = int(r / 255 * 5)
67
+ g_idx = int(g / 255 * 5)
68
+ b_idx = int(b / 255 * 5)
69
+ color_idx = 16 + (36 * r_idx) + (6 * g_idx) + b_idx
70
+ return f"\033[38;5;{color_idx}m"
71
+
72
+ # Define solid color (corresponding to #27f795)
73
+ solid_color = [39, 247, 149] # #27f795 in RGB
74
+
75
+ # Print each line with solid color for all terminals
76
+ for line in banner:
77
+ colored_line = ""
78
+ color_code = rgb_to_ansi(*solid_color, use_truecolor=capabilities["truecolor"]) # type: ignore
79
+
80
+ for char in line:
81
+ if char == " ":
82
+ colored_line += char
83
+ else:
84
+ colored_line += f"{color_code}{char}"
85
+
86
+ click.echo(colored_line + reset)
87
+ click.echo()
@@ -25,6 +25,7 @@ class CommandAgent:
25
25
  self.token = token
26
26
  self.user_token = user_token
27
27
  self.host = host
28
+ self.workspace_id = workspace_id
28
29
  self.dangerously_skip_permissions = dangerously_skip_permissions or prompt_mode
29
30
  self.project = project
30
31
  self.thinking_animation = thinking_animation
@@ -54,6 +55,12 @@ Always run first help commands to be sure that the commands you are running is n
54
55
  return tests_files_prompt(self.project)
55
56
 
56
57
  def run(self, task: str, deps: TinybirdAgentContext, usage: Usage):
57
- result = self.agent.run_sync(task, deps=deps, usage=usage, message_history=self.messages)
58
+ result = self.agent.run_sync(
59
+ task,
60
+ deps=deps,
61
+ usage=usage,
62
+ message_history=self.messages,
63
+ model=create_model(self.user_token, self.host, self.workspace_id, run_id=deps.run_id),
64
+ )
58
65
  self.messages.extend(result.new_messages())
59
66
  return result