bub 0.4.4__tar.gz → 0.5.0__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.
Files changed (114) hide show
  1. {bub-0.4.4 → bub-0.5.0}/PKG-INFO +25 -18
  2. {bub-0.4.4 → bub-0.5.0}/README.md +2 -2
  3. {bub-0.4.4 → bub-0.5.0}/pyproject.toml +27 -21
  4. {bub-0.4.4 → bub-0.5.0}/src/bub/__main__.py +10 -0
  5. {bub-0.4.4 → bub-0.5.0}/src/bub/_version.py +2 -2
  6. bub-0.5.0/src/bub/builtin/__init__.py +3 -0
  7. bub-0.5.0/src/bub/builtin/agent.py +596 -0
  8. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/auth.py +65 -29
  9. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/cli.py +3 -0
  10. bub-0.5.0/src/bub/builtin/codemode/__init__.py +310 -0
  11. bub-0.5.0/src/bub/builtin/codemode/code_runner.py +142 -0
  12. bub-0.5.0/src/bub/builtin/codemode/code_runner_child.py +176 -0
  13. bub-0.5.0/src/bub/builtin/commands.py +20 -0
  14. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/context.py +3 -11
  15. bub-0.5.0/src/bub/builtin/environment.py +145 -0
  16. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/hook_impl.py +62 -122
  17. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/model_runner.py +98 -15
  18. bub-0.5.0/src/bub/builtin/onboarding.py +278 -0
  19. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/settings.py +52 -4
  20. bub-0.5.0/src/bub/builtin/shell_manager.py +235 -0
  21. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/spill.py +50 -17
  22. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/tools.py +214 -129
  23. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/cli/__init__.py +28 -11
  24. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/cli/renderer.py +5 -5
  25. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/handler.py +1 -1
  26. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/telegram.py +7 -4
  27. bub-0.5.0/src/bub/environment.py +140 -0
  28. {bub-0.4.4 → bub-0.5.0}/src/bub/errors.py +2 -2
  29. {bub-0.4.4 → bub-0.5.0}/src/bub/framework.py +125 -20
  30. {bub-0.4.4 → bub-0.5.0}/src/bub/hooks/interception.py +7 -2
  31. {bub-0.4.4 → bub-0.5.0}/src/bub/hooks/runtime.py +5 -3
  32. {bub-0.4.4 → bub-0.5.0}/src/bub/hooks/specs.py +23 -6
  33. {bub-0.4.4 → bub-0.5.0}/src/bub/skills.py +9 -4
  34. bub-0.5.0/src/bub/streaming.py +92 -0
  35. {bub-0.4.4 → bub-0.5.0}/src/bub/tape.py +13 -6
  36. {bub-0.4.4 → bub-0.5.0}/src/bub/tools.py +167 -23
  37. bub-0.5.0/src/bub/tracing.py +256 -0
  38. {bub-0.4.4 → bub-0.5.0}/tests/test_builtin_agent.py +100 -6
  39. {bub-0.4.4 → bub-0.5.0}/tests/test_builtin_cli.py +70 -8
  40. {bub-0.4.4 → bub-0.5.0}/tests/test_builtin_codex.py +98 -8
  41. {bub-0.4.4 → bub-0.5.0}/tests/test_builtin_hook_impl.py +26 -14
  42. {bub-0.4.4 → bub-0.5.0}/tests/test_builtin_model_runner.py +144 -4
  43. {bub-0.4.4 → bub-0.5.0}/tests/test_builtin_tools.py +129 -24
  44. {bub-0.4.4 → bub-0.5.0}/tests/test_channels.py +46 -12
  45. {bub-0.4.4 → bub-0.5.0}/tests/test_cli_help.py +1 -1
  46. bub-0.5.0/tests/test_codemode.py +452 -0
  47. bub-0.5.0/tests/test_environment.py +169 -0
  48. bub-0.5.0/tests/test_errors.py +19 -0
  49. {bub-0.4.4 → bub-0.5.0}/tests/test_framework.py +42 -20
  50. {bub-0.4.4 → bub-0.5.0}/tests/test_image_message.py +2 -0
  51. {bub-0.4.4 → bub-0.5.0}/tests/test_install_scripts.py +9 -4
  52. bub-0.5.0/tests/test_onboarding.py +601 -0
  53. bub-0.5.0/tests/test_otlp.py +177 -0
  54. bub-0.5.0/tests/test_sdk_isolation.py +180 -0
  55. bub-0.5.0/tests/test_session_settings.py +47 -0
  56. {bub-0.4.4 → bub-0.5.0}/tests/test_settings.py +24 -0
  57. bub-0.5.0/tests/test_shell_manager.py +321 -0
  58. {bub-0.4.4 → bub-0.5.0}/tests/test_skills.py +1 -1
  59. {bub-0.4.4 → bub-0.5.0}/tests/test_spill.py +149 -6
  60. {bub-0.4.4 → bub-0.5.0}/tests/test_subagent_tool.py +2 -1
  61. {bub-0.4.4 → bub-0.5.0}/tests/test_tape.py +27 -1
  62. {bub-0.4.4 → bub-0.5.0}/tests/test_tape_search_output.py +3 -2
  63. {bub-0.4.4 → bub-0.5.0}/tests/test_tools.py +102 -1
  64. bub-0.5.0/tests/test_tracing.py +472 -0
  65. bub-0.4.4/src/bub/builtin/__init__.py +0 -0
  66. bub-0.4.4/src/bub/builtin/agent.py +0 -442
  67. bub-0.4.4/src/bub/builtin/shell_manager.py +0 -154
  68. bub-0.4.4/src/bub/streaming.py +0 -38
  69. {bub-0.4.4 → bub-0.5.0}/.gitignore +0 -0
  70. {bub-0.4.4 → bub-0.5.0}/LICENSE +0 -0
  71. {bub-0.4.4 → bub-0.5.0}/src/bub/__init__.py +0 -0
  72. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/codex_provider.py +0 -0
  73. {bub-0.4.4 → bub-0.5.0}/src/bub/builtin/steering.py +0 -0
  74. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/__init__.py +0 -0
  75. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/admission.py +0 -0
  76. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/base.py +0 -0
  77. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/cli/ansi_bridge.py +0 -0
  78. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/cli/terminal_output.py +0 -0
  79. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/cli/writers.py +0 -0
  80. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/contracts.py +0 -0
  81. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/manager.py +0 -0
  82. {bub-0.4.4 → bub-0.5.0}/src/bub/channels/message.py +0 -0
  83. {bub-0.4.4 → bub-0.5.0}/src/bub/configure.py +0 -0
  84. {bub-0.4.4 → bub-0.5.0}/src/bub/envelope.py +0 -0
  85. {bub-0.4.4 → bub-0.5.0}/src/bub/gateway_installer.py +0 -0
  86. {bub-0.4.4 → bub-0.5.0}/src/bub/hooks/__init__.py +0 -0
  87. {bub-0.4.4 → bub-0.5.0}/src/bub/inquirer.py +0 -0
  88. {bub-0.4.4 → bub-0.5.0}/src/bub/model_selection.py +0 -0
  89. {bub-0.4.4 → bub-0.5.0}/src/bub/sidecars.py +0 -0
  90. {bub-0.4.4 → bub-0.5.0}/src/bub/store.py +0 -0
  91. {bub-0.4.4 → bub-0.5.0}/src/bub/turn.py +0 -0
  92. {bub-0.4.4 → bub-0.5.0}/src/bub/types.py +0 -0
  93. {bub-0.4.4 → bub-0.5.0}/src/bub/utils.py +0 -0
  94. {bub-0.4.4 → bub-0.5.0}/src/skills/README.md +0 -0
  95. {bub-0.4.4 → bub-0.5.0}/src/skills/gh/SKILL.md +0 -0
  96. {bub-0.4.4 → bub-0.5.0}/src/skills/skill-creator/SKILL.md +0 -0
  97. {bub-0.4.4 → bub-0.5.0}/src/skills/skill-creator/license.txt +0 -0
  98. {bub-0.4.4 → bub-0.5.0}/src/skills/skill-creator/scripts/init_skill.py +0 -0
  99. {bub-0.4.4 → bub-0.5.0}/src/skills/skill-creator/scripts/quick_validate.py +0 -0
  100. {bub-0.4.4 → bub-0.5.0}/src/skills/telegram/SKILL.md +0 -0
  101. {bub-0.4.4 → bub-0.5.0}/src/skills/telegram/scripts/telegram_edit.py +0 -0
  102. {bub-0.4.4 → bub-0.5.0}/src/skills/telegram/scripts/telegram_rich.py +0 -0
  103. {bub-0.4.4 → bub-0.5.0}/src/skills/telegram/scripts/telegram_send.py +0 -0
  104. {bub-0.4.4 → bub-0.5.0}/tests/conftest.py +0 -0
  105. {bub-0.4.4 → bub-0.5.0}/tests/test_agent_hooks.py +0 -0
  106. {bub-0.4.4 → bub-0.5.0}/tests/test_cli_renderer.py +0 -0
  107. {bub-0.4.4 → bub-0.5.0}/tests/test_configure.py +0 -0
  108. {bub-0.4.4 → bub-0.5.0}/tests/test_envelope.py +0 -0
  109. {bub-0.4.4 → bub-0.5.0}/tests/test_file_tape_store_entry_ids.py +0 -0
  110. {bub-0.4.4 → bub-0.5.0}/tests/test_fork_store_merge_back.py +0 -0
  111. {bub-0.4.4 → bub-0.5.0}/tests/test_gateway_installer.py +0 -0
  112. {bub-0.4.4 → bub-0.5.0}/tests/test_hook_runtime.py +0 -0
  113. {bub-0.4.4 → bub-0.5.0}/tests/test_types.py +0 -0
  114. {bub-0.4.4 → bub-0.5.0}/tests/test_utils.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bub
