webbee 0.7.20__tar.gz → 0.7.22__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 (203) hide show
  1. {webbee-0.7.20 → webbee-0.7.22}/CHANGELOG.md +22 -0
  2. {webbee-0.7.20 → webbee-0.7.22}/PKG-INFO +2 -2
  3. {webbee-0.7.20 → webbee-0.7.22}/pyproject.toml +2 -2
  4. webbee-0.7.22/src/webbee/__init__.py +1 -0
  5. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/expand.py +12 -0
  6. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/home_view.py +36 -7
  7. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/output_pane.py +20 -5
  8. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/render.py +13 -1
  9. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/repl.py +9 -6
  10. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/session.py +20 -0
  11. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/tui.py +81 -98
  12. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/update.py +10 -0
  13. {webbee-0.7.20 → webbee-0.7.22}/tests/test_expand.py +98 -0
  14. {webbee-0.7.20 → webbee-0.7.22}/tests/test_terminal_ux_0336.py +15 -20
  15. webbee-0.7.22/tests/test_tool_ack.py +113 -0
  16. webbee-0.7.22/tests/test_tray_1126.py +98 -0
  17. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tui.py +5 -4
  18. {webbee-0.7.20 → webbee-0.7.22}/tests/test_version_badge_corner.py +1 -1
  19. webbee-0.7.22/uv.lock +1543 -0
  20. webbee-0.7.20/src/webbee/__init__.py +0 -1
  21. {webbee-0.7.20 → webbee-0.7.22}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  22. {webbee-0.7.20 → webbee-0.7.22}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  23. {webbee-0.7.20 → webbee-0.7.22}/.github/pull_request_template.md +0 -0
  24. {webbee-0.7.20 → webbee-0.7.22}/.github/workflows/os-check.yml +0 -0
  25. {webbee-0.7.20 → webbee-0.7.22}/.github/workflows/publish.yml +0 -0
  26. {webbee-0.7.20 → webbee-0.7.22}/.gitignore +0 -0
  27. {webbee-0.7.20 → webbee-0.7.22}/LICENSE +0 -0
  28. {webbee-0.7.20 → webbee-0.7.22}/PRIVACY.md +0 -0
  29. {webbee-0.7.20 → webbee-0.7.22}/README.md +0 -0
  30. {webbee-0.7.20 → webbee-0.7.22}/SECURITY.md +0 -0
  31. {webbee-0.7.20 → webbee-0.7.22}/assets/architecture.png +0 -0
  32. {webbee-0.7.20 → webbee-0.7.22}/assets/demo.gif +0 -0
  33. {webbee-0.7.20 → webbee-0.7.22}/assets/hero.png +0 -0
  34. {webbee-0.7.20 → webbee-0.7.22}/assets/social-preview.png +0 -0
  35. {webbee-0.7.20 → webbee-0.7.22}/ci/__init__.py +0 -0
  36. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/__init__.py +0 -0
  37. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/drivers.py +0 -0
  38. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/fixture.py +0 -0
  39. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/fixture_long.py +0 -0
  40. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/fixture_wait.py +0 -0
  41. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/provision_user.py +0 -0
  42. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/registry.py +0 -0
  43. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/replay.py +0 -0
  44. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/run.py +0 -0
  45. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/scenarios_account.py +0 -0
  46. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/scenarios_code.py +0 -0
  47. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/scenarios_contract.py +0 -0
  48. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/scenarios_long.py +0 -0
  49. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/scenarios_wait.py +0 -0
  50. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/test_drivers.py +0 -0
  51. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/test_fixture.py +0 -0
  52. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/test_fixture_long.py +0 -0
  53. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/test_fixture_wait.py +0 -0
  54. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/test_registry.py +0 -0
  55. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/test_replay.py +0 -0
  56. {webbee-0.7.20 → webbee-0.7.22}/ci/field_gate/wipe.py +0 -0
  57. {webbee-0.7.20 → webbee-0.7.22}/ci/os_check.py +0 -0
  58. {webbee-0.7.20 → webbee-0.7.22}/dev-webbee +0 -0
  59. {webbee-0.7.20 → webbee-0.7.22}/install.sh +0 -0
  60. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/__main__.py +0 -0
  61. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/_launch.py +0 -0
  62. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/account.py +0 -0
  63. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/active_sessions.py +0 -0
  64. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/autoupdate.py +0 -0
  65. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/banner_art.py +0 -0
  66. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/boot.py +0 -0
  67. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/browser.py +0 -0
  68. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/checkpoints.py +0 -0
  69. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/cli.py +0 -0
  70. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/clipboard.py +0 -0
  71. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/clipboard_read.py +0 -0
  72. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/clipboard_session.py +0 -0
  73. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/coding_context.py +0 -0
  74. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/commands.py +0 -0
  75. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/config.py +0 -0
  76. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/consent.py +0 -0
  77. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/details.py +0 -0
  78. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/events.py +0 -0
  79. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/frames.py +0 -0
  80. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/home.py +0 -0
  81. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/http.py +0 -0
  82. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/instance_lock.py +0 -0
  83. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/__init__.py +0 -0
  84. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/graph.py +0 -0
  85. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/outline.py +0 -0
  86. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/query.py +0 -0
  87. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/service.py +0 -0
  88. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/store.py +0 -0
  89. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/tree.py +0 -0
  90. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/intel/watch.py +0 -0
  91. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/loop_errors.py +0 -0
  92. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/media.py +0 -0
  93. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/modals.py +0 -0
  94. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/mode_store.py +0 -0
  95. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/native_files.py +0 -0
  96. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/native_read.py +0 -0
  97. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/newtab_mode.py +0 -0
  98. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/pricing_constants.py +0 -0
  99. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/queue_panel.py +0 -0
  100. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/reflow.py +0 -0
  101. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/remote.py +0 -0
  102. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/repo.py +0 -0
  103. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/selection.py +0 -0
  104. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/sessions.py +0 -0
  105. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/sizing.py +0 -0
  106. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/slots.py +0 -0
  107. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/steer.py +0 -0
  108. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/stream.py +0 -0
  109. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/tab_store.py +0 -0
  110. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/tabs.py +0 -0
  111. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/thread.py +0 -0
  112. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/tier_store.py +0 -0
  113. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/todo_panel.py +0 -0
  114. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/tokens.py +0 -0
  115. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/tools.py +0 -0
  116. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/urlopen.py +0 -0
  117. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/wallet.py +0 -0
  118. {webbee-0.7.20 → webbee-0.7.22}/src/webbee/worktrees.py +0 -0
  119. {webbee-0.7.20 → webbee-0.7.22}/tests/__init__.py +0 -0
  120. {webbee-0.7.20 → webbee-0.7.22}/tests/conftest.py +0 -0
  121. {webbee-0.7.20 → webbee-0.7.22}/tests/test_account.py +0 -0
  122. {webbee-0.7.20 → webbee-0.7.22}/tests/test_active_sessions.py +0 -0
  123. {webbee-0.7.20 → webbee-0.7.22}/tests/test_append_file.py +0 -0
  124. {webbee-0.7.20 → webbee-0.7.22}/tests/test_audit_2026_07_25_findings.py +0 -0
  125. {webbee-0.7.20 → webbee-0.7.22}/tests/test_autoupdate.py +0 -0
  126. {webbee-0.7.20 → webbee-0.7.22}/tests/test_checkpoints.py +0 -0
  127. {webbee-0.7.20 → webbee-0.7.22}/tests/test_checkpoints_nested_1030.py +0 -0
  128. {webbee-0.7.20 → webbee-0.7.22}/tests/test_cli.py +0 -0
  129. {webbee-0.7.20 → webbee-0.7.22}/tests/test_clipboard.py +0 -0
  130. {webbee-0.7.20 → webbee-0.7.22}/tests/test_clipboard_read.py +0 -0
  131. {webbee-0.7.20 → webbee-0.7.22}/tests/test_code_map_fresh.py +0 -0
  132. {webbee-0.7.20 → webbee-0.7.22}/tests/test_coding_context.py +0 -0
  133. {webbee-0.7.20 → webbee-0.7.22}/tests/test_commands.py +0 -0
  134. {webbee-0.7.20 → webbee-0.7.22}/tests/test_config.py +0 -0
  135. {webbee-0.7.20 → webbee-0.7.22}/tests/test_cpc_contract_stable.py +0 -0
  136. {webbee-0.7.20 → webbee-0.7.22}/tests/test_cpc_outline.py +0 -0
  137. {webbee-0.7.20 → webbee-0.7.22}/tests/test_cross_loop_token.py +0 -0
  138. {webbee-0.7.20 → webbee-0.7.22}/tests/test_details.py +0 -0
  139. {webbee-0.7.20 → webbee-0.7.22}/tests/test_events.py +0 -0
  140. {webbee-0.7.20 → webbee-0.7.22}/tests/test_field_test_1113.py +0 -0
  141. {webbee-0.7.20 → webbee-0.7.22}/tests/test_freeze_fix.py +0 -0
  142. {webbee-0.7.20 → webbee-0.7.22}/tests/test_home.py +0 -0
  143. {webbee-0.7.20 → webbee-0.7.22}/tests/test_home_view.py +0 -0
  144. {webbee-0.7.20 → webbee-0.7.22}/tests/test_home_view_mouse.py +0 -0
  145. {webbee-0.7.20 → webbee-0.7.22}/tests/test_inspect_page.py +0 -0
  146. {webbee-0.7.20 → webbee-0.7.22}/tests/test_instance_lock.py +0 -0
  147. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_any_folder.py +0 -0
  148. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_cache_and_sync_worker.py +0 -0
  149. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_checksum_tree.py +0 -0
  150. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_chunker.py +0 -0
  151. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_embed.py +0 -0
  152. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_folder_1106.py +0 -0
  153. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_graph.py +0 -0
  154. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_no_numpy.py +0 -0
  155. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_query.py +0 -0
  156. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_service.py +0 -0
  157. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_store.py +0 -0
  158. {webbee-0.7.20 → webbee-0.7.22}/tests/test_intel_watch.py +0 -0
  159. {webbee-0.7.20 → webbee-0.7.22}/tests/test_launch.py +0 -0
  160. {webbee-0.7.20 → webbee-0.7.22}/tests/test_loop_errors.py +0 -0
  161. {webbee-0.7.20 → webbee-0.7.22}/tests/test_marathon.py +0 -0
  162. {webbee-0.7.20 → webbee-0.7.22}/tests/test_modals_e2e.py +0 -0
  163. {webbee-0.7.20 → webbee-0.7.22}/tests/test_mode_and_remote_0_6_8.py +0 -0
  164. {webbee-0.7.20 → webbee-0.7.22}/tests/test_mode_store.py +0 -0
  165. {webbee-0.7.20 → webbee-0.7.22}/tests/test_native_files.py +0 -0
  166. {webbee-0.7.20 → webbee-0.7.22}/tests/test_newtab_mode.py +0 -0
  167. {webbee-0.7.20 → webbee-0.7.22}/tests/test_packaging.py +0 -0
  168. {webbee-0.7.20 → webbee-0.7.22}/tests/test_probe_cost.py +0 -0
  169. {webbee-0.7.20 → webbee-0.7.22}/tests/test_queue_manage_0337.py +0 -0
  170. {webbee-0.7.20 → webbee-0.7.22}/tests/test_reflow.py +0 -0
  171. {webbee-0.7.20 → webbee-0.7.22}/tests/test_remote_code_reads.py +0 -0
  172. {webbee-0.7.20 → webbee-0.7.22}/tests/test_render.py +0 -0
  173. {webbee-0.7.20 → webbee-0.7.22}/tests/test_repl.py +0 -0
  174. {webbee-0.7.20 → webbee-0.7.22}/tests/test_repo.py +0 -0
  175. {webbee-0.7.20 → webbee-0.7.22}/tests/test_resilient_http.py +0 -0
  176. {webbee-0.7.20 → webbee-0.7.22}/tests/test_review_fixes_1030.py +0 -0
  177. {webbee-0.7.20 → webbee-0.7.22}/tests/test_session.py +0 -0
  178. {webbee-0.7.20 → webbee-0.7.22}/tests/test_session_review_1030.py +0 -0
  179. {webbee-0.7.20 → webbee-0.7.22}/tests/test_sessions.py +0 -0
  180. {webbee-0.7.20 → webbee-0.7.22}/tests/test_sizing.py +0 -0
  181. {webbee-0.7.20 → webbee-0.7.22}/tests/test_slots.py +0 -0
  182. {webbee-0.7.20 → webbee-0.7.22}/tests/test_ssh_guard.py +0 -0
  183. {webbee-0.7.20 → webbee-0.7.22}/tests/test_steer.py +0 -0
  184. {webbee-0.7.20 → webbee-0.7.22}/tests/test_stream.py +0 -0
  185. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tab_bar_stability.py +0 -0
  186. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tab_restore_0337.py +0 -0
  187. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tabs.py +0 -0
  188. {webbee-0.7.20 → webbee-0.7.22}/tests/test_thread.py +0 -0
  189. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tier_invalidation.py +0 -0
  190. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tier_store.py +0 -0
  191. {webbee-0.7.20 → webbee-0.7.22}/tests/test_todo_panel.py +0 -0
  192. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tokens.py +0 -0
  193. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tools.py +0 -0
  194. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tools_eol_cancel_1030.py +0 -0
  195. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tools_vision_websearch.py +0 -0
  196. {webbee-0.7.20 → webbee-0.7.22}/tests/test_tui_hardening.py +0 -0
  197. {webbee-0.7.20 → webbee-0.7.22}/tests/test_update.py +0 -0
  198. {webbee-0.7.20 → webbee-0.7.22}/tests/test_update_badge_0340.py +0 -0
  199. {webbee-0.7.20 → webbee-0.7.22}/tests/test_urlopen.py +0 -0
  200. {webbee-0.7.20 → webbee-0.7.22}/tests/test_version.py +0 -0
  201. {webbee-0.7.20 → webbee-0.7.22}/tests/test_voice_outcome.py +0 -0
  202. {webbee-0.7.20 → webbee-0.7.22}/tests/test_wallet.py +0 -0
  203. {webbee-0.7.20 → webbee-0.7.22}/tests/test_worktrees.py +0 -0
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.22
4
+
5
+ * Signing out by itself is closed in the shell (imperal-mcp 0.9.22, raised here): one token refresh at a time on a
6
+ machine - the terminal, the MCP server, the watch and the hooks share one credentials file and no longer race
7
+ each other into a revoked session; a token the gateway refused is asked for once, then you are told to sign in.
8
+ * The terminal says it took a command before it runs it. A request the kernel asks an acknowledgement for is
9
+ answered at once; a request of another turn is neither run nor acknowledged. This becomes visible with the kernel
10
+ release that asks: a command the terminal never took is then said in seconds instead of holding the session.
11
+
12
+ ## 0.7.21
13
+
14
+ * The row under the input keeps one order whether a turn runs or not: who works (mode and model, both clickable),
15
+ what happens now, what it cost, one hint. A count has its unit (`5 actions`), a long turn shows minutes, the spend
16
+ is seen while she works. A narrow terminal drops whole parts in order and the row never runs past its width.
17
+ * One hint at a time, a new one every few seconds - never a list of them.
18
+ * The version badge is built from facts, not from a sentence (it said `v0.7.18 → 0.7.18 available`), and plays
19
+ short phrases in turn: `v0.7.21` / `up to date`, `0.7.22 is out` / `click to upgrade`, `0.7.22 installed` /
20
+ `restart to use it`. A new release is noticed within the hour, not the next day.
21
+ * Opening or closing an action never moves the page: the clicked line stays on its screen row.
22
+ * The notes line of a step (`learned` / `expect` / `need`) is cut to the width and opens whole on a click.
23
+ * Steps stand one empty line apart.
24
+
3
25
  ## 0.7.20
