tinybird 0.0.1.dev301__tar.gz → 0.0.1.dev302__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 (152) hide show
  1. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/agent.py +16 -42
  4. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/models.py +6 -2
  5. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/utils.py +0 -1
  6. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/cli.py +1 -2
  7. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/create.py +72 -150
  8. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datasource.py +24 -6
  9. tinybird-0.0.1.dev302/tinybird/tb/modules/mock.py +41 -0
  10. tinybird-0.0.1.dev302/tinybird/tb/modules/mock_common.py +17 -0
  11. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/test.py +7 -6
  12. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/test_common.py +0 -89
  13. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird.egg-info/PKG-INFO +1 -1
  14. tinybird-0.0.1.dev301/tinybird/tb/modules/mock.py +0 -90
  15. tinybird-0.0.1.dev301/tinybird/tb/modules/mock_common.py +0 -71
  16. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/setup.cfg +0 -0
  17. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/__cli__.py +0 -0
  18. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/ch_utils/constants.py +0 -0
  19. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/ch_utils/engine.py +0 -0
  20. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/check_pypi.py +0 -0
  21. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/client.py +0 -0
  22. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/config.py +0 -0
  23. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/connectors.py +0 -0
  24. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/context.py +0 -0
  25. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/datafile/common.py +0 -0
  26. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/datafile/exceptions.py +0 -0
  27. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/datafile/parse_connection.py +0 -0
  28. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/datafile/parse_datasource.py +0 -0
  29. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/datafile/parse_pipe.py +0 -0
  30. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/datatypes.py +0 -0
  31. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/feedback_manager.py +0 -0
  32. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/git_settings.py +0 -0
  33. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/prompts.py +0 -0
  34. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/service_datasources.py +0 -0
  35. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/sql.py +0 -0
  36. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/sql_template.py +0 -0
  37. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/sql_template_fmt.py +0 -0
  38. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/sql_toolset.py +0 -0
  39. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/syncasync.py +0 -0
  40. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/check_pypi.py +0 -0
  41. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/cli.py +0 -0
  42. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/client.py +0 -0
  43. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/config.py +0 -0
  44. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/__init__.py +0 -0
  45. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/animations.py +0 -0
  46. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/banner.py +0 -0
  47. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/command_agent.py +0 -0
  48. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/compactor.py +0 -0
  49. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/explore_agent.py +0 -0
  50. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/file_agent.py +0 -0
  51. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/memory.py +0 -0
  52. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/mock_agent.py +0 -0
  53. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/prompts.py +0 -0
  54. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/testing_agent.py +0 -0
  55. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  56. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
  57. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/append.py +0 -0
  58. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/build.py +0 -0
  59. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
  60. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  61. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
  62. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
  63. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
  64. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/file.py +0 -0
  65. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
  66. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  67. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/mock.py +0 -0
  68. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  69. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
  70. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/run_command.py +0 -0
  71. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/secret.py +0 -0
  72. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/agent/tools/test.py +0 -0
  73. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/build.py +0 -0
  74. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/build_common.py +0 -0
  75. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/cicd.py +0 -0
  76. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/common.py +0 -0
  77. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/config.py +0 -0
  78. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/connection.py +0 -0
  79. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/copy.py +0 -0
  80. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/build.py +0 -0
  81. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/build_common.py +0 -0
  82. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  83. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  84. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/diff.py +0 -0
  85. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/fixture.py +0 -0
  86. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/format_common.py +0 -0
  87. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  88. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  89. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  90. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/playground.py +0 -0
  91. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/datafile/pull.py +0 -0
  92. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/deployment.py +0 -0
  93. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/deployment_common.py +0 -0
  94. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/deprecations.py +0 -0
  95. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/dev_server.py +0 -0
  96. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/endpoint.py +0 -0
  97. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/exceptions.py +0 -0
  98. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/feedback_manager.py +0 -0
  99. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/info.py +0 -0
  100. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/infra.py +0 -0
  101. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/job.py +0 -0
  102. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/llm.py +0 -0
  103. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/llm_utils.py +0 -0
  104. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/local.py +0 -0
  105. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/local_common.py +0 -0
  106. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/login.py +0 -0
  107. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/login_common.py +0 -0
  108. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/logout.py +0 -0
  109. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/materialization.py +0 -0
  110. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/open.py +0 -0
  111. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/pipe.py +0 -0
  112. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/project.py +0 -0
  113. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/regions.py +0 -0
  114. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/secret.py +0 -0
  115. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/secret_common.py +0 -0
  116. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/shell.py +0 -0
  117. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/sink.py +0 -0
  118. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/table.py +0 -0
  119. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/telemetry.py +0 -0
  120. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  121. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  122. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/token.py +0 -0
  123. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/watch.py +0 -0
  124. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/workspace.py +0 -0
  125. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb/modules/workspace_members.py +0 -0
  126. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli.py +0 -0
  127. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/auth.py +0 -0
  128. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/branch.py +0 -0
  129. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/cicd.py +0 -0
  130. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/cli.py +0 -0
  131. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/common.py +0 -0
  132. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/config.py +0 -0
  133. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/connection.py +0 -0
  134. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/datasource.py +0 -0
  135. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/exceptions.py +0 -0
  136. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/fmt.py +0 -0
  137. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/job.py +0 -0
  138. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/pipe.py +0 -0
  139. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/regions.py +0 -0
  140. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/tag.py +0 -0
  141. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/telemetry.py +0 -0
  142. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/test.py +0 -0
  143. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  144. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  145. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/workspace.py +0 -0
  146. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  147. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird/tornado_template.py +0 -0
  148. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird.egg-info/SOURCES.txt +0 -0
  149. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird.egg-info/dependency_links.txt +0 -0
  150. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird.egg-info/entry_points.txt +0 -0
  151. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/tinybird.egg-info/requires.txt +0 -0
  152. {tinybird-0.0.1.dev301 → tinybird-0.0.1.dev302}/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.dev301