3
- Version: 0.4.4
4
- Summary: A common shape for agents that live alongside people.
3
+ Version: 0.5.0
4
+ Summary: A tiny agent runtime, composable with plugins.
5
5
  Project-URL: Homepage, https://bub.build
6
6
  Project-URL: Repository, https://github.com/bubbuild/bub
7
7
  Project-URL: Documentation, https://bub.build
@@ -16,24 +16,31 @@ Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Programming Language :: Python :: 3.14
17
17
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
18
  Requires-Python: <4.0,>=3.12
19
- Requires-Dist: aiohttp>=3.13.3
20
- Requires-Dist: any-llm-sdk[anthropic]
19
+ Requires-Dist: aiohttp>=3.14.3
20
+ Requires-Dist: any-llm-sdk[anthropic]>=1.22.1
21
21
  Requires-Dist: authlib>=1.7.2
22
22
  Requires-Dist: httpx[socks]>=0.28.1
23
- Requires-Dist: inquirer-textual>=0.5.1
24
- Requires-Dist: loguru>=0.7.2
23
+ Requires-Dist: inquirer-textual>=0.8.0
24
+ Requires-Dist: loguru>=0.7.3
25
25
  Requires-Dist: pluggy>=1.6.0
26
- Requires-Dist: prompt-toolkit>=3.0.0
27
- Requires-Dist: pydantic-settings>=2.0.0
28
- Requires-Dist: pydantic>=2.0.0
29
- Requires-Dist: python-telegram-bot>=21.0
30
- Requires-Dist: pyyaml>=6.0.0
31
- Requires-Dist: rapidfuzz>=3.14.3
32
- Requires-Dist: rich>=13.0.0
33
- Requires-Dist: typer>=0.9.0
34
- Requires-Dist: typing-extensions>=4.13.0
26
+ Requires-Dist: prompt-toolkit>=3.0.52
27
+ Requires-Dist: pydantic-settings>=2.14.2
28
+ Requires-Dist: pydantic>=2.12.5
29
+ Requires-Dist: python-telegram-bot>=22.7
30
+ Requires-Dist: pyyaml>=6.0.3
31
+ Requires-Dist: rapidfuzz>=3.14.5
32
+ Requires-Dist: rich>=14.3.4
33
+ Requires-Dist: typer>=0.24.1
34
+ Requires-Dist: typing-extensions>=4.15.0
35
35
  Provides-Extra: logfire