4
26
 
5
27
  * A click on an action's line opens the whole of it in place - the full command or arguments and all of the result,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: webbee
3
- Version: 0.7.20
3
+ Version: 0.7.22
4
4
  Summary: Webbee 🐝 — the Imperal Cloud coding agent in your terminal
5
5
  Project-URL: Homepage, https://imperal.io/webbee-code
6
6
  Project-URL: Documentation, https://docs.imperal.io
@@ -31,7 +31,7 @@ Requires-Python: >=3.7
31
31
  Requires-Dist: asyncssh>=2.14; python_version >= '3.10'
32
32
  Requires-Dist: httpx-sse>=0.4; python_version >= '3.10'
33
33
  Requires-Dist: httpx>=0.27; python_version >= '3.10'
34
- Requires-Dist: imperal-mcp>=0.9.21; python_version >= '3.10'
34
+ Requires-Dist: imperal-mcp>=0.9.22; python_version >= '3.10'
35
35
  Requires-Dist: imperal-sdk[universal-index]>=6.7.1; python_version >= '3.10'
36
36
  Requires-Dist: prompt-toolkit>=3; python_version >= '3.10'
37
37
  Requires-Dist: rich>=13.7; python_version >= '3.10'
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "webbee"
3
- version = "0.7.20"
3
+ version = "0.7.22"
4
4
  description = "Webbee 🐝 — the Imperal Cloud coding agent in your terminal"