3
+ Version: 0.0.1.dev302
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -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.dev301'
8
- __revision__ = '1ce40fd'
7
+ __version__ = '0.0.1.dev302'
8
+ __revision__ = 'cf4d28e'
@@ -6,7 +6,6 @@ import sys
6
6
  import urllib.parse
7
7
  import uuid
8
8
  from functools import partial
9
- from pathlib import Path
10
9
  from typing import Any, Callable, Optional
11
10
 
12
11
  import click
@@ -27,7 +26,6 @@ from tinybird.tb.modules.agent.file_agent import FileAgent
27
26
  from tinybird.tb.modules.agent.memory import (
28
27
  clear_history,
29
28
  clear_messages,
30
- get_last_messages_from_last_user_prompt,
31
29
  save_messages,
32
30
  )
33
31
  from tinybird.tb.modules.agent.mock_agent import MockAgent
@@ -72,12 +70,12 @@ from tinybird.tb.modules.common import (
72
70
  )
73
71
  from tinybird.tb.modules.config import CLIConfig
74
72
  from tinybird.tb.modules.deployment_common import create_deployment
75
- from tinybird.tb.modules.exceptions import CLIBuildException, CLIDeploymentException, CLIMockException
73
+ from tinybird.tb.modules.exceptions import CLIBuildException, CLIDeploymentException
76
74
  from tinybird.tb.modules.feedback_manager import FeedbackManager
77
75
  from tinybird.tb.modules.llm import LLM
78
76
  from tinybird.tb.modules.local_common import get_tinybird_local_client
79
77
  from tinybird.tb.modules.login_common import login
80
- from tinybird.tb.modules.mock_common import append_mock_data, create_mock_data
78
+ from tinybird.tb.modules.mock_common import append_mock_data
81
79
  from tinybird.tb.modules.project import Project
82
80
  from tinybird.tb.modules.test_common import run_tests as run_tests_common
83
81
 
@@ -92,6 +90,7 @@ class TinybirdAgent:
92
90
  project: Project,
93
91
  dangerously_skip_permissions: bool,
94
92
  prompt_mode: bool,