36
- Requires-Dist: logfire>=4.31.0; extra == 'logfire'
36
+ Requires-Dist: logfire>=4.32.0; extra == 'logfire'
37
+ Requires-Dist: opentelemetry-api>=1.39.0; extra == 'logfire'
38
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.39.0; extra == 'logfire'
39
+ Requires-Dist: opentelemetry-sdk>=1.39.0; extra == 'logfire'
40
+ Provides-Extra: trace
41
+ Requires-Dist: opentelemetry-api>=1.39.0; extra == 'trace'
42
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.39.0; extra == 'trace'
43
+ Requires-Dist: opentelemetry-sdk>=1.39.0; extra == 'trace'
37
44
  Description-Content-Type: text/markdown
38
45
 
39
46
  # Bub
@@ -45,7 +52,7 @@ Description-Content-Type: text/markdown
45
52
  <img alt="Bub logo" src="https://raw.githubusercontent.com/bubbuild/bub/refs/heads/main/website/src/assets/bub-logo.png" width="200">
46
53
  </picture>
47
54
 
48
- <p><strong>A hook-first runtime for agents that live alongside people.</strong></p>
55
+ <p><strong>A tiny agent runtime, composable with plugins.</strong></p>
49
56
 
50
57
  </div>
51
58
 
@@ -97,7 +104,7 @@ bub gateway # channel listener mode
97
104
 