5
5
  readme = "README.md"
6
6
  license = "GPL-3.0-or-later"
@@ -13,7 +13,7 @@ dependencies = [
13
13
  # release on a Python 3.12 it sets up once with uv -- `uv` comes as a wheel on 3.8+,
14
14
  # 3.7 fetches it with uv's own installer.
15
15
  'uv>=0.4; python_version >= "3.8" and python_version < "3.10"',
16
- 'imperal-mcp>=0.9.21; python_version >= "3.10"', # raised to the newest at each release
16
+ 'imperal-mcp>=0.9.22; python_version >= "3.10"', # raised to the newest at each release
17
17
  'imperal-sdk[universal-index]>=6.7.1; python_version >= "3.10"',
18
18
  'asyncssh>=2.14; python_version >= "3.10"',
19
19
  'httpx>=0.27; python_version >= "3.10"',
@@ -0,0 +1 @@
1
+ __version__ = "0.7.22"
@@ -114,6 +114,18 @@ def step_body(tool: str, args, result, clean):
114
114
  "click the action to close", parts, 3)
115
115
 
116
116
 
117
+ def protocol_body(lines: dict):
118
+ """A step's protocol (learned / expect / need) opened whole: each label on its own line, its value beside it
119
+ and wrapped under its own start. The values come cleaned by the caller."""
120
+ body = Text()
121
+ for i, (key, value) in enumerate(lines.items()):
122
+ if i:
123
+ body.append("\n")
124
+ body.append(f"{key}: ", style="dim")
125
+ body.append(str(value))
126
+ return _block("▾ notes · ⧉ click here to copy · click above to close", [body], 9)
127
+
128
+
117
129
  def step_text(args, result, clean) -> str:
118
130
  """The same action as plain text, for the clipboard: the command (or the arguments), an empty line, the
119
131
  result -- nothing drawn, nothing indented."""
@@ -189,7 +189,8 @@ def _cycle(options, current: str, delta: int) -> str:
189
189
  return options[(i + delta) % len(options)]
190
190
 
191
191
 
192
- def version_badge(version: str, update_notice: str = "", checked: bool = True) -> "tuple[str, str]":
192
+ def version_badge(version: str, update_notice: str = "", checked: bool = True, *,
193
+ latest: str = "", installed: str = "") -> "tuple[str, str]":
193
194
  """(text, style_class) for Home's bottom-right version badge (0.3.36).
194
195
 
195
196
  THREE honest states, never a fake reassurance:
@@ -206,18 +207,46 @@ def version_badge(version: str, update_notice: str = "", checked: bool = True) -
206
207
  v = (version or "").strip()
207
208
  vtxt = f"v{v}" if v else "v?"
208
209
  notice = (update_notice or "").strip()
210
+ # The other version comes as a FACT (`installed`: on disk, this session still runs the old one; `latest`: a
211
+ # newer release exists), never out of the notice's words -- the badge once took the last "vN" word of the
212
+ # restart sentence, which names the RUNNING version last: "v0.7.18 → 0.7.18 available" (live 2026-11-26).
213
+ installed, latest = (installed or "").strip().lstrip("v"), (latest or "").strip().lstrip("v")
214
+ if installed and installed != v:
215
+ return (f"{vtxt} → {installed} · restart", "class:home.update")
216
+ if latest and latest != v:
217
+ return (f"{vtxt} → {latest} available", "class:home.update")
209
218
  if notice:
210
- latest = ""
211
- for tok in notice.replace("—", " ").split():
212
- if tok.startswith("v") and tok[1:2].isdigit():
213
- latest = tok[1:]
214
- return ((f"{vtxt} → {latest} available" if latest else f"{vtxt} · update available"),
215
- "class:home.update")
219
+ return (f"{vtxt} · update available", "class:home.update") # a notice with no number: none is guessed
216
220
  if checked:
217
221
  return (f"{vtxt} · up to date", "class:home.fresh")
218
222
  return (vtxt, "class:home.dim")
219
223
 
220
224
 
225
+ def badge_beats(version: str, update_notice: str = "", checked: "bool | None" = True, *,
226
+ latest: str = "", installed: str = "") -> "tuple[str, ...]":
227
+ """PURE. What the toolbar's version badge says, as SHORT phrases shown one after another -- never one long
228
+ line (the owner 2026-11-26: "play the phrases in turn, so it is clear, good-looking, effective"). The first is
229
+ always the running version; the rest say what is known about it, from the same facts ``version_badge`` reads:
230
+
231
+ * a newer one is on disk, the session still runs the old -> ("v0.7.20", "0.7.21 installed", "restart to use it")
232
+ * a newer release exists -> ("v0.7.20", "0.7.21 is out", "click to upgrade")
233
+ * checked, nothing newer -> ("v0.7.20", "up to date")
234
+ * not checked / could not check -> ("v0.7.20",) -- no claim either way
235
+ """
236
+ v = (version or "").strip()
237
+ vtxt = f"v{v}" if v else "v?"
238
+ installed, latest = (installed or "").strip().lstrip("v"), (latest or "").strip().lstrip("v")
239
+ if installed and installed != v:
240
+ return (vtxt, f"{installed} installed", "restart to use it")
241
+ if latest and latest != v:
242
+ return (vtxt, f"{latest} is out", "click to upgrade")
243
+ if (update_notice or "").strip():
244
+ return (vtxt, "update available", "click to upgrade")
245
+ if checked is True:
246
+ return (vtxt, "up to date")
247
+ return (vtxt,)
248
+
249
+
221
250
  def two_column(width: int, threshold: int = 100) -> bool:
222
251
  """Wide terminal -> You + Wallet render side-by-side; narrow -> stacked."""
223
252
  return width >= threshold
@@ -217,13 +217,28 @@ class OutputPane:
217
217
  return
218
218
  self._replay(new_width)
219
219
 
220
- def rerender(self) -> None:
221
- """Draw the retained records again at the same width, the view kept where it is: a record changed what it
222
- shows (it opened, closed, or the detail it asked for arrived)."""
223
- follow, self._follow = self._follow, False # anchor on the top record, not the tail
220
+ def rerender(self, at_line: "int | None" = None) -> None:
221
+ """Draw the retained records again at the same width WITHOUT moving the page: a record changed what it
222
+ shows (it opened, closed, or the detail it asked for arrived). One line is held where it is on the screen
223
+ -- the clicked one (``at_line``), else the top visible one: the same record, the same line inside it, the
224
+ same screen row. Before, the view was put on the START of the top visible record, so a click while a long
225
+ answer stood half scrolled at the top threw the reader to that answer's beginning (live 2026-11-26)."""
226
+ base = self._ring_base_lines
227
+ held = self._offset if at_line is None else at_line
228
+ held = max(base, min(held, max(base, len(self._all_lines()) - 1)))
229
+ screen_row = held - self._offset # where that line stands on the screen now
230
+ rec = self._record_at_line(held)
231
+ inside = (held - base) - sum(self._record_lines[:rec])
232
+ follow, self._follow = self._follow, False
224
233
  self._replay(self.console.width)