93
+ feature: Optional[str] = None,
95
94
  ):
96
95
  self.token = token
97
96
  self.user_token = user_token
@@ -101,14 +100,12 @@ class TinybirdAgent:
101
100
  self.project = project
102
101
  self.thinking_animation = ThinkingAnimation()
103
102
  self.confirmed_plan_id: Optional[str] = None
104
- if prompt_mode:
105
- self.messages: list[ModelMessage] = get_last_messages_from_last_user_prompt()
106
- else:
107
- self.messages = []
103
+ self.feature = feature
104
+ self.messages: list[ModelMessage] = []
108
105
  cli_config = CLIConfig.get_project_config()
109
106
  regions = get_regions(cli_config)
110
107
  self.agent = Agent(
111
- model=create_model(user_token, host, workspace_id),
108
+ model=create_model(user_token, host, workspace_id, feature=feature),
112
109
  deps_type=TinybirdAgentContext,
113
110
  instructions=[agent_system_prompt],
114
111
  tools=[
@@ -382,7 +379,6 @@ class TinybirdAgent:
382
379
  build_project=partial(build_project, project=project, config=config),
383
380
  deploy_project=partial(deploy_project, project=project, config=config),
384
381
  deploy_check_project=partial(deploy_check_project, project=project, config=config),
385
- mock_data=partial(mock_data, project=project, config=config),
386
382
  append_data_local=partial(append_data_local, config=config),
387
383
  append_data_cloud=partial(append_data_cloud, config=config),
388
384
  analyze_fixture=partial(analyze_fixture, config=config),
@@ -511,7 +507,11 @@ class TinybirdAgent:
511
507
 
512
508
 
513
509
  def run_agent(
514
- config: dict[str, Any], project: Project, dangerously_skip_permissions: bool, prompt: Optional[str] = None
510
+ config: dict[str, Any],
511
+ project: Project,
512
+ dangerously_skip_permissions: bool,
513
+ prompt: Optional[str] = None,
514
+ feature: Optional[str] = None,
515
515
  ):
516
516
  if not prompt:
517
517
  latest_version = CheckPypi().get_latest_version()
@@ -526,7 +526,10 @@ def run_agent(
526
526
  )
527
527
  if yes:
528
528
  update_cli()
529
- click.echo(FeedbackManager.highlight(message="» Initializing Tinybird Code..."))
529
+
530
+ if not prompt:
531
+ click.echo(FeedbackManager.highlight(message="» Initializing Tinybird Code..."))
532
+
530
533
  token = config.get("token", "")
531
534
  host = config.get("host", "")
532
535
  user_token = config.get("user_token", "")
@@ -585,6 +588,7 @@ def run_agent(
585
588
  project,
586
589
  dangerously_skip_permissions,
587
590
  prompt_mode,
591
+ feature,
588
592
  )
589
593
 
590
594
  # Print mode: run once with the provided prompt and exit
@@ -763,36 +767,6 @@ def append_data_cloud(config: dict[str, Any], datasource_name: str, path: str) -
763
767
  append_mock_data(client, datasource_name, path)
764
768
 
765
769
 
766
- def mock_data(
767
- config: dict[str, Any],
768
- project: Project,
769
- datasource_name: str,
770
- data_format: str,
771
- rows: int,
772
- context: Optional[str] = None,
773
- ) -> list[dict[str, Any]]:
774
- client = get_tinybird_local_client(config, test=False, silent=False)
775
- cli_config = CLIConfig.get_project_config()
776
- datasource_path = project.get_resource_path(datasource_name, "datasource")
777
-
778
- if not datasource_path:
779
- raise CLIMockException(f"Datasource {datasource_name} not found")
780
-
781
- datasource_content = Path(datasource_path).read_text()
782
- return create_mock_data(
783
- datasource_name,
784
- datasource_content,
785
- rows,
786
- context or "",
787
- cli_config,
788
- config,
789
- cli_config.get_user_token() or "",
790
- client,
791
- data_format,
792
- project.folder,
793
- )
794
-
795
-
796
770
  def analyze_fixture(config: dict[str, Any], fixture_path: str, format: str = "json") -> dict[str, Any]:
797
771
  local_client = get_tinybird_local_client(config, test=False, silent=True)
798
772
  meta, _data = _analyze(fixture_path, local_client, format)
@@ -8,7 +8,7 @@ from pydantic_ai.retries import AsyncTenacityTransport, wait_retry_after
8
8
  from tenacity import AsyncRetrying, retry_if_exception_type, stop_after_attempt, wait_exponential
9
9
 
10
10
 
11
- def create_retrying_client(token: str, workspace_id: str):
11
+ def create_retrying_client(token: str, workspace_id: str, feature: Optional[str] = None):
12
12
  """Create a client with smart retry handling for multiple error types."""
13
13
 
14
14
  def should_retry_status(response):
@@ -29,7 +29,10 @@ def create_retrying_client(token: str, workspace_id: str):
29
29
  ),
30
30
  validate_response=should_retry_status,
31
31
  )
