tinybird 0.0.1.dev266__tar.gz → 0.0.1.dev267__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 (146) hide show
  1. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/agent.py +24 -23
  4. tinybird-0.0.1.dev267/tinybird/tb/modules/agent/banner.py +87 -0
  5. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/cli.py +2 -4
  6. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/deployment_common.py +4 -1
  7. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird.egg-info/PKG-INFO +1 -1
  8. tinybird-0.0.1.dev266/tinybird/tb/modules/agent/banner.py +0 -104
  9. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/setup.cfg +0 -0
  10. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/__cli__.py +0 -0
  11. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/ch_utils/constants.py +0 -0
  12. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/ch_utils/engine.py +0 -0
  13. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/check_pypi.py +0 -0
  14. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/client.py +0 -0
  15. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/config.py +0 -0
  16. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/connectors.py +0 -0
  17. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/context.py +0 -0
  18. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/datafile/common.py +0 -0
  19. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/datafile/exceptions.py +0 -0
  20. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/datafile/parse_connection.py +0 -0
  21. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/datafile/parse_datasource.py +0 -0
  22. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/datafile/parse_pipe.py +0 -0
  23. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/datatypes.py +0 -0
  24. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/feedback_manager.py +0 -0
  25. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/git_settings.py +0 -0
  26. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/prompts.py +0 -0
  27. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/sql.py +0 -0
  28. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/sql_template.py +0 -0
  29. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/sql_template_fmt.py +0 -0
  30. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/sql_toolset.py +0 -0
  31. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/syncasync.py +0 -0
  32. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/check_pypi.py +0 -0
  33. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/cli.py +0 -0
  34. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/client.py +0 -0
  35. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/config.py +0 -0
  36. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/__init__.py +0 -0
  37. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/animations.py +0 -0
  38. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/command_agent.py +0 -0
  39. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/memory.py +0 -0
  40. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/models.py +0 -0
  41. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/prompts.py +0 -0
  42. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/testing_agent.py +0 -0
  43. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  44. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
  45. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/append.py +0 -0
  46. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/build.py +0 -0
  47. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/create_datafile.py +0 -0
  48. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  49. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
  50. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
  51. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
  52. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/explore.py +0 -0
  53. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
  54. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  55. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/mock.py +0 -0
  56. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  57. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/preview_datafile.py +0 -0
  58. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
  59. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/run_command.py +0 -0
  60. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/tools/test.py +0 -0
  61. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/agent/utils.py +0 -0
  62. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/build.py +0 -0
  63. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/build_common.py +0 -0
  64. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/cicd.py +0 -0
  65. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/common.py +0 -0
  66. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/config.py +0 -0
  67. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/connection.py +0 -0
  68. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/copy.py +0 -0
  69. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/create.py +0 -0
  70. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/build.py +0 -0
  71. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/build_common.py +0 -0
  72. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  73. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  74. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/diff.py +0 -0
  75. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/fixture.py +0 -0
  76. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/format_common.py +0 -0
  77. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  78. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  79. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  80. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/playground.py +0 -0
  81. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datafile/pull.py +0 -0
  82. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/datasource.py +0 -0
  83. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/deployment.py +0 -0
  84. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/deprecations.py +0 -0
  85. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/dev_server.py +0 -0
  86. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/endpoint.py +0 -0
  87. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/exceptions.py +0 -0
  88. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/feedback_manager.py +0 -0
  89. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/info.py +0 -0
  90. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/infra.py +0 -0
  91. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/job.py +0 -0
  92. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/llm.py +0 -0
  93. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/llm_utils.py +0 -0
  94. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/local.py +0 -0
  95. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/local_common.py +0 -0
  96. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/login.py +0 -0
  97. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/login_common.py +0 -0
  98. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/logout.py +0 -0
  99. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/materialization.py +0 -0
  100. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/mock.py +0 -0
  101. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/mock_common.py +0 -0
  102. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/open.py +0 -0
  103. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/pipe.py +0 -0
  104. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/project.py +0 -0
  105. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/regions.py +0 -0
  106. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/secret.py +0 -0
  107. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/secret_common.py +0 -0
  108. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/shell.py +0 -0
  109. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/sink.py +0 -0
  110. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/table.py +0 -0
  111. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/telemetry.py +0 -0
  112. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/test.py +0 -0
  113. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/test_common.py +0 -0
  114. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  115. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  116. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/token.py +0 -0
  117. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/watch.py +0 -0
  118. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/workspace.py +0 -0
  119. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb/modules/workspace_members.py +0 -0
  120. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli.py +0 -0
  121. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/auth.py +0 -0
  122. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/branch.py +0 -0
  123. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/cicd.py +0 -0
  124. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/cli.py +0 -0
  125. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/common.py +0 -0
  126. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/config.py +0 -0
  127. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/connection.py +0 -0
  128. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/datasource.py +0 -0
  129. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/exceptions.py +0 -0
  130. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/fmt.py +0 -0
  131. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/job.py +0 -0
  132. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/pipe.py +0 -0
  133. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/regions.py +0 -0
  134. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/tag.py +0 -0
  135. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/telemetry.py +0 -0
  136. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/test.py +0 -0
  137. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  138. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  139. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/workspace.py +0 -0
  140. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  141. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird/tornado_template.py +0 -0
  142. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird.egg-info/SOURCES.txt +0 -0
  143. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird.egg-info/dependency_links.txt +0 -0
  144. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird.egg-info/entry_points.txt +0 -0
  145. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/tinybird.egg-info/requires.txt +0 -0
  146. {tinybird-0.0.1.dev266 → tinybird-0.0.1.dev267}/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.dev267
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.dev266'
8
- __revision__ = 'b4193e9'
7
+ __version__ = '0.0.1.dev267'
8
+ __revision__ = '8c3d4f6'
@@ -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
 