234
+ spans = self._record_lines
235
+ if 0 <= rec < len(spans):
236
+ inside = max(0, min(inside, spans[rec] - 1)) # the record may have grown or shrunk around the line
237
+ max_off = max(0, len(self._all_lines()) - max(1, self._view_h))
238
+ self._offset = max(0, min(base + sum(spans[:rec]) + inside - screen_row, max_off))
225
239
  at_tail = self._offset >= max(0, len(self._all_lines()) - max(1, self._view_h))
226
240
  self._follow = follow and at_tail
241
+ self._invalidate()
227
242
 
228
243
  def toggle_at(self, line: int):
229
244
  """A click on absolute content line `line`: the record under it opens or closes in place when it is one
@@ -250,7 +265,7 @@ class OutputPane:
250
265
  toggle = getattr(obj, "toggle", None)
251
266
  if callable(toggle):
252
267
  toggle()
253
- self.rerender()
268
+ self.rerender(line)
254
269
  return obj
255
270
  return False
256
271
 
@@ -319,6 +319,7 @@ class RichSink:
319
319
  # every turn, exactly like self.steps itself does in session.py.
320
320
  self._step_index = 0
321
321
  self._step_records = {}
322
+ self._step_gap = False # the gap just below is the first step's own: none is added above its thought
322
323
  self.console.print() # breathing room between the user's message and the response
323
324
  self._nudge()
324
325
 
@@ -989,13 +990,24 @@ class RichSink:
989
990
  except Exception:
990
991
  tier = "webbeesmart"
991
992
  t_now = time.strftime("%H:%M:%S")
993
+ # a step stands apart from the one before it: one empty line above its thought (the owner 2026-11-26:
994
+ # the steps ran into each other). Not after the turn's own opening gap -- never two in a row.
995
+ if getattr(self, "_step_gap", False):
996
+ self.console.print()
997
+ self._step_gap = True
992
998
  if say:
993
999
  self.console.print(_pad(Text.assemble(
994
1000
  (f"{t_now} ", "dim grey50"), ("💭 ", "dim"), (_clean(say), _tier_thinking_style(tier)))))
995
1001
  if proto:
1002
+ # the step's protocol is one small line cut to the width -- and a click opens it whole, each label
1003
+ # on its own line (before, what did not fit was simply gone past the right edge)
1004
+ from webbee.expand import Expandable, protocol_body
1005
+ shown = {_clean(str(k)): _clean(str(v)) for k, v in (lines or {}).items() if str(v or "").strip()}
996
1006
  small = Text.assemble((" " if say else f"{t_now} ", "dim grey50"), (proto, "dim grey50"))
997
1007
  small.no_wrap, small.overflow = True, "ellipsis"
998
- self.console.print(_pad(small))
1008
+ self.console.print(Expandable(
1009
+ _pad(small), lambda: _pad(protocol_body(shown)),
1010
+ lambda: "\n".join(f"{k}: {v}" for k, v in shown.items())))
999
1011
  self._nudge()
1000
1012
  return
1001
1013
  if text:
@@ -696,9 +696,11 @@ async def _installed_watch(update_state: dict, *, invalidate=None, every: float
696
696
  while True:
697
697
  try:
698
698
  await sleep(every)
699
- notice = restart_notice(__version__, await asyncio.to_thread(read))
699
+ on_disk = await asyncio.to_thread(read)
700
+ notice = restart_notice(__version__, on_disk)
700
701
  if notice and update_state.get("notice") != notice:
701
702
  update_state["notice"] = notice
703
+ update_state["installed"] = str(on_disk or "") # the fact the badge is built from
702
704
  if invalidate is not None:
703
705
  invalidate()
704
706
  except asyncio.CancelledError:
@@ -725,14 +727,15 @@ async def _check_update_bg(update_state: dict, *, invalidate=None,
725
727
  from pathlib import Path
726
728
 
727
729
  from webbee import __version__
728
- from webbee.update import check_update_status, default_fetch
730
+ from webbee.update import default_fetch, update_facts
729
731
  try:
730
732
  cache = cache_path or Path(os.path.expanduser("~/.cache/webbee/update.json"))
731
- notice, checked = await asyncio.to_thread(
732
- check_update_status, __version__, cache_path=cache, now=time.time(),
733
+ facts = await asyncio.to_thread(
734
+ update_facts, __version__, cache_path=cache, now=time.time(),
733
735
  fetch=fetch or default_fetch)
734
- update_state["notice"] = notice
735
- update_state["checked"] = checked
736
+ update_state["notice"] = facts["notice"]
737
+ update_state["checked"] = facts["checked"]
738
+ update_state["latest"] = facts["latest"]
736
739
  if invalidate is not None:
737
740
  invalidate()
738
741
  except Exception:
@@ -648,6 +648,9 @@ class AgentSession:
648
648
  rid = frame.get("req_id")
649
649
  sid = str(rid or "")
650
650
  tool = str(frame.get("tool", "") or "")
651
+ if frame.get("ack") and rid not in seen:
652
+ # the kernel asks whether this terminal TOOK the request: said before anything is run
653
+ await self._post_ack(client, session_id, rid)
651
654
  stored = None if rid in seen else await asyncio.to_thread(store.get, rid, tool)
652
655
  if rid in seen:
653
656
  seen.move_to_end(rid)
@@ -890,6 +893,23 @@ class AgentSession:
890
893
  return ""
891
894
 
892
895
  _result_delays = (0.5, 2.0, 5.0) # class attr — tests override per instance
896
+ _ack_timeout = 5.0 # the word is small; a slow post must not hold the tool back
897
+
898
+ async def _post_ack(self, client, session_id: str, req_id) -> bool:
899
+ """Tell the kernel this terminal TOOK a request, before the tool runs (2026-11-26: a request the
900
+ terminal never answered held its session 18 minutes -- between "sent" and "began" there was no fact).
901
+ It goes by the door a result takes, as ``{"state": "ack"}`` -- no outcome in it, so it is never read as
902
+ the result. One try and a short bound: the result itself follows by ``_post_result`` with its retries,
903
+ and a kernel that heard no word sends the request again (the seen-dict dedups). Never raises."""
904
+ try:
905
+ headers = await self._headers()
906
+ r = await asyncio.wait_for(
907
+ client.post(f"/v1/agent/sessions/{session_id}/result",
908
+ json={"req_id": req_id, "result": {"state": "ack"}}, headers=headers),
909
+ timeout=self._ack_timeout)
910
+ return 200 <= int(getattr(r, "status_code", 0) or 0) < 300
911
+ except Exception:
912
+ return False
893
913
 
894
914
  async def _post_result(self, client, session_id: str, out: dict, *, sink=None, tool: str = "") -> bool:
895
915
  """POST one result under its req_id; True once a 2xx took it. Never
