webbee 0.7.24__tar.gz → 0.7.26__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.
- {webbee-0.7.24 → webbee-0.7.26}/CHANGELOG.md +14 -0
- {webbee-0.7.24 → webbee-0.7.26}/PKG-INFO +1 -1
- {webbee-0.7.24 → webbee-0.7.26}/pyproject.toml +1 -1
- webbee-0.7.26/src/webbee/__init__.py +1 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/query.py +63 -2
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/media.py +23 -1
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/tools.py +6 -3
- webbee-0.7.26/tests/test_read_never_waits_for_the_repo.py +70 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_result_fits_the_door.py +19 -0
- {webbee-0.7.24 → webbee-0.7.26}/uv.lock +1 -1
- webbee-0.7.24/src/webbee/__init__.py +0 -1
- {webbee-0.7.24 → webbee-0.7.26}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/.github/pull_request_template.md +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/.github/workflows/os-check.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/.github/workflows/publish.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/.gitignore +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/LICENSE +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/PRIVACY.md +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/README.md +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/SECURITY.md +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/assets/architecture.png +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/assets/demo.gif +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/assets/hero.png +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/assets/social-preview.png +0 -0
- {webbee-0.7.24/tests → webbee-0.7.26/ci}/__init__.py +0 -0
- {webbee-0.7.24/src/webbee/intel → webbee-0.7.26/ci/field_gate}/__init__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/drivers.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/fixture.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/fixture_long.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/fixture_wait.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/provision_user.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/registry.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/replay.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/run.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/scenarios_account.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/scenarios_code.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/scenarios_contract.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/scenarios_long.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/scenarios_wait.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/test_drivers.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/test_fixture.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/test_fixture_long.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/test_fixture_wait.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/test_registry.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/test_replay.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/field_gate/wipe.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/ci/os_check.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/dev-webbee +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/install.sh +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/__main__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/_launch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/account.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/active_sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/autoupdate.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/banner_art.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/boot.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/browser.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/checkpoints.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/cli.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/clipboard.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/clipboard_read.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/clipboard_session.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/coding_context.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/commands.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/config.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/consent.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/details.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/events.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/expand.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/frames.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/home.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/home_view.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/http.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/instance_lock.py +0 -0
- {webbee-0.7.24/ci/field_gate → webbee-0.7.26/src/webbee/intel}/__init__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/graph.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/outline.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/service.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/tree.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/intel/watch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/loop_errors.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/modals.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/mode_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/native_files.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/native_read.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/newtab_mode.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/output_pane.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/pricing_constants.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/queue_panel.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/reflow.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/remote.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/render.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/repl.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/repo.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/selection.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/session.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/sizing.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/slots.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/stallwatch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/steer.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/stream.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/tab_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/tabs.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/thread.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/tier_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/todo_panel.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/tokens.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/tui.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/update.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/urlopen.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/wallet.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/src/webbee/worktrees.py +0 -0
- {webbee-0.7.24/ci → webbee-0.7.26/tests}/__init__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/conftest.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_account.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_active_sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_append_file.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_audit_2026_07_25_findings.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_autoupdate.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_checkpoints.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_checkpoints_nested_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_cli.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_clipboard.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_clipboard_read.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_code_map_fresh.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_coding_context.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_commands.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_config.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_cpc_contract_stable.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_cpc_outline.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_cross_loop_token.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_details.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_events.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_expand.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_field_test_1113.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_freeze_fix.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_home.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_home_view.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_home_view_mouse.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_inspect_page.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_instance_lock.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_any_folder.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_cache_and_sync_worker.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_checksum_tree.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_chunker.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_embed.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_folder_1106.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_graph.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_no_numpy.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_query.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_service.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_intel_watch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_launch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_loop_errors.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_marathon.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_modals_e2e.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_mode_and_remote_0_6_8.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_mode_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_native_files.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_newtab_mode.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_packaging.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_probe_cost.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_queue_manage_0337.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_reflow.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_remote_code_reads.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_render.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_repl.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_repo.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_resilient_http.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_review_fixes_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_session.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_session_review_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_sizing.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_slots.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_ssh_guard.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_stallwatch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_steer.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_stream.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tab_bar_stability.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tab_restore_0337.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tabs.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_terminal_ux_0336.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_thread.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tier_invalidation.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tier_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_todo_panel.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tokens.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tool_ack.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tools.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tools_eol_cancel_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tools_vision_websearch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tray_1126.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tui.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_tui_hardening.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_update.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_update_badge_0340.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_urlopen.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_version.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_version_badge_corner.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_voice_outcome.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_wallet.py +0 -0
- {webbee-0.7.24 → webbee-0.7.26}/tests/test_worktrees.py +0 -0
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.26
|
|
4
|
+
|
|
5
|
+
* A read never waits for the whole repository. The header of a read file ("used by ...") asked for the table of
|
|
6
|
+
every resolved use of every file, built on the reading thread and built again after each change of the index: in
|
|
7
|
+
a big workspace (a home folder) `read_file` stood for minutes, and the terminal - which runs one request at a
|
|
8
|
+
time - answered nothing else. The table is now built on its own thread, one build at a time; a read takes what
|
|
9
|
+
is ready. `graph_slice` and `impact_of_change` wait for it up to 40 s and then say that it is still being built.
|
|
10
|
+
|
|
11
|
+
## 0.7.25
|
|
12
|
+
|
|
13
|
+
* An image file is decoded through one guarded door: raster formats only (PNG, JPEG, GIF, WEBP, BMP) - never EPS,
|
|
14
|
+
PS or PDF, which the image library hands to an interpreter - and never a canvas over 40 million pixels. Both
|
|
15
|
+
places that read an image (showing it to the model, drawing it in the terminal) go through it.
|
|
16
|
+
|
|
3
17
|
## 0.7.24
|
|
4
18
|
|
|
5
19
|
* A result fits the door that takes it. The gateway takes a body of 1 MB while a result was cut at 4 MB, so a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.26"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import re
|
|
3
|
+
import threading
|
|
3
4
|
|
|
4
5
|
from imperal_sdk.code_index import path_matches
|
|
5
6
|
|
|
@@ -31,7 +32,9 @@ def graph_slice(svc, symbols, depth: int = 1) -> dict:
|
|
|
31
32
|
return {"ok": False, "content": "index not ready"}
|
|
32
33
|
if isinstance(symbols, str):
|
|
33
34
|
symbols = [symbols]
|
|
34
|
-
lk =
|
|
35
|
+
lk = linked(svc)
|
|
36
|
+
if lk is None:
|
|
37
|
+
return {"ok": False, "content": LINKS_NOT_BUILT}
|
|
35
38
|
links = lk.links()
|
|
36
39
|
items = []
|
|
37
40
|
for name in (symbols or []):
|
|
@@ -228,6 +231,61 @@ def linker(svc):
|
|
|
228
231
|
return lk
|
|
229
232
|
|
|
230
233
|
|
|
234
|
+
# A READ never waits for the whole repository (live 2026-11-27, the stall file of a terminal whose workspace was a
|
|
235
|
+
# home folder: `read_file` stood 300 s in Linker.links() -- the header of one file asked for every resolved use of
|
|
236
|
+
# every file, built on the reading thread, and built again after each change of the index. Five sessions in a day
|
|
237
|
+
# went deaf on it). The table belongs to the graph: it is built off the reader's path, one build at a time, and a
|
|
238
|
+
# reader takes what is ready -- or waits this long for a small repository's table and goes on without it.
|
|
239
|
+
LINKS_WAIT_S = 2.0
|
|
240
|
+
# a tool that ASKS for the links (graph_slice, impact_of_change) waits longer, and then says what it waits for --
|
|
241
|
+
# the terminal runs one request at a time, so no tool holds it for as long as a big folder's table takes
|
|
242
|
+
LINKS_TOOL_WAIT_S = 40.0
|
|
243
|
+
LINKS_NOT_BUILT = ("the links of this folder are still being resolved (a big folder takes minutes the first time "
|
|
244
|
+
"and after its files change) -- nothing was looked up. Ask again in a while, or read the code "
|
|
245
|
+
"directly (search_code, grep_code, read_symbol do not need the links).")
|
|
246
|
+
_links_lock = threading.Lock()
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def links_ready(svc, wait: float = LINKS_WAIT_S):
|
|
250
|
+
"""The link table of the index's CURRENT graph, or None while it is not built (its build is then running on its
|
|
251
|
+
own thread). Never longer than ``wait`` on the caller's path."""
|
|
252
|
+
g = getattr(svc, "graph", None)
|
|
253
|
+
if g is None:
|
|
254
|
+
return None
|
|
255
|
+
with _links_lock:
|
|
256
|
+
if getattr(svc, "_links_graph", None) is g:
|
|
257
|
+
return svc._links_table
|
|
258
|
+
done = getattr(svc, "_links_build", None)
|
|
259
|
+
if done is None or getattr(svc, "_links_build_graph", None) is not g:
|
|
260
|
+
done = threading.Event()
|
|
261
|
+
svc._links_build, svc._links_build_graph = done, g
|
|
262
|
+
|
|
263
|
+
def build(g=g, done=done) -> None:
|
|
264
|
+
try:
|
|
265
|
+
lk = linker(svc)
|
|
266
|
+
table = lk.links()
|
|
267
|
+
with _links_lock:
|
|
268
|
+
if getattr(svc, "graph", None) is g:
|
|
269
|
+
svc._links_table, svc._links_graph, svc._links_linker = table, g, lk
|
|
270
|
+
except Exception:
|
|
271
|
+
pass
|
|
272
|
+
finally:
|
|
273
|
+
done.set()
|
|
274
|
+
threading.Thread(target=build, name="webbee-links", daemon=True).start()
|
|
275
|
+
done.wait(max(0.0, wait))
|
|
276
|
+
with _links_lock:
|
|
277
|
+
return svc._links_table if getattr(svc, "_links_graph", None) is g else None
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def linked(svc, wait: float = LINKS_TOOL_WAIT_S):
|
|
281
|
+
"""The resolver whose link table is built for the current graph, or None while it is not (see links_ready)."""
|
|
282
|
+
g = getattr(svc, "graph", None)
|
|
283
|
+
if links_ready(svc, wait) is None:
|
|
284
|
+
return None
|
|
285
|
+
with _links_lock:
|
|
286
|
+
return svc._links_linker if getattr(svc, "_links_graph", None) is g else None
|
|
287
|
+
|
|
288
|
+
|
|
231
289
|
def impact_of_change(svc, symbols) -> dict:
|
|
232
290
|
"""Files that use ``symbols`` (resolved links: line, user, depth through the enclosing definition), code before
|
|
233
291
|
tests; ``by_name`` -- files that only share a name (a method on a local, a language without scope facts), marked
|
|
@@ -239,7 +297,10 @@ def impact_of_change(svc, symbols) -> dict:
|
|
|
239
297
|
from imperal_sdk.code_index import has_scope_facts
|
|
240
298
|
from imperal_sdk.code_links import BY_NAME_SHOWN, impact, is_test_path
|
|
241
299
|
syms = [str(s) for s in (symbols or []) if str(s).strip()]
|
|
242
|
-
|
|
300
|
+
lk = linked(svc)
|
|
301
|
+
if lk is None:
|
|
302
|
+
return {"ok": False, "content": LINKS_NOT_BUILT}
|
|
303
|
+
out = impact(lk, syms, depth=2)
|
|
243
304
|
# languages without scope facts: their uses are known by name only -- listed with the other by-name files
|
|
244
305
|
names = {s.split("::")[-1].split(":")[-1].rsplit(".", 1)[-1] for s in syms}
|
|
245
306
|
known = {b["path"] for b in out["by_name"]} | {i["id"] for i in out["data"]["items"]}
|
|
@@ -17,6 +17,28 @@ import threading
|
|
|
17
17
|
from typing import Optional, Tuple
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
# The one door an image file is decoded through (security review 2026-11-27): a file of the workspace is not
|
|
21
|
+
# trusted. Only raster formats are read -- never EPS/PS/PDF, which Pillow hands to Ghostscript, an interpreter --
|
|
22
|
+
# and never a picture whose pixels would not fit in memory (a small file can declare a huge canvas).
|
|
23
|
+
IMAGE_FORMATS = ("PNG", "JPEG", "GIF", "WEBP", "BMP")
|
|
24
|
+
IMAGE_MAX_PIXELS = 40 * 1000 * 1000
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def open_image(source):
|
|
28
|
+
"""A Pillow image of ``source`` (a path or a binary file object), its header read and its pixels not yet.
|
|
29
|
+
Raises ValueError for a format outside ``IMAGE_FORMATS`` or a canvas over ``IMAGE_MAX_PIXELS``."""
|
|
30
|
+
from PIL import Image
|
|
31
|
+
try:
|
|
32
|
+
im = Image.open(source, formats=list(IMAGE_FORMATS))
|
|
33
|
+
except Exception as e:
|
|
34
|
+
raise ValueError("not an image this terminal reads (%s): %s" % (", ".join(IMAGE_FORMATS), type(e).__name__))
|
|
35
|
+
w, h = im.size
|
|
36
|
+
if w * h > IMAGE_MAX_PIXELS:
|
|
37
|
+
im.close()
|
|
38
|
+
raise ValueError("an image of %dx%d is over %d million pixels" % (w, h, IMAGE_MAX_PIXELS // 1000000))
|
|
39
|
+
return im
|
|
40
|
+
|
|
41
|
+
|
|
20
42
|
def play_audio_file(file_path: str, *, block: bool = False) -> Optional[subprocess.Popen]:
|
|
21
43
|
"""Play an audio file (.wav, .mp3, .m4a, .ogg) across macOS, Linux, and Windows.
|
|
22
44
|
|
|
@@ -104,7 +126,7 @@ def render_image_in_terminal(image_path: str, max_cols: int = 60, max_rows: int
|
|
|
104
126
|
# 3. ANSI TrueColor Half-Block Fallback (Works in ANY 24-bit terminal on macOS, Linux, Windows)
|
|
105
127
|
try:
|
|
106
128
|
from PIL import Image
|
|
107
|
-
img =
|
|
129
|
+
img = open_image(image_path).convert("RGB")
|
|
108
130
|
# Scale to max_cols x (max_rows * 2) because each character cell has 2 vertical subpixels (▀)
|
|
109
131
|
w, h = img.size
|
|
110
132
|
aspect = w / max(1, h)
|
|
@@ -691,8 +691,10 @@ class LocalToolExecutor:
|
|
|
691
691
|
if graph is not None and fi.symbols:
|
|
692
692
|
# the files whose references RESOLVE to this file (the vault's rules) -- never a file that only
|
|
693
693
|
# shares a name with one of its definitions (report 06.11 #2: "used by check-paths-agree.py, +50")
|
|
694
|
-
|
|
695
|
-
|
|
694
|
+
# the table is the graph's, built off this path: a read takes what is ready and never waits for
|
|
695
|
+
# the whole repository (query.links_ready)
|
|
696
|
+
from webbee.intel.query import links_ready
|
|
697
|
+
deps = sorted({src for src, _u, _k, _l, dst, _q, _o in links_ready(self.indexer) or ()
|
|
696
698
|
if dst == rel and src != rel})
|
|
697
699
|
if deps:
|
|
698
700
|
extra = f" +{len(deps) - 3} more" if len(deps) > 3 else ""
|
|
@@ -1442,7 +1444,8 @@ def shrink_image(raw: bytes, limit: int = IMAGE_MAX_BYTES):
|
|
|
1442
1444
|
try:
|
|
1443
1445
|
import io
|
|
1444
1446
|
from PIL import Image
|
|
1445
|
-
|
|
1447
|
+
from webbee.media import open_image
|
|
1448
|
+
im = open_image(io.BytesIO(raw)) # raster formats only, a bounded canvas
|
|
1446
1449
|
im.load()
|
|
1447
1450
|
if im.mode not in ("RGB", "L"):
|
|
1448
1451
|
flat = Image.new("RGB", im.size, (255, 255, 255))
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""A read never waits for the whole repository (2026-11-27).
|
|
2
|
+
|
|
3
|
+
Live: the stall file of a terminal whose workspace was a home folder -- `read_file` stood 300 s in
|
|
4
|
+
``Linker.links()``, the table of every resolved use of every file, built on the reading thread for one file's
|
|
5
|
+
header. The terminal runs one request at a time, so it answered nothing else. The table is built off the reader's
|
|
6
|
+
path; a reader takes what is ready."""
|
|
7
|
+
import pathlib
|
|
8
|
+
import threading
|
|
9
|
+
import time
|
|
10
|
+
from types import SimpleNamespace
|
|
11
|
+
|
|
12
|
+
from webbee.intel import query as Q
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _svc(monkeypatch, build_s, table):
|
|
16
|
+
built = []
|
|
17
|
+
|
|
18
|
+
def links():
|
|
19
|
+
time.sleep(build_s)
|
|
20
|
+
built.append(1)
|
|
21
|
+
return table
|
|
22
|
+
svc = SimpleNamespace(graph=object())
|
|
23
|
+
monkeypatch.setattr(Q, "linker", lambda s: SimpleNamespace(links=links))
|
|
24
|
+
return svc, built
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_a_table_that_takes_long_does_not_hold_the_reader(monkeypatch):
|
|
28
|
+
svc, built = _svc(monkeypatch, 0.6, [("b.py", "", "call", 1, "a.py", "f", "import")])
|
|
29
|
+
t = time.monotonic()
|
|
30
|
+
assert Q.links_ready(svc, wait=0.05) is None
|
|
31
|
+
assert Q.links_ready(svc, wait=0.05) is None # the same build, not a second one
|
|
32
|
+
assert time.monotonic() - t < 0.4
|
|
33
|
+
assert len(Q.links_ready(svc, wait=3.0)) == 1 and built == [1]
|
|
34
|
+
assert Q.links_ready(svc, wait=0.0) is not None and built == [1] # ready: taken at once, built once
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_a_changed_graph_is_a_new_table_and_an_old_build_never_passes_for_it(monkeypatch):
|
|
38
|
+
svc, built = _svc(monkeypatch, 0.3, ["old"])
|
|
39
|
+
assert Q.links_ready(svc, wait=0.01) is None
|
|
40
|
+
svc.graph = object() # the index changed while the table was being built
|
|
41
|
+
time.sleep(0.5)
|
|
42
|
+
assert getattr(svc, "_links_graph", None) is None # the finished build was of another graph: not kept
|
|
43
|
+
assert Q.links_ready(svc, wait=3.0) == ["old"] and len(built) == 2
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def test_a_build_that_fails_leaves_no_table_and_no_wait(monkeypatch):
|
|
47
|
+
svc = SimpleNamespace(graph=object())
|
|
48
|
+
|
|
49
|
+
def boom(s):
|
|
50
|
+
raise RuntimeError("x")
|
|
51
|
+
monkeypatch.setattr(Q, "linker", boom)
|
|
52
|
+
assert Q.links_ready(svc, wait=2.0) is None and Q.links_ready(SimpleNamespace(graph=None)) is None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def test_the_read_header_asks_only_for_what_is_ready():
|
|
56
|
+
src = (pathlib.Path(Q.__file__).parents[1] / "tools.py").read_text(encoding="utf-8")
|
|
57
|
+
head = src[src.index("def _intel_file_context"):src.index("def _intel_file_context") + 2600]
|
|
58
|
+
assert "links_ready(self.indexer)" in head and ".links()" not in head
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_a_tool_that_asks_for_the_links_says_what_it_waits_for(monkeypatch):
|
|
62
|
+
svc, _ = _svc(monkeypatch, 0.5, [])
|
|
63
|
+
svc.index = SimpleNamespace(files={})
|
|
64
|
+
monkeypatch.setattr(Q, "LINKS_TOOL_WAIT_S", 0.05)
|
|
65
|
+
monkeypatch.setattr(Q.linked, "__defaults__", (0.05,))
|
|
66
|
+
for out in (Q.graph_slice(svc, ["f"]), Q.impact_of_change(svc, ["f"])):
|
|
67
|
+
assert out["ok"] is False and "still being resolved" in out["content"]
|
|
68
|
+
src = pathlib.Path(Q.__file__).read_text(encoding="utf-8")
|
|
69
|
+
calls = [l for l in src.splitlines() if "linker(svc)" in l and not l.lstrip().startswith(("#", "def "))]
|
|
70
|
+
assert len(calls) == 1 and "lk = linker(svc)" in calls[0] # only the build itself asks for the resolver
|
|
@@ -58,3 +58,22 @@ def test_a_small_image_goes_as_it_is(tmp_path):
|
|
|
58
58
|
|
|
59
59
|
def test_what_cannot_be_shrunk_is_left_to_the_cut(monkeypatch):
|
|
60
60
|
assert T.shrink_image(b"not an image at all" * 100) is None
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_an_image_is_decoded_through_one_door_raster_only_and_bounded(monkeypatch):
|
|
64
|
+
"""Security review 2026-11-27: a workspace file is not trusted -- no EPS/PS (Pillow runs Ghostscript on them),
|
|
65
|
+
no canvas that does not fit in memory."""
|
|
66
|
+
pytest.importorskip("PIL.Image")
|
|
67
|
+
import pathlib
|
|
68
|
+
from webbee import media
|
|
69
|
+
eps = b"%!PS-Adobe-3.0 EPSF-3.0\n%%BoundingBox: 0 0 10 10\n%%EndComments\nshowpage\n%%EOF\n"
|
|
70
|
+
with pytest.raises(ValueError):
|
|
71
|
+
media.open_image(io.BytesIO(eps))
|
|
72
|
+
assert T.shrink_image(eps * 20000) is None
|
|
73
|
+
assert not {"EPS", "PDF", "TIFF"} & set(media.IMAGE_FORMATS)
|
|
74
|
+
monkeypatch.setattr(media, "IMAGE_MAX_PIXELS", 1000)
|
|
75
|
+
with pytest.raises(ValueError):
|
|
76
|
+
media.open_image(io.BytesIO(_noise_png(64)))
|
|
77
|
+
src = pathlib.Path(media.__file__).parent
|
|
78
|
+
opens = [f.name for f in src.glob("*.py") if "Image.open(" in f.read_text(encoding="utf-8")]
|
|
79
|
+
assert opens == ["media.py"] # nobody decodes an image beside the door
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.7.24"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|