@@ -255,7 +254,7 @@ class TinybirdAgent:
255
254
  save_messages(new_messages)
256
255
  self.thinking_animation.stop()
257
256
  click.echo(result.output)
258
- self._echo_usage(config, result)
257
+ self.echo_usage(config)
259
258
 
260
259
  async def run_iter(self, user_prompt: str, config: dict[str, Any], model: Any) -> None:
261
260
  user_prompt = f"{user_prompt}\n\n{load_custom_project_rules(self.project.folder)}"
@@ -279,31 +278,28 @@ class TinybirdAgent:
279
278
  self.messages.extend(new_messages)
280
279
  save_messages(new_messages)
281
280
  self.thinking_animation.stop()
282
- self._echo_usage(config, agent_run.result)
281
+ self.echo_usage(config)
283
282
 
284
- def _echo_usage(self, config: dict[str, Any], result: AgentRunResult) -> None:
283
+ def echo_usage(self, config: dict[str, Any]) -> None:
285
284
  try:
286
285
  client = _get_tb_client(config["user_token"], config["host"])
287
286
  workspace_id = config.get("id", "")
288
287
  workspace = client.workspace(workspace_id, with_organization=True, version="v1")
289
288
  limits_data = client.organization_limits(workspace["organization"]["id"])
290
289
  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)
290
+ current_ai_requests = ai_requests_limits.get("quantity") or 0
291
+ max_ai_requests = ai_requests_limits.get("max") or 0
292
+ remaining_requests = max(max_ai_requests - current_ai_requests, 0)
293
+ current_ai_requests = min(max_ai_requests, current_ai_requests)
293
294
  if not max_ai_requests:
294
295
  return
295
- remaining_requests = max(max_ai_requests - current_ai_requests, 0)
296
296
  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
-
297
+ message_color = (
298
+ FeedbackManager.warning if current_ai_requests >= warning_threshold else FeedbackManager.gray
299
+ )
304
300
  click.echo(
305
301
  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."
302
+ message=f"{remaining_requests} requests left ({current_ai_requests}/{max_ai_requests}). You can continue using Tinybird Code. Limits will be enforced soon."
307
303
  )
308
304
  )
309
305
  except Exception:
@@ -339,7 +335,7 @@ def run_agent(
339
335
  workspace_id = cli_config.get("id", "")
340
336
  workspace_name = cli_config.get("name", "")
341
337
 
342
- if not token or not host or not user_token:
338
+ if not token or not host or not user_token or not workspace_id:
343
339
  click.echo(
344
340
  FeedbackManager.error(message="Tinybird Code requires authentication. Run 'tb login' first.")
345
341
  )
@@ -383,8 +379,17 @@ def run_agent(
383
379
 
384
380
  # Interactive mode: show banner and enter interactive loop
385
381
  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"))
382
+ click.echo(
383
+ FeedbackManager.info(
384
+ message="""Tips for getting started:
385
+ - Describe what you want to build or ask for specific resources.
386
+ - Run tb commands directly without leaving interactive mode.
387
+ - Create a TINYBIRD.md file to customize your interactions.
388
+ """
389
+ )
390
+ )
391
+ agent.echo_usage(config)
392
+ click.echo()
388
393
 
389
394
  except Exception as e:
390
395
  click.echo(FeedbackManager.error(message=f"Failed to initialize agent: {e}"))
@@ -431,11 +436,7 @@ def run_agent(
431
436
 
432
437
  continue
433
438
  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
-
439
+ subprocess.run(["tb", "--help"], check=True)
439
440
  continue
440
441
  elif user_input.strip() == "":
441
442
  continue
@@ -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()
@@ -47,8 +47,6 @@ DEFAULT_PATTERNS: List[Tuple[str, Union[str, Callable[[str], str]]]] = [
47
47
  ]
48
48
  VERSION = f"{__cli__.__version__} (rev {__cli__.__revision__})"
49
49
 
50
- agent_mode_flag = os.environ.get("TB_AGENT_MODE", "false") == "true"
51
-
52
50
 
53
51
  @click.group(
54
52
  cls=CatchAuthExceptions,
@@ -56,7 +54,7 @@ agent_mode_flag = os.environ.get("TB_AGENT_MODE", "false") == "true"
56
54
  "help_option_names": ["-h", "--help"],
57
55
  "max_content_width": shutil.get_terminal_size().columns - 10,
58
56
  },
59
- invoke_without_command=agent_mode_flag,
57
+ invoke_without_command=True,
60
58
  )
61
59
  @click.option(
62
60
  "--debug/--no-debug",
@@ -208,7 +206,7 @@ def cli(
208
206
  ctx.ensure_object(dict)["env"] = get_target_env(cloud)
209
207
  ctx.ensure_object(dict)["output"] = output
210
208
 
211
- is_agent_mode = agent_mode_flag and ctx.invoked_subcommand is None
209
+ is_agent_mode = ctx.invoked_subcommand is None
212
210
  is_prompt_mode = prompt is not None
213
211
 
214
212
  if is_agent_mode or is_prompt_mode:
@@ -254,9 +254,12 @@ def create_deployment(
254
254
  elif verbose and f.get("level", "").upper() == "INFO":
255
255
  feedback_func = FeedbackManager.info
256
256
  feedback_icon = ""
257
+ else:
258
+ feedback_func = None
257
259
  resource = f.get("resource")
258
260
  resource_bit = f"{resource}: " if resource else ""
259
- click.echo(feedback_func(message=f"{feedback_icon}{f.get('level')}: {resource_bit}{f.get('message')}"))
261
+ if feedback_func is not None:
262
+ click.echo(feedback_func(message=f"{feedback_icon}{f.get('level')}: {resource_bit}{f.get('message')}"))
260
263
 
261
264
  deploy_errors = deployment.get("errors")
262
265
  for deploy_error in deploy_errors:
@@ -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.dev267
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -1,104 +0,0 @@
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
- # Choose banner based on Unicode support
45
- if capabilities["unicode"]:
46
- # Unicode box-drawing characters banner
47
- banner = [
48
- " ████████╗██╗███╗ ██╗██╗ ██╗██████╗ ██╗██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗",
49
- " ╚══██╔══╝██║████╗ ██║╚██╗ ██╔╝██╔══██╗██║██╔══██╗██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝",
50
- " ██║ ██║██╔██╗ ██║ ╚████╔╝ ██████╔╝██║██████╔╝██║ ██║ ██║ ██║ ██║██║ ██║█████╗ ",
51
- " ██║ ██║██║╚██╗██║ ╚██╔╝ ██╔══██╗██║██╔══██╗██║ ██║ ██║ ██║ ██║██║ ██║██╔══╝ ",
52
- " ██║ ██║██║ ╚████║ ██║ ██████╔╝██║██║ ██║██████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗",
53
- " ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝",
54
- ]
55
- else:
56
- # ASCII fallback banner
57
- banner = [
58
- " ████████T██I███N ██N██ ██Y██████B ██I██████B ██████B ██████C ██████O ██████D ███████E",
59
- " ╚══██╔══╝██║████╗ ██║╚██╗ ██╔╝██╔══██╗██║██╔══██╗██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝",
60
- " ██║ ██║██╔██╗ ██║ ╚████╔╝ ██████╔╝██║██████╔╝██║ ██║ ██║ ██║ ██║██║ ██║█████╗ ",
61
- " ██║ ██║██║╚██╗██║ ╚██╔╝ ██╔══██╗██║██╔══██╗██║ ██║ ██║ ██║ ██║██║ ██║██╔══╝ ",
62
- " ██║ ██║██║ ╚████║ ██║ ██████╔╝██║██║ ██║██████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗",
63
- " ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝",
64
- ]
65
-
66
- def interpolate_color(start_rgb, end_rgb, factor):
67
- """Interpolate between two RGB colors"""
68
- return [int(start_rgb[i] + (end_rgb[i] - start_rgb[i]) * factor) for i in range(3)]
69
-
70
- def rgb_to_ansi(r: int, g: int, b: int, use_truecolor: bool):
71
- """Convert RGB values to ANSI escape code"""
72
- if use_truecolor:
73
- return f"\033[38;2;{r};{g};{b}m"
74
- else:
75
- # Convert to 8-bit color (256 color palette)
76
- # Simple approximation: map RGB to 216-color cube + grayscale
77
- if r == g == b:
78
- # Grayscale
79
- gray = int(r / 255 * 23) + 232
80
- return f"\033[38;5;{gray}m"
81
- else:
82
- # Color cube (6x6x6)
83
- r_idx = int(r / 255 * 5)
84
- g_idx = int(g / 255 * 5)
85
- b_idx = int(b / 255 * 5)
86
- color_idx = 16 + (36 * r_idx) + (6 * g_idx) + b_idx
87
- return f"\033[38;5;{color_idx}m"
88
-
89
- # Define solid color (corresponding to #27f795)
90
- solid_color = [39, 247, 149] # #27f795 in RGB
91
-
92
- # Print each line with solid color for all terminals
93
- for line in banner:
94
- colored_line = ""
95
- color_code = rgb_to_ansi(*solid_color, use_truecolor=capabilities["truecolor"]) # type: ignore
96
-
97
- for char in line:
98
- if char == " ":
99
- colored_line += char
100
- else:
101
- colored_line += f"{color_code}{char}"
102
-
103
- click.echo(colored_line + reset)
104
- click.echo()