@@ -328,6 +328,25 @@ def previous_tier(tier: str) -> str:
328
328
  return _TIERS[-1]
329
329
 
330
330
 
331
+ # What a person can do here, one line each: shown one at a time under the input, in turn.
332
+ TOOLBAR_TIPS = (
333
+ "Alt+↵ starts a new line",
334
+ "Shift+Tab switches the mode",
335
+ "Ctrl+B switches the model",
336
+ "Ctrl+T opens a new tab",
337
+ "click an action to open it whole",
338
+ "click 🐝 Webbee to copy the whole answer",
339
+ "drag over text to copy it",
340
+ "Esc stops a running turn",
341
+ )
342
+
343
+
344
+ def toolbar_tip(now: "float | None" = None, every: float = 8.0) -> str:
345
+ """PURE (given ``now``). The one hint the toolbar shows at this moment."""
346
+ import time as _t
347
+ return TOOLBAR_TIPS[int((_t.monotonic() if now is None else now) // every) % len(TOOLBAR_TIPS)]
348
+
349
+
331
350
  def build_toolbar(mode: str, tokens: int, credits: int, *, busy: bool = False,
332
351
  current: str = "", elapsed: float = 0.0, tools: int = 0,
333
352
  consent: bool = False, queued: int = 0,
@@ -353,91 +372,55 @@ def build_toolbar(mode: str, tokens: int, credits: int, *, busy: bool = False,
353
372
  frags += q
354
373
  frags.append(("class:tb.dim", " · Esc/Ctrl-C to stop"))
355
374
  return frags
375
+ # ONE order of zones in every state (the owner 2026-11-26: the tray must be tidy and thought through): who
376
+ # works (mode · model, both clickable), what happens now, what it cost, one hint. Groups stand apart by
377
+ # " · ", the parts of one group by " · " -- a thing keeps its place whether a turn runs or not.
378
+ who = [("class:tb.dim", "mode: "), (f"class:tb.mode.{mode}", mode), ("class:tb.dim", " · model: ")]
379
+ who += _tier_shimmer_fragments(tier or _TIERS[0],
380
+ _TIER_DISPLAY.get(tier, "") or _TIER_DISPLAY[_TIERS[0]],
381
+ now=tier_now)
356
382
  if busy:
357
383
  spin = _SPINNER[int(elapsed * 10) % len(_SPINNER)] # animates via the ticker
358
- frags = [("class:tb.spin", f" {spin} "), ("class:tb.working", "working")]
359
- if current:
360
- frags += [("class:tb.dim", " · "), ("class:tb.action", current)]
361
- # webbee-code-model-tier-toolbar-v1: keep the tier visible mid-turn too
362
- # (a short "· SuperSmart" tag, NOT the full "model: " label used at
363
- # idle -- busy is already the densest row, this is the cheapest
364
- # legible form). webbee-code-tier-colors-v1: each tier gets its own
365
- # colour + its human display name (Smart/SuperSmart/UltraSmart),
366
- # never the raw wire value.
367
- # webbee-code-model-selector-always-visible-v1 (Valentin, live
368
- # 2026-07-31: "я в КАЖДОЙ вкладке явно хочу видеть какая модель, а
369
- # не system default"): an unset tier now shows the REAL name of the
370
- # tier that actually runs when none is chosen -- "webbeesmart" IS the
371
- # documented default, fast everyday tier (imperal-ext-admin's own
372
- # Model Tiers panel, `_TIERS[0]`), so showing its display name
373
- # "Smart" here is a grounded fact about what's running, not a
374
- # guess -- never a MADE-UP tier the server didn't confirm.
375
- frags += [("class:tb.dim", " · ")]
376
- frags += _tier_shimmer_fragments(tier or _TIERS[0],
377
- _TIER_DISPLAY.get(tier, "") or _TIER_DISPLAY[_TIERS[0]],
378
- now=tier_now)
379
- frags.append(("class:tb.dim",
380
- f" · {elapsed:.0f}s · {tools} · {_fmt_tokens(tokens)} tok"))
381
- frags += q
382
- frags.append(("class:tb.dim", " · Esc/Ctrl-C to stop"))
384
+ took = f"{int(elapsed) // 60}:{int(elapsed) % 60:02d}" if elapsed >= 60 else f"{elapsed:.0f}s"
385
+ head = [("class:tb.spin", f" {spin} "), *who, ("class:tb.dim", " · ")]
386
+ doing = current or "working"
387
+ n = f"{tools} action{'' if tools == 1 else 's'}"
388
+ # A narrow terminal loses the least needed first: the hint, then the action's text is cut to its start
389
+ # (with a mark that it was), then the spend goes, then the count -- each thing whole. Nothing is sliced by
390
+ # the terminal's edge, and the version badge keeps its reserved columns.
391
+ tails = [f" · {took} · {n} · {_fmt_tokens(tokens)} tok · {_fmt_tokens(credits)} credits",
392
+ f" · {took} · {n}", f" · {took}"]
393
+ hint = " · Esc to stop"
394
+ used = sum(len(t) for _, t in head) + sum(len(t) for _, t in q)
395
+ options = [(tails[0], hint)] + [(t, "") for t in tails]
396
+ tail, tip = options[-1]
397
+ least = min(len(doing), 24) # what of the action's text is kept before figures go
398
+ for i, (t, h) in enumerate(options):
399
+ if not width or used + (len(doing) if i == 0 else least) + len(t) + len(h) <= width:
400
+ tail, tip = t, h
401
+ break
402
+ room = (width - used - len(tail)) if width else len(doing)
403
+ if width and len(doing) > room:
404
+ doing = (doing[:max(1, room - 1)] + "…") if room > 1 else doing[:max(0, room)]
405
+ frags = head + [("class:tb.action", doing), ("class:tb.dim", tail)] + q
406
+ if tip:
407
+ frags.append(("class:tb.dim", tip))
383
408
  return frags
384
- frags = [("class:tb.dim", " mode: "),
385
- (f"class:tb.mode.{mode}", mode)]
386
- # webbee-code-model-tier-toolbar-v1: the tier was only ever visible via
387
- # `/model` (no arg) or right after a Ctrl+B cycle flash -- ask once, then
388
- # forget, exactly the visibility gap the mode segment right next to it
389
- # never had.
390
- # webbee-code-model-selector-always-visible-v1 (Valentin, live
391
- # 2026-07-31: "я в КАЖДОЙ вкладке явно хочу видеть какая модель, а не
392
- # system default"): every tab must show a model indicator, chosen or
393
- # not -- "" (unset) shows the REAL name of the default tier that's
394
- # actually active ("Smart" / webbeesmart, imperal-ext-admin's own
395
- # documented default), never a vague placeholder phrase. Ctrl+B /
396
- # `/model` still change it from here exactly like before.
397
- frags += [("class:tb.dim", " · model: ")]
398
- frags += _tier_shimmer_fragments(tier or _TIERS[0],
399
- _TIER_DISPLAY.get(tier, "") or _TIER_DISPLAY[_TIERS[0]],
400
- now=tier_now)
401
- frags += [("class:tb.dim", f" · {_fmt_tokens(tokens)} tok · {_fmt_tokens(credits)} credits this session"),
402
- *q]
403
- # 0.3.37: the PERSISTENT live-session indicator (active_sessions.
404
- # session_indicator). Empty string = nothing running = say nothing, so an
405
- # ordinary idle dock gains no permanent noise; when a Temporal workflow IS
406
- # running the terminal now says so continuously instead of once in a boot
407
- # note that scrolls away.
409
+ # the spend says less before it says nothing: a narrow terminal keeps the figures and drops the words
410
+ spends = [f" · {_fmt_tokens(tokens)} tok · {_fmt_tokens(credits)} credits this session",
411
+ f" · {_fmt_tokens(tokens)} tok · {_fmt_tokens(credits)} credits",
412
+ f" · {_fmt_tokens(tokens)} tok"]
413
+ lead = 2 + sum(len(t) for _, t in who) + sum(len(t) for _, t in q)
414
+ spend = next((s_ for s_ in spends if not width or lead + len(s_) <= width), spends[-1])
415
+ frags = [("class:tb.dim", " "), *who, ("class:tb.dim", spend), *q]
416
+ # 0.3.37: the PERSISTENT live-session indicator (active_sessions.session_indicator); "" = nothing running.
408
417
  if live:
409
418
  frags.append(("class:tb.live", f" · {live}"))
410
- # 0.3.36: the hints are DISCOVERABILITY, the spend figures are DATA -- so
411
- # the hints are what gets dropped when the terminal is too narrow to hold
412
- # everything, never the numbers (an 80-column window used to cut the line
413
- # mid-word). `width=0` (unknown/headless) keeps the full line, which is
414
- # also what every pre-0.3.36 caller and test sees.
415
- used = sum(len(t) for _, t in frags)
416
- # Calm 8-second rotation. Each variant starts differently so it remains
417
- # visibly alive even where a narrow terminal clips the tail of the hint.
418
- import time as _t_tips
419
- _tip_cycle = int(_t_tips.monotonic() // 8) % 4
420
- # Rotation may change the *extra* discovery cue, never the baseline
421
- # editing/navigation contract. In particular, narrow terminals must
422
- # always retain Alt+Enter's newline reminder before optional hints.
423
- base = " · Tip: Alt+↵ newline · Shift + TAB: switch mode"
424
- if _tip_cycle == 0:
425
- full = base + " · Ctrl+B: model tier"
426
- elif _tip_cycle == 1:
427
- full = base + " · Ctrl+T: new tab"
428
- elif _tip_cycle == 2:
429
- full = base + " · ←/→: mode"
430
- else:
431
- full = base + " · Esc: stop"
432
- mid = base
433
- short = " · Tip: Alt+↵ newline"
434
-
435
- if not width or used + len(full) <= width:
436
- frags.append(("class:tb.dim", full))
437
- elif used + len(mid) <= width:
438
- frags.append(("class:tb.dim", mid))
439
- elif used + len(short) <= width:
440
- frags.append(("class:tb.dim", short))
419
+ # ONE hint at a time, a new one every 8 seconds, and only when the row has room for it whole: the hints are
420
+ # discoverability, the figures are data (0.3.36). Never a list of hints in a row.
421
+ tip = " · Tip: " + toolbar_tip()
422
+ if not width or sum(len(t) for _, t in frags) + len(tip) <= width:
423
+ frags.append(("class:tb.dim", tip))
441
424
  return frags
442
425
 
443
426
 
@@ -451,7 +434,8 @@ def version_badge_text(version: str) -> str:
451
434
 
452
435
  def pin_version_right(frags: list, version: str, width: int, *,
453
436
  notice: str = "", checked: "bool | None" = None,
454
- style_override: str = "", text_override: str = "") -> list:
437
+ style_override: str = "", text_override: str = "",
438
+ latest: str = "", installed: str = "") -> list:
455
439
  """PURE. Pin the version badge flush to the RIGHT EDGE of the toolbar row.
456
440
 
457
441
  The toolbar is the LAST child of run_session's root HSplit, so its right
@@ -499,7 +483,7 @@ def pin_version_right(frags: list, version: str, width: int, *,
499
483
  text, style = version_badge_text(version).strip(), "tb.version"
500
484
  else:
501
485
  from webbee.home_view import version_badge
502
- raw, cls = version_badge(version, notice, checked=checked)
486
+ raw, cls = version_badge(version, notice, checked=checked, latest=latest, installed=installed)
503
487
  text, style = raw, ("tb.fresh" if cls == "class:home.fresh" else
504
488
  "tb.update" if cls == "class:home.update" else "tb.version")
505
489
  # webbee-code-badge-cycle-v1: caller may override the TEXT ITSELF too
@@ -1632,12 +1616,17 @@ async def run_session(*, slots, on_line, on_cycle, on_tier_cycle=None,
1632
1616
  `pin_version_right` falls back to its own text) for every other
1633
1617
  state -- offline/unchecked/update-available keep their normal,
1634
1618
  single, non-cycling text."""
1635
- us = update_state or {}
1636
- if us.get("checked") is not True or (us.get("notice") or "").strip():
1637
- return ""
1619
+ # 2026-11-26: every state of the badge plays its short phrases in turn (home_view.badge_beats), not only
1620
+ # the fresh one -- "v0.7.20 → 0.7.21 available" was one long line that a narrow terminal dropped whole.
1638
1621
  import time as _t
1639
- phase = int(_t.monotonic() // 5) % 2
1640
- return f"v{__version__}" if phase == 0 else "up to date"
1622
+ beats = _badge_beats()
1623
+ return beats[int(_t.monotonic() // 4) % len(beats)] if len(beats) > 1 else ""
1624
+
1625
+ def _badge_beats() -> tuple:
1626
+ from webbee.home_view import badge_beats
1627
+ us = update_state or {}
1628
+ return badge_beats(__version__, us.get("notice", ""), us.get("checked"),
1629
+ latest=us.get("latest", ""), installed=us.get("installed", ""))
1641
1630
 
1642
1631
  def _current_badge_text() -> str:
1643
1632
  """The exact text `pin_version_right` will draw right now, so the
@@ -1652,16 +1641,9 @@ async def run_session(*, slots, on_line, on_cycle, on_tier_cycle=None,
1652
1641
  of the two variants ALWAYS, regardless of which phase is live --
1653
1642
  the shorter phase just leaves a little slack before the badge,
1654
1643
  never a truncation."""
1655
- us = update_state or {}
1656
- checked = us.get("checked")
1657
- if checked is None:
1658
- return version_badge_text(__version__)
1659
- if checked is True and not (us.get("notice") or "").strip():
1660
- widest = max(f"v{__version__}", "up to date", key=len)
1661
- return f" {widest} "
1662
- from webbee.home_view import version_badge
1663
- text, _cls = version_badge(__version__, us.get("notice", ""), checked=checked)
1664
- return f" {text} "
1644
+ # the WIDEST of the phrases the badge plays, always: the hint beside it never grows or shrinks when the
1645
+ # phrase changes
1646
+ return f" {max(_badge_beats(), key=len)} "
1665
1647
 
1666
1648
  def _toolbar_fit_width() -> int:
1667
1649
  """Columns available to the toolbar's own text: the true terminal width
@@ -1790,7 +1772,8 @@ async def run_session(*, slots, on_line, on_cycle, on_tier_cycle=None,
1790
1772
  notice=us.get("notice", ""),
1791
1773
  checked=us.get("checked"),
1792
1774
  style_override=_badge_style_override(),
1793
- text_override=_badge_cycle_text())
1775
+ text_override=_badge_cycle_text(),
1776
+ latest=us.get("latest", ""), installed=us.get("installed", ""))
1794
1777
  fwd = _forwarding(None, pane)
1795
1778
  badge_appended = len(frags) > pre_len # pin_version_right may drop it (no room)
1796
1779
 
@@ -100,6 +100,16 @@ def check_update_status(current: str, *, cache_path, now: float, fetch,
100
100
  return (_notice_for(current, latest), bool(latest))
101
101
 
102
102
 
103
+ def update_facts(current: str, *, cache_path, now: float, fetch, ttl: float = 3600.0) -> dict:
104
+ """What the freshness check found, as FACTS: ``{"notice", "checked", "latest"}``. The toolbar's badge is built
105
+ from ``latest`` -- a number, never a version read back out of the notice's words (live 2026-11-26: the badge
106
+ took the last "vN" word of a sentence and showed "v0.7.18 → 0.7.18 available"). Asked again after an hour, not
107
+ a day: a release made this morning was "up to date" in the toolbar until tomorrow. Never raises."""
108
+ latest = _resolve_latest(current, cache_path=cache_path, now=now, fetch=fetch, ttl=ttl)
109
+ newer = bool(_ver(latest or "") and _ver(current) and _ver(latest) > _ver(current))
110
+ return {"notice": _notice_for(current, latest), "checked": bool(latest), "latest": str(latest) if newer else ""}
111
+
112
+
103
113
  def check_for_update(current: str, *, cache_path, now: float, fetch, ttl: float = 86400.0) -> "str | None":
104
114
  """Return a one-line upgrade notice if a newer webbee is on PyPI, else None.
105
115
  Caches the latest-seen version for `ttl` seconds. Never raises.