32
- return AsyncClient(transport=transport, params={"token": token, "workspace_id": workspace_id})
32
+ params = {"token": token, "workspace_id": workspace_id}
33
+ if feature:
34
+ params["feature"] = feature
35
+ return AsyncClient(transport=transport, params=params)
33
36
 
34
37
 
35
38
  def create_model(
@@ -38,6 +41,7 @@ def create_model(
38
41
  workspace_id: str,
39
42
  model: AnthropicModelName = "claude-4-sonnet-20250514",
40
43
  run_id: Optional[str] = None,
44
+ feature: Optional[str] = None,
41
45
  ):
42
46
  default_headers = {}
43
47
  if run_id:
@@ -44,7 +44,6 @@ class TinybirdAgentContext(BaseModel):
44
44
  build_project_test: Callable[..., None]
45
45
  deploy_project: Callable[..., None]
46
46
  deploy_check_project: Callable[[], None]
47
- mock_data: Callable[..., list[dict[str, Any]]]
48
47
  append_data_local: Callable[..., None]
49
48
  append_data_cloud: Callable[..., None]
50
49
  analyze_fixture: Callable[..., dict[str, Any]]
@@ -488,7 +488,6 @@ def create_ctx_client(
488
488
  "logout",
489
489
  "update",
490
490
  "upgrade",
491
- "create",
492
491
  "info",
493
492
  "tag",
494
493
  "push",
@@ -502,7 +501,7 @@ def create_ctx_client(
502
501
  return None
503
502
 
504
503
  commands_always_cloud = ["infra"]
505
- commands_always_local = ["build", "dev"]
504
+ commands_always_local = ["build", "dev", "create"]
506
505
  command_always_test = ["test"]
507
506
 
508
507
  if (
@@ -3,25 +3,22 @@ import os
3
3
  import re
4
4
  import shutil
5
5
  from pathlib import Path
6
- from typing import Any, Dict, List, Optional
6
+ from typing import Any, Dict, List, Optional, Set
7
7
  from urllib.parse import urlparse
8
8
 
9
9
  import click
10
10
  import requests
11
11
 
12
- from tinybird.prompts import claude_rules_prompt, create_prompt, readme_prompt, rules_prompt
13
- from tinybird.tb.client import TinyB
12
+ from tinybird.prompts import claude_rules_prompt, rules_prompt
13
+ from tinybird.tb.modules.agent import run_agent
14
14
  from tinybird.tb.modules.cicd import init_cicd
15
15
  from tinybird.tb.modules.cli import cli
16
- from tinybird.tb.modules.common import _generate_datafile, generate_datafile
16
+ from tinybird.tb.modules.common import _generate_datafile
17
17
  from tinybird.tb.modules.config import CLIConfig
18
18
  from tinybird.tb.modules.datafile.fixture import persist_fixture
19
19
  from tinybird.tb.modules.exceptions import CLICreateException
20
20
  from tinybird.tb.modules.feedback_manager import FeedbackManager
21
- from tinybird.tb.modules.llm import LLM
22
- from tinybird.tb.modules.llm_utils import extract_xml, parse_xml
23
21
  from tinybird.tb.modules.local_common import get_tinybird_local_client
24
- from tinybird.tb.modules.mock_common import create_mock_data
25
22
  from tinybird.tb.modules.project import Project
26
23
 
27
24
 
@@ -67,13 +64,9 @@ def create(
67
64
  folder_path.mkdir()
68
65
 
69
66
  try:
70
- tb_client = config.get_client(token=ctx_config.get("token"), host=ctx_config.get("host"))
71
- user_token: str = ""
72
67
  created_something = False
73
- if prompt:
74
- user_token = ctx_config.get("user_token")
75
- if not user_token:
76
- raise Exception("This action requires authentication. Run 'tb login' first.")
68
+ if prompt and not ctx_config.get("user_token"):
69
+ raise Exception("This action requires authentication. Run 'tb login' first.")
77
70
 
78
71
  if not validate_project_structure(project):
79
72
  click.echo(FeedbackManager.highlight(message="\n» Creating new project structure..."))
@@ -99,28 +92,20 @@ def create(
99
92
 
100
93
  prompt_result: List[Path] = []
101
94
  if prompt:
102
- prompt_result = create_resources_from_prompt(tb_client, user_token, prompt, project)
103
- result.extend(prompt_result)
104
- readme_path = folder_path / "README.md"
105
- if readme_path.exists():
106
- click.echo(FeedbackManager.highlight(message="\n» Updating project description..."))
107
- else:
108
- click.echo(FeedbackManager.highlight(message="\n» Creating project description..."))
109
- readme_path.touch()
110
- llm = LLM(user_token=str(user_token), host=tb_client.host)
111
- readme_user_prompt = prompt or ""
112
- all_resources_xml = get_resources_xml(project)
113
- readme_response = llm.ask(
114
- system_prompt=readme_prompt(
115
- readme_path.read_text(), tb_client.host, "$TB_ADMIN_TOKEN", all_resources_xml
116
- ),
117
- prompt=readme_user_prompt,
118
- feature="tb_create_readme",
95
+ prompt_instructions = (
96
+ "Create or update the Tinybird datasources, pipes, and connections required to satisfy the following request. "
97
+ "Do not generate mock data or append data; those steps will run later programmatically."
119
98
  )
120
- readme_result = extract_xml(readme_response, "readme")
121
- readme_path.write_text(readme_result)
122
- click.echo(FeedbackManager.info_file_created(file="README.md"))
123
- created_something = True
99
+ prompt_result = create_resources_from_prompt(
100
+ ctx_config,
101
+ project,
102
+ prompt,
103
+ feature="tb_create",
104
+ instructions=prompt_instructions,
105
+ )
106
+ result.extend(prompt_result)
107
+ if prompt_result:
108
+ created_something = True
124
109
 
125
110
  if data or prompt:
126
111
  click.echo(FeedbackManager.success(message="✓ Resources created!\n"))
@@ -180,24 +165,30 @@ def create(
180
165
  datasource_name = datasource_path.stem
181
166
  datasource_content = datasource_path.read_text()
182
167
  has_json_path = "`json:" in datasource_content
183
- if has_json_path:
184
- mock_data = create_mock_data(
185
- datasource_name,
186
- datasource_content,
187
- rows,
188
- prompt,
189
- config,
190
- ctx_config,
191
- user_token,
192
- tb_client,
193
- format_="ndjson",
194
- folder=project.folder,
195
- )
196
- if mock_data:
197
- persist_fixture(datasource_name, mock_data, folder, format="ndjson")
198
- click.echo(FeedbackManager.info_file_created(file=f"fixtures/{datasource_name}.ndjson"))
199
- click.echo(FeedbackManager.success(message="✓ Done!"))
200
- created_something = True
168
+ if not has_json_path:
169
+ continue
170
+
171
+ fixture_path = Path(folder) / "fixtures" / f"{datasource_name}.ndjson"
172
+ fixture_existed = fixture_path.exists()
173
+ fixture_prompt = (
174
+ f"Generate {rows} rows of representative sample data for the Tinybird datasource defined in {datasource_path}. "
175
+ f"Store the data in ndjson format at fixtures/{datasource_name}.ndjson."
176
+ )
177
+ if prompt.strip():
178
+ fixture_prompt += f"\n\nOriginal project request:\n{prompt.strip()}"
179
+
180
+ run_agent(
181
+ ctx_config,
182
+ project,
183
+ True,
184
+ prompt=fixture_prompt,
185
+ feature="tb_mock",
186
+ )
187
+
188
+ if fixture_path.exists() and not fixture_existed:
189
+ click.echo(FeedbackManager.info_file_created(file=f"fixtures/{datasource_name}.ndjson"))
190
+ click.echo(FeedbackManager.success(message="✓ Done!"))
191
+ created_something = True
201
192
 
202
193
  if not created_something and not len(result) > 0:
203
194
  click.echo(FeedbackManager.warning(message="△ No resources created\n"))
@@ -291,86 +282,39 @@ def create_project_structure(folder: str):
291
282
 
292
283
 
293
284
  def create_resources_from_prompt(
294
- tb_client: TinyB,
295
- user_token: str,
296
- prompt: str,
285
+ config: Dict[str, Any],
297
286
  project: Project,
298
- feature: str = "tb_create_resources",
287
+ prompt: str,
288
+ feature: str = "tb_create",
289
+ instructions: Optional[str] = None,
299
290
  ) -> List[Path]:
300
- result: List[Path] = []
301
- datasource_paths = [Path(ds_file) for ds_file in project.get_datasource_files()]
302
- pipes_paths = [Path(pipe_file) for pipe_file in project.get_pipe_files()]
303
- connections_paths = [Path(conn_file) for conn_file in project.get_connection_files()]
304
- resources_xml = "\n".join(
305
- [
306
- f"<resource><type>{resource_type}</type><name>{resource_name}</name><content>{resource_content}</content></resource>"
307
- for resource_type, resource_name, resource_content in [
308
- ("datasource", ds.stem, ds.read_text()) for ds in datasource_paths
309
- ]
310
- + [
311
- (
312
- "pipe",
313
- pipe.stem,
314
- pipe.read_text(),
315
- )
316
- for pipe in pipes_paths
317
- ]
318
- + [
319
- (
320
- "connection",
321
- conn.stem,
322
- conn.read_text(),
323
- )
324
- for conn in connections_paths
325
- ]
326
- ]
327
- )
328
- llm = LLM(user_token=user_token, host=tb_client.host)
329
- prompt_result = llm.ask(system_prompt=create_prompt(resources_xml), prompt=prompt, feature=feature)
330
- prompt_result = extract_xml(prompt_result, "response")
331
- resources = parse_xml(prompt_result, "resource")
332
- datasources = []
333
- pipes = []
334
- connections = []
335
- for resource_xml in resources:
336
- resource_type = extract_xml(resource_xml, "type")
337
- name = extract_xml(resource_xml, "name")
338
- content = extract_xml(resource_xml, "content")
339
- resource = {
340
- "name": name,
341
- "content": content,
342
- }
343
- if resource_type.lower() == "datasource":
344
- datasources.append(resource)
345
- elif resource_type.lower() == "pipe":
346
- pipes.append(resource)
347
- elif resource_type.lower() == "connection":
348
- connections.append(resource)
349
-
350
- for ds in datasources:
351
- content = ds["content"].replace("```", "")
352
- filename = f"{ds['name']}.datasource"
353
- ds_file = generate_datafile(
354
- content,
355
- filename=filename,
356
- data=None,
357
- _format="ndjson",
358
- force=True,
359
- folder=project.folder,
360
- )
361
- result.append(ds_file)
362
- for pipe in pipes:
363
- content = pipe["content"].replace("```", "")
364
- pipe_file = generate_pipe_file(pipe["name"], content, project.folder)
365
- result.append(pipe_file)
291
+ """Run the agent in prompt mode and report newly created project resources."""
366
292
 
367
- for conn in connections:
368
- content = conn["content"].replace("```", "")
369
- filename = f"{conn['name']}.connection"
370
- conn_file = generate_connection_file(conn["name"], content, project.folder)
371
- result.append(conn_file)
293
+ agent_prompt = prompt.strip()
294
+ if instructions:
295
+ instructions = instructions.strip()
296
+ if agent_prompt:
297
+ agent_prompt = f"{instructions}\n\n{agent_prompt}"
298
+ else:
299
+ agent_prompt = instructions
372
300
 
373
- return result
301
+ if not agent_prompt:
302
+ return []
303
+
304
+ resources_before = _collect_project_resource_paths(project)
305
+ run_agent(config, project, True, prompt=agent_prompt, feature=feature)
306
+ resources_after = _collect_project_resource_paths(project)
307
+
308
+ created_resources = [Path(path) for path in sorted(resources_after - resources_before)]
309
+ return created_resources
310
+
311
+
312
+ def _collect_project_resource_paths(project: Project) -> Set[Path]:
313
+ resources: Set[Path] = set()
314
+ resources.update(Path(path) for path in project.get_datasource_files())
315
+ resources.update(Path(path) for path in project.get_pipe_files())
316
+ resources.update(Path(path) for path in project.get_connection_files())
317
+ return resources
374
318
 
375
319
 
376
320
  def init_git(folder: str):
@@ -513,28 +457,6 @@ def save_context(prompt: str, feedback: str):
513
457
  context_file.write_text(f"- {prompt}\n{feedback}")
514
458
 
515
459
 
516
- def get_resources_xml(project: Project) -> str:
517
- datasource_paths = [Path(f) for f in project.get_datasource_files()]
518
- pipes_paths = [Path(f) for f in project.get_pipe_files()]
519
- resources_xml = "\n".join(
520
- [
521
- f"<resource><type>{resource_type}</type><name>{resource_name}</name><content>{resource_content}</content></resource>"
522
- for resource_type, resource_name, resource_content in [
523
- ("datasource", ds.stem, ds.read_text()) for ds in datasource_paths
524
- ]
525
- + [
526
- (
527
- "pipe",
528
- pipe.stem,
529
- pipe.read_text(),
530
- )
531
- for pipe in pipes_paths
532
- ]
533
- ]
534
- )
535
- return resources_xml
536
-
537
-
538
460
  def create_resources_from_data(
539
461
  data: str,
540
462
  project: Project,
@@ -768,13 +768,31 @@ def datasource_create(
768
768
 
769
769
  if datasource_type == "prompt":
770
770
  click.echo(FeedbackManager.gray(message="\n» Creating .datasource file..."))
771
- user_token = config.get("user_token")
772
- if not user_token:
771
+ if not config.get("user_token"):
773
772
  raise Exception("This action requires authentication. Run 'tb login' first.")
774
- project_config = CLIConfig.get_project_config()
775
- tb_client: TinyB = project_config.get_client(token=config.get("token"), host=config.get("host"))
776
- create_resources_from_prompt(tb_client, user_token, prompt, project, feature="tb_datasource_create")
777
- click.echo(FeedbackManager.success(message=" .datasource created!"))
773
+
774
+ instructions = (
775
+ "Create or update a Tinybird datasource (.datasource file) for this project. "
776
+ "Do not generate mock data or append data; those steps will run later programmatically."
777
+ )
778
+ if name:
779
+ instructions += f" Name the datasource '{name}'."
780
+
781
+ created_resources = create_resources_from_prompt(
782
+ config,
783
+ project,
784
+ prompt,
785
+ feature="tb_datasource_create",
786
+ instructions=instructions,
787
+ )
788
+ if any(path.suffix == ".datasource" for path in created_resources):
789
+ click.echo(FeedbackManager.success(message="✓ .datasource created!"))
790
+ else:
791
+ click.echo(
792
+ FeedbackManager.gray(
793
+ message="△ No new datasource file detected. Existing resources may have been updated instead."
794
+ )
795
+ )
778
796
  return
779
797
 
780
798
  connection_required = datasource_type in ("kafka", "s3", "gcs")
@@ -0,0 +1,41 @@
1
+ import click
2
+
3
+ from tinybird.tb.modules.agent import run_agent
4
+ from tinybird.tb.modules.cli import cli
5
+ from tinybird.tb.modules.exceptions import CLIMockException
6
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
7
+ from tinybird.tb.modules.project import Project
8
+
9
+
10
+ @cli.command()
11
+ @click.argument("datasource", type=str)
12
+ @click.option("--rows", type=int, default=10, help="Number of events to send")
13
+ @click.option(
14
+ "--prompt",
15
+ type=str,
16
+ default="",
17
+ help="Extra context to use for data generation",
18
+ )
19
+ @click.option(
20
+ "--format",
21
+ "format_",
22
+ type=click.Choice(["ndjson", "csv"], case_sensitive=False),
23
+ default="ndjson",
24
+ help="Format of the fixture to create",
25
+ )
26
+ @click.pass_context
27
+ def mock(ctx: click.Context, datasource: str, rows: int, prompt: str, format_: str) -> None:
28
+ """Generate sample data for a data source."""
29
+
30
+ try:
31
+ project: Project = ctx.ensure_object(dict)["project"]
32
+ ctx_config = ctx.ensure_object(dict)["config"]
33
+ prompt = f"""Generate mock data for the following datasource: {datasource} with {rows} rows and {format_} format. Extra context: {prompt}"""
34
+ env = ctx.ensure_object(dict)["env"]
35
+ if env == "cloud":
36
+ prompt += "Append the fixture data to the datasource in Tinybird Cloud."
37
+
38
+ run_agent(ctx_config, project, True, prompt=prompt, feature="tb_mock")
39
+
40
+ except Exception as e:
41
+ raise CLIMockException(FeedbackManager.error(message=str(e)))
@@ -0,0 +1,17 @@
1
+ from tinybird.tb.client import TinyB
2
+ from tinybird.tb.modules.common import push_data
3
+
4
+
5
+ def append_mock_data(
6
+ tb_client: TinyB,
7
+ datasource_name: str,
8
+ url: str,
9
+ ):
10
+ push_data(
11
+ tb_client,
12
+ datasource_name,
13
+ url,
14
+ mode="append",
15
+ concurrency=1,
16
+ silent=True,
17
+ )
@@ -8,9 +8,10 @@ from typing import Any, Tuple
8
8
  import click
9
9
 
10
10
  from tinybird.tb.client import TinyB
11
+ from tinybird.tb.modules.agent import run_agent
11
12
  from tinybird.tb.modules.cli import cli
12
13
  from tinybird.tb.modules.project import Project
13
- from tinybird.tb.modules.test_common import create_test, run_tests, update_test
14
+ from tinybird.tb.modules.test_common import run_tests, update_test
14
15
 
15
16
 
16
17
  @cli.group()
@@ -24,18 +25,18 @@ def test(ctx: click.Context) -> None:
24
25
  help="Create a test for an existing pipe",
25
26
  )
26
27
  @click.argument("name_or_filename", type=str)
27
- @click.option(
28
- "--prompt", type=str, default="Create a test for the selected pipe", help="Prompt to be used to create the test"
29
- )
28
+ @click.option("--prompt", type=str, default="", help="Prompt to be used to create the test")
30
29
  @click.pass_context
31
30
  def test_create(ctx: click.Context, name_or_filename: str, prompt: str) -> None:
32
31
  """
33
32
  Create a test for an existing pipe
34
33
  """
35
34
  project: Project = ctx.ensure_object(dict)["project"]
36
- client: TinyB = ctx.ensure_object(dict)["client"]
37
35
  config: dict[str, Any] = ctx.ensure_object(dict)["config"]
38
- create_test(name_or_filename, prompt, project, client, config=config)
36
+ prompt = (
37
+ f"""Create tests for the following pipe: {name_or_filename}. Extra context: {prompt or "No extra context."}"""
38
+ )
39
+ run_agent(config, project, True, prompt=prompt, feature="tb_test_create")
39
40
 
40
41
 
41
42
  @test.command(