98
105
  ## Why Bub
99
106
 
100
- - **Hook-first runtime.** Every turn stage is a hook. Override one stage or replace the whole flow without forking the runtime.
107
+ - **Composable by design.** Every turn stage is a plugin hook. Override one stage or replace the whole flow without forking the runtime.
101
108
  - **Tape context.** Context is rebuilt from append-only records, not carried around as mutable session state. Easier to inspect, replay, and hand off.
102
109
  - **One runtime across surfaces.** The same inbound pipeline runs across CLI, Telegram, and custom channels. Adapters change the surface, not the runtime model.
103
110
  - **Batteries included.** CLI, Telegram, tools, skills, and model execution ship with the core runtime. Use the defaults first, replace them later.
@@ -7,7 +7,7 @@
7
7
  <img alt="Bub logo" src="https://raw.githubusercontent.com/bubbuild/bub/refs/heads/main/website/src/assets/bub-logo.png" width="200">
8
8
  </picture>
9
9
 
10
- <p><strong>A hook-first runtime for agents that live alongside people.</strong></p>
10
+ <p><strong>A tiny agent runtime, composable with plugins.</strong></p>
11
11
 
12
12
  </div>
13
13
 
@@ -59,7 +59,7 @@ bub gateway # channel listener mode
59
59
 
60
60
  ## Why Bub
61
61
 
62
- - **Hook-first runtime.** Every turn stage is a hook. Override one stage or replace the whole flow without forking the runtime.
62
+ - **Composable by design.** Every turn stage is a plugin hook. Override one stage or replace the whole flow without forking the runtime.
63
63
  - **Tape context.** Context is rebuilt from append-only records, not carried around as mutable session state. Easier to inspect, replay, and hand off.
64
64
  - **One runtime across surfaces.** The same inbound pipeline runs across CLI, Telegram, and custom channels. Adapters change the surface, not the runtime model.
65
65
  - **Batteries included.** CLI, Telegram, tools, skills, and model execution ship with the core runtime. Use the defaults first, replace them later.
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "bub"
3
3
  dynamic = ["version"]
4
- description = "A common shape for agents that live alongside people."
4
+ description = "A tiny agent runtime, composable with plugins."
5
5
  authors = [
6
6
  { name = "Chojan Shang", email = "psiace@apache.org" },
7
7
  { name = "Frost Ming", email = "me@frostming.com" },
@@ -21,22 +21,22 @@ classifiers = [
21
21
  ]
22
22
 
23
23
  dependencies = [
24
- "pydantic>=2.0.0",
25
- "pydantic-settings>=2.0.0",
26
- "pyyaml>=6.0.0",
24
+ "pydantic>=2.12.5",
25
+ "pydantic-settings>=2.14.2",
26
+ "pyyaml>=6.0.3",
27
27
  "pluggy>=1.6.0",
28
- "inquirer-textual>=0.5.1",
29
- "typer>=0.9.0",
28
+ "inquirer-textual>=0.8.0",
29
+ "typer>=0.24.1",
30
30
  "authlib>=1.7.2",
31
- "any-llm-sdk[anthropic]",
32
- "rich>=13.0.0",
33
- "prompt-toolkit>=3.0.0",
34
- "python-telegram-bot>=21.0",
35
- "loguru>=0.7.2",
36
- "rapidfuzz>=3.14.3",
37
- "aiohttp>=3.13.3",
31
+ "any-llm-sdk[anthropic]>=1.22.1",
32
+ "rich>=14.3.4",
33
+ "prompt-toolkit>=3.0.52",
34
+ "python-telegram-bot>=22.7",
35
+ "loguru>=0.7.3",
36
+ "rapidfuzz>=3.14.5",
37
+ "aiohttp>=3.14.3",
38
38
  "httpx[socks]>=0.28.1",
39
- "typing-extensions>=4.13.0",
39
+ "typing-extensions>=4.15.0",
40
40
  ]
41
41
 
42
42
  [project.urls]
@@ -48,18 +48,24 @@ Documentation = "https://bub.build"
48
48
  bub = "bub.__main__:app"
49
49
 
50
50
  [project.optional-dependencies]
51
+ trace = [
52
+ "opentelemetry-api>=1.39.0",
53
+ "opentelemetry-sdk>=1.39.0",
54
+ "opentelemetry-exporter-otlp-proto-http>=1.39.0",
55
+ ]
51
56
  logfire = [
52
- "logfire>=4.31.0",
57
+ "bub[trace]",
58
+ "logfire>=4.32.0",
53
59
  ]
54
60
 
55
61
  [dependency-groups]
56
62
  dev = [
57
- "pytest>=7.2.0",
58
- "tox-uv>=1.11.3",
59
- "types-PyYAML>=6.0.12",
60
- "mypy>=0.991",
61
- "ruff>=0.11.5",
62
- "prek>=0.3.1",
63
+ "pytest>=9.0.3",
64
+ "tox-uv>=1.35.1",
65
+ "types-PyYAML>=6.0.12.20260408",
66
+ "mypy>=1.20.0",
67
+ "ruff>=0.15.10",
68
+ "prek>=0.3.8",
63
69
  "pytest-asyncio>=1.3.0",
64
70
  ]
65
71
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import os
5
6
  import sys
6
7
 
7
8
  import typer
@@ -22,6 +23,15 @@ def _instrument_bub(level: str) -> None:
22
23
  logger.remove()
23
24
  logger.add(sys.stderr, level=level, colorize=True, diagnose=False)
24
25
 
26
+ if os.getenv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") or os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"):
27
+ from bub.tracing import configure_otlp
28
+
29
+ try:
30
+ configure_otlp()
31
+ except Exception as exc:
32
+ logger.warning("OTLP instrumentation disabled: {}", exc)
33
+ return
34
+
25
35
  try:
26
36
  import logfire
27
37
  from logfire.integrations.loguru import LogfireHandler
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.4.4'
22
- __version_tuple__ = version_tuple = (0, 4, 4)
21
+ __version__ = version = '0.5.0'
22
+ __version_tuple__ = version_tuple = (0, 5, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -0,0 +1,3 @@
1
+ from .agent import Agent
2
+
3
+ __all__ = ["Agent"]