kash-shell 0.3.21__tar.gz → 0.3.23__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.
- {kash_shell-0.3.21 → kash_shell-0.3.23}/PKG-INFO +1 -1
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/markdownify_html.py +11 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/tabbed_webpage_generate.py +2 -2
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/help/assistant_commands.py +2 -4
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/help/logo.py +12 -17
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/help/welcome.py +5 -4
- kash_shell-0.3.23/src/kash/docs/markdown/warning.md +3 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/welcome.md +2 -1
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/fetch_url_items.py +23 -13
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/preconditions.py +7 -2
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/file_store.py +3 -3
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/items_model.py +14 -11
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/output/shell_output.py +8 -4
- kash_shell-0.3.23/src/kash/utils/api_utils/api_retries.py +631 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/api_utils/gather_limited.py +204 -488
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/text_handling/markdown_utils.py +158 -1
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/web_extract.py +1 -1
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/tabbed_webpage.py +2 -2
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/load_into_xonsh.py +0 -3
- kash_shell-0.3.23/tests/kash/utils/api_utils/test_gather_limited.py +879 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/tests/kash/utils/rich_custom/test_multitask_status.py +9 -6
- {kash_shell-0.3.21 → kash_shell-0.3.23}/uv.lock +105 -91
- kash_shell-0.3.21/src/kash/docs/markdown/warning.md +0 -3
- kash_shell-0.3.21/src/kash/utils/api_utils/api_retries.py +0 -305
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.copier-answers.yml +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.cursor/rules/general.mdc +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.cursor/rules/python.mdc +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.env.template +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.github/workflows/ci.yml +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.github/workflows/publish.yml +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/.gitignore +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/LICENSE +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/Makefile +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/README.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/development.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/devtools/generate_readme.xsh +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/devtools/lint.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/devtools/profile_main.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/installation.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/publishing.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/pyproject.toml +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/__main__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/assistant_chat.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/chat.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/format_markdown_template.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/minify_html.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/readability.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/render_as_html.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/show_webpage.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/strip_html.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/summarize_as_bullets.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/core/tabbed_webpage_config.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/meta/write_instructions.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/actions/meta/write_new_action.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/basic_file_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/browser_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/debug_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/diff_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/files_command.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/general_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/logs_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/model_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/reformat_command.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/search_command.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/base/show_command.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/extras/parse_uv_lock.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/extras/utils_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/help/doc_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/help/help_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/workspace/selection_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/commands/workspace/workspace_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/capture_output.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/colors.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/env_settings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/init.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/lazy_imports.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/logger.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/logger_basic.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/logo.txt +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/server_config.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/settings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/setup.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/suppress_warnings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/config/text_styles.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/all_docs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/load_actions_info.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/load_api_docs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/load_help_topics.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/load_source_code.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/api_docs_template.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/assistant_instructions_template.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/readme_template.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/a1_what_is_kash.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/a2_installation.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/a3_getting_started.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/a4_elements.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/a5_tips_for_use_with_other_tools.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/b0_philosophy_of_kash.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/b1_kash_overview.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/b2_workspace_and_file_formats.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/b3_modern_shell_tool_recommendations.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs/markdown/topics/b4_faq.md +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/docs_base.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/load_custom_command_info.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/load_faqs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/load_recipe_snippets.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/recipes/general_system_commands.sh +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/recipes/python_dev_commands.sh +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/docs_base/recipes/tldr_standard_commands.sh +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/embeddings/cosine.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/embeddings/embeddings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/embeddings/text_similarity.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/action_decorators.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/action_exec.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/action_registry.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/combiners.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/command_exec.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/command_registry.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/history.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/importing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/llm_transforms.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/precondition_checks.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/precondition_registry.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/resolve_args.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/runtime_settings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec/shell_callable_action.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec_model/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec_model/args_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec_model/commands_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec_model/script_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/exec_model/shell_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/item_file_format.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/metadata_dirs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/persisted_yaml.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/store_cache_warmer.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/file_storage/store_filenames.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/assistant.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/assistant_instructions.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/assistant_output.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/function_param_info.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/help_embeddings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/help_lookups.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/help_pages.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/help_printing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/help_types.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/recommended_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/help/tldr_help.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/clean_headings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/custom_sliding_transforms.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/fuzzy_parsing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/init_litellm.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/llm_api_keys.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/llm_completion.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/llm_features.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/llm_messages.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/llm_names.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/llm_utils/llms.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/local_server.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/local_server_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/local_server_routes.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/local_url_formatters.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/port_tools.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/local_server/rich_html_template.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/mcp_cli.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/mcp_main.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/mcp_server_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/mcp_server_routes.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/mcp_server_sse.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/mcp/mcp_server_stdio.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/audio_processing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/media_cache.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/media_services.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/media_tools.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/services/local_file_media.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/timestamp_citations.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/transcription_deepgram.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/transcription_format.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/media_base/transcription_whisper.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/actions_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/assistant_response_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/compound_actions_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/concept_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/exec_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/graph_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/language_list.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/llm_actions_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/media_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/operations_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/params_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/paths_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/model/preconditions_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/completions/completion_scoring.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/completions/completion_types.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/completions/shell_completions.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/file_icons/color_for_format.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/file_icons/nerd_icons.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/input/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/input/input_prompts.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/input/inquirer_settings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/input/param_inputs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/input/shell_confirm.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/output/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/output/kerm_code_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/output/kerm_codes.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/output/kmarkdown.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/output/shell_formatting.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/shell_main.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/ui/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/ui/shell_results.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/ui/shell_syntax.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/utils/exception_printing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/utils/native_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/utils/shell_function_wrapper.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/shell/version.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/api_utils/cache_requests_limited.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/api_utils/progress_protocol.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/format_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/function_inspect.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/import_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/lazyobject.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/obj_replace.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/parse_docstring.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/parse_key_vals.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/parse_shell_args.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/stack_traces.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/task_stack.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/testing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/type_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/uniquifier.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/url.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/common/url_slice.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/errors.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_formats/chat_format.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/dir_info.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/file_ext.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/file_formats.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/file_formats_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/file_sort_filter.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/file_walk.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/filename_parsing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/ignore_files.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/mtime_cache.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/file_utils/path_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/lang_utils/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/lang_utils/capitalization.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/rich_custom/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/rich_custom/ansi_cell_len.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/rich_custom/multitask_status.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/rich_custom/rich_char_transform.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/rich_custom/rich_indent.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/rich_custom/rich_markdown_fork.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/text_handling/doc_normalization.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/text_handling/escape_html_tags.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/text_handling/markdown_render.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/text_handling/markdownify_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/utils/text_handling/unified_diffs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/canon_url.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/dir_store.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/file_cache_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/file_processing.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/local_file_cache.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/web_extract_justext.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/web_extract_readabilipy.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/web_fetch.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_content/web_page_model.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/simple_webpage.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/template_render.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/base_styles.css.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/base_webpage.html.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/components/toc_scripts.js.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/components/toc_styles.css.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/components/tooltip_scripts.js.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/components/tooltip_styles.css.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/content_styles.css.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/explain_view.html.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/item_view.html.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/simple_webpage.html.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/web_gen/templates/tabbed_webpage.html.jinja +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/__init__.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/param_state.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/selections.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/source_items.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/workspace_dirs.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/workspace_output.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/workspace_registry.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/workspaces/workspaces.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/command_nl_utils.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/custom_shell.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/customize_prompt.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/shell_load_commands.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/shell_which.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/xonsh_completers.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/xonsh_env.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/xonsh_keybindings.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/xonsh_modern_tools.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xonsh_custom/xonsh_ranking_completer.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xontrib/fnm.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/src/kash/xontrib/kash_extension.py +0 -0
- {kash_shell-0.3.21 → kash_shell-0.3.23}/tests/test_shell.py +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
from prettyfmt import abbrev_on_words
|
|
2
|
+
|
|
1
3
|
from kash.config.logger import get_logger
|
|
2
4
|
from kash.exec import kash_action
|
|
3
5
|
from kash.exec.preconditions import has_html_body, is_url_resource
|
|
4
6
|
from kash.exec.runtime_settings import current_runtime_settings
|
|
5
7
|
from kash.model import Format, Item
|
|
6
8
|
from kash.model.items_model import ItemType
|
|
9
|
+
from kash.utils.text_handling.markdown_utils import first_heading
|
|
7
10
|
from kash.utils.text_handling.markdownify_utils import markdownify_custom
|
|
8
11
|
from kash.web_content.file_cache_utils import get_url_html
|
|
9
12
|
from kash.web_content.web_extract_readabilipy import extract_text_readabilipy
|
|
@@ -25,6 +28,14 @@ def markdownify_html(item: Item) -> Item:
|
|
|
25
28
|
assert page_data.clean_html
|
|
26
29
|
markdown_content = markdownify_custom(page_data.clean_html)
|
|
27
30
|
|
|
31
|
+
# Sometimes readability doesn't include the title, in which case we add it.
|
|
32
|
+
first_h1 = first_heading(markdown_content, allowed_tags=("h1",))
|
|
33
|
+
title = page_data.title and abbrev_on_words(page_data.title.strip(), 80)
|
|
34
|
+
if not first_h1 and title:
|
|
35
|
+
log.message(f"No h1 found, inserting h1: {title}")
|
|
36
|
+
# Insert a h1 at the top of the document
|
|
37
|
+
markdown_content = f"# {title}\n\n{markdown_content}"
|
|
38
|
+
|
|
28
39
|
output_item = item.derived_copy(
|
|
29
40
|
type=ItemType.doc, format=Format.markdown, body=markdown_content
|
|
30
41
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from kash.config.logger import get_logger
|
|
2
2
|
from kash.exec import kash_action
|
|
3
|
-
from kash.exec.preconditions import
|
|
3
|
+
from kash.exec.preconditions import is_data
|
|
4
4
|
from kash.model import ONE_ARG, ActionInput, ActionResult, FileExt, Format, Item, ItemType, Param
|
|
5
5
|
from kash.web_gen import tabbed_webpage
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ log = get_logger(__name__)
|
|
|
9
9
|
|
|
10
10
|
@kash_action(
|
|
11
11
|
expected_args=ONE_ARG,
|
|
12
|
-
precondition=
|
|
12
|
+
precondition=is_data,
|
|
13
13
|
params=(Param("add_title", "Add a title to the page body.", type=bool),),
|
|
14
14
|
)
|
|
15
15
|
def tabbed_webpage_generate(input: ActionInput, add_title: bool = False) -> ActionResult:
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
from rich import get_console
|
|
2
|
-
|
|
3
1
|
from kash.commands.base.basic_file_commands import trash
|
|
4
2
|
from kash.commands.workspace.selection_commands import select
|
|
5
|
-
from kash.config.logger import get_logger
|
|
3
|
+
from kash.config.logger import get_console, get_logger
|
|
6
4
|
from kash.config.text_styles import PROMPT_ASSIST, SPINNER
|
|
7
5
|
from kash.docs.all_docs import DocSelection
|
|
8
6
|
from kash.exec import kash_command
|
|
@@ -45,7 +43,7 @@ def assist(
|
|
|
45
43
|
help()
|
|
46
44
|
return
|
|
47
45
|
|
|
48
|
-
with get_console().status("Thinking…", spinner=SPINNER):
|
|
46
|
+
with get_console().status("Thinking…", spinner=SPINNER): # noqa: F821
|
|
49
47
|
shell_context_assistance(input, model=model, assistance_type=type)
|
|
50
48
|
|
|
51
49
|
|
|
@@ -2,7 +2,8 @@ import re
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
from rich.box import SQUARE
|
|
5
|
-
from rich.console import Group
|
|
5
|
+
from rich.console import Group, RenderableType
|
|
6
|
+
from rich.padding import Padding
|
|
6
7
|
from rich.panel import Panel
|
|
7
8
|
from rich.text import Text
|
|
8
9
|
|
|
@@ -62,7 +63,13 @@ def color_logo() -> Group:
|
|
|
62
63
|
)
|
|
63
64
|
|
|
64
65
|
|
|
65
|
-
def
|
|
66
|
+
def simple_box(content: RenderableType) -> Panel:
|
|
67
|
+
return Panel(
|
|
68
|
+
content, border_style=COLOR_HINT, padding=(0, 1), width=CONSOLE_WRAP_WIDTH, box=SQUARE
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def logo_box(content: Group | None = None) -> Padding:
|
|
66
73
|
panel_width = CONSOLE_WRAP_WIDTH
|
|
67
74
|
|
|
68
75
|
logo_lines = LOGO_LARGE.split("\n")
|
|
@@ -70,29 +77,17 @@ def branded_box(content: Group | None, version: str | None = None) -> Panel:
|
|
|
70
77
|
tagline_offset = (panel_width - 4 - len(TAGLINE_STYLED)) // 2
|
|
71
78
|
|
|
72
79
|
colored_lines = [logo_colorize_line(line, " ", rest_offset) for line in logo_lines]
|
|
73
|
-
header = None
|
|
74
|
-
if version:
|
|
75
|
-
footer = Text(version, style=COLOR_HINT, justify="right")
|
|
76
|
-
else:
|
|
77
|
-
footer = None
|
|
78
80
|
|
|
79
81
|
body = ["", content] if content else []
|
|
80
82
|
|
|
81
|
-
return
|
|
83
|
+
return Padding(
|
|
82
84
|
Group(
|
|
83
85
|
Text.assemble(" " * tagline_offset, LOGO_SPACER),
|
|
84
86
|
*colored_lines,
|
|
85
87
|
Text.assemble(" " * tagline_offset, TAGLINE_STYLED),
|
|
86
88
|
*body,
|
|
87
89
|
),
|
|
88
|
-
|
|
89
|
-
title_align="center",
|
|
90
|
-
subtitle=footer,
|
|
91
|
-
subtitle_align="right",
|
|
92
|
-
border_style=COLOR_HINT,
|
|
93
|
-
padding=(0, 1),
|
|
94
|
-
width=panel_width,
|
|
95
|
-
box=SQUARE,
|
|
90
|
+
pad=(1, 1),
|
|
96
91
|
)
|
|
97
92
|
|
|
98
93
|
|
|
@@ -101,7 +96,7 @@ def kash_logo(box: bool = False, svg_out: str | None = None, html_out: str | Non
|
|
|
101
96
|
"""
|
|
102
97
|
Show the kash logo.
|
|
103
98
|
"""
|
|
104
|
-
logo =
|
|
99
|
+
logo = logo_box(None) if box else color_logo()
|
|
105
100
|
|
|
106
101
|
cprint(logo)
|
|
107
102
|
|
|
@@ -2,7 +2,7 @@ from rich.box import SQUARE
|
|
|
2
2
|
from rich.console import Group
|
|
3
3
|
from rich.panel import Panel
|
|
4
4
|
|
|
5
|
-
from kash.commands.help.logo import
|
|
5
|
+
from kash.commands.help.logo import logo_box, simple_box
|
|
6
6
|
from kash.config.text_styles import (
|
|
7
7
|
COLOR_HINT,
|
|
8
8
|
)
|
|
@@ -20,14 +20,15 @@ def welcome() -> None:
|
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
help_topics = all_docs.help_topics
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
# Create header with logo and right-justified version
|
|
25
25
|
|
|
26
26
|
PrintHooks.before_welcome()
|
|
27
|
+
cprint(logo_box())
|
|
27
28
|
cprint(
|
|
28
|
-
|
|
29
|
+
simple_box(
|
|
29
30
|
Group(Markdown(help_topics.welcome)),
|
|
30
|
-
version,
|
|
31
31
|
)
|
|
32
32
|
)
|
|
33
33
|
cprint(Panel(Markdown(help_topics.warning), box=SQUARE, border_style=COLOR_HINT))
|
|
34
|
+
cprint("%s", get_full_version_name())
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
**Welcome to
|
|
1
|
+
**Welcome to Kash!**
|
|
2
2
|
|
|
3
|
+
Use `help` for the manual and full list of available commands.
|
|
3
4
|
Press **tab** for contextual autocomplete of commands, questions, actions, and files.
|
|
4
5
|
You may simply ask a question and the kash assistant will help you.
|
|
5
6
|
Press **space** (or type **?**), then write your question or request.
|
|
@@ -12,7 +12,11 @@ log = get_logger(__name__)
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def fetch_url_item(
|
|
15
|
-
locator: Url | StorePath,
|
|
15
|
+
locator: Url | StorePath,
|
|
16
|
+
*,
|
|
17
|
+
save_content: bool = True,
|
|
18
|
+
refetch: bool = False,
|
|
19
|
+
cache: bool = True,
|
|
16
20
|
) -> Item:
|
|
17
21
|
from kash.workspaces import current_ws
|
|
18
22
|
|
|
@@ -28,17 +32,21 @@ def fetch_url_item(
|
|
|
28
32
|
else:
|
|
29
33
|
raise InvalidInput(f"Not a URL or URL resource: {fmt_loc(locator)}")
|
|
30
34
|
|
|
31
|
-
return fetch_url_item_content(item, save_content=save_content, refetch=refetch)
|
|
35
|
+
return fetch_url_item_content(item, save_content=save_content, refetch=refetch, cache=cache)
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
def fetch_url_item_content(
|
|
38
|
+
def fetch_url_item_content(
|
|
39
|
+
item: Item, *, save_content: bool = True, refetch: bool = False, cache: bool = True
|
|
40
|
+
) -> Item:
|
|
35
41
|
"""
|
|
36
42
|
Fetch content and metadata for a URL using a media service if we
|
|
37
43
|
recognize the URL as a known media service. Otherwise, fetch and extract the
|
|
38
44
|
metadata and content from the web page and save it to the URL item.
|
|
39
45
|
|
|
40
|
-
If `save_content` is true, a copy of the content is also saved
|
|
41
|
-
a resource item.
|
|
46
|
+
If `save_content` is true, a copy of the content is also saved to the workspace
|
|
47
|
+
as a resource item.
|
|
48
|
+
|
|
49
|
+
If `cache` is true, the content is also cached in the local file cache.
|
|
42
50
|
|
|
43
51
|
The content item is returned if content was saved. Otherwise, the updated
|
|
44
52
|
URL item is returned.
|
|
@@ -48,9 +56,10 @@ def fetch_url_item_content(item: Item, *, save_content: bool = True, refetch: bo
|
|
|
48
56
|
from kash.workspaces import current_ws
|
|
49
57
|
|
|
50
58
|
ws = current_ws()
|
|
51
|
-
if not refetch and item.title and item.description:
|
|
52
|
-
log.
|
|
53
|
-
"Already have title and
|
|
59
|
+
if not refetch and item.title and item.description and item.body:
|
|
60
|
+
log.info(
|
|
61
|
+
"Already have title, description, and body, will not fetch: %s",
|
|
62
|
+
item.fmt_loc(),
|
|
54
63
|
)
|
|
55
64
|
return item
|
|
56
65
|
|
|
@@ -58,7 +67,7 @@ def fetch_url_item_content(item: Item, *, save_content: bool = True, refetch: bo
|
|
|
58
67
|
raise InvalidInput(f"No URL for item: {item.fmt_loc()}")
|
|
59
68
|
|
|
60
69
|
url = canonicalize_url(item.url)
|
|
61
|
-
log.
|
|
70
|
+
log.info("No metadata for URL, will fetch: %s", url)
|
|
62
71
|
|
|
63
72
|
# Prefer fetching metadata from media using the media service if possible.
|
|
64
73
|
# Data is cleaner and YouTube for example often blocks regular scraping.
|
|
@@ -72,12 +81,12 @@ def fetch_url_item_content(item: Item, *, save_content: bool = True, refetch: bo
|
|
|
72
81
|
if slice:
|
|
73
82
|
new_url = add_slice_to_url(media_metadata.url, slice)
|
|
74
83
|
if new_url != item.url:
|
|
75
|
-
log.
|
|
84
|
+
log.info("Updated URL from metadata and added slice: %s", new_url)
|
|
76
85
|
url_item.url = new_url
|
|
77
86
|
|
|
78
87
|
url_item = item.merged_copy(url_item)
|
|
79
88
|
else:
|
|
80
|
-
page_data = fetch_page_content(url, refetch=refetch, cache=
|
|
89
|
+
page_data = fetch_page_content(url, refetch=refetch, cache=cache)
|
|
81
90
|
url_item = item.new_copy_with(
|
|
82
91
|
title=page_data.title or item.title,
|
|
83
92
|
description=page_data.description or item.description,
|
|
@@ -100,10 +109,11 @@ def fetch_url_item_content(item: Item, *, save_content: bool = True, refetch: bo
|
|
|
100
109
|
# Now save the updated URL item and also the content item if we have one.
|
|
101
110
|
ws.save(url_item)
|
|
102
111
|
assert url_item.store_path
|
|
103
|
-
log.debug("Saved URL item: %s", url_item.fmt_loc())
|
|
104
112
|
if content_item:
|
|
105
113
|
ws.save(content_item)
|
|
106
114
|
assert content_item.store_path
|
|
107
|
-
log.
|
|
115
|
+
log.info("Saved content item: %s", content_item.fmt_loc())
|
|
116
|
+
else:
|
|
117
|
+
log.info("Saved URL item: %s", url_item.fmt_loc())
|
|
108
118
|
|
|
109
119
|
return content_item or url_item
|
|
@@ -48,8 +48,13 @@ def is_concept(item: Item) -> bool:
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
@kash_precondition
|
|
51
|
-
def
|
|
52
|
-
return item.type == ItemType.
|
|
51
|
+
def is_data(item: Item) -> bool:
|
|
52
|
+
return item.type == ItemType.data
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@kash_precondition
|
|
56
|
+
def is_table(item: Item) -> bool:
|
|
57
|
+
return item.type == ItemType.table
|
|
53
58
|
|
|
54
59
|
|
|
55
60
|
@kash_precondition
|
|
@@ -289,7 +289,7 @@ class FileStore(Workspace):
|
|
|
289
289
|
if self.exists(default_path):
|
|
290
290
|
old_item = self.load(default_path)
|
|
291
291
|
if old_item.item_id() == item_id:
|
|
292
|
-
log.
|
|
292
|
+
log.info(
|
|
293
293
|
"Item with the same id already saved (disk check):\n%s",
|
|
294
294
|
fmt_lines([fmt_loc(default_path), item_id]),
|
|
295
295
|
)
|
|
@@ -297,7 +297,7 @@ class FileStore(Workspace):
|
|
|
297
297
|
self.id_map[item_id] = default_path
|
|
298
298
|
return default_path
|
|
299
299
|
if store_path and self.exists(store_path):
|
|
300
|
-
log.
|
|
300
|
+
log.info(
|
|
301
301
|
"Item with the same id already saved (disk check):\n%s",
|
|
302
302
|
fmt_lines([fmt_loc(store_path), item_id]),
|
|
303
303
|
)
|
|
@@ -536,7 +536,7 @@ class FileStore(Workspace):
|
|
|
536
536
|
item = Item(item_type, url=url, format=Format.url)
|
|
537
537
|
previous_store_path = self.find_by_id(item)
|
|
538
538
|
if previous_store_path and not reimport:
|
|
539
|
-
log.
|
|
539
|
+
log.info(
|
|
540
540
|
"Workspace already has this URL:\n%s",
|
|
541
541
|
fmt_lines([fmt_loc(previous_store_path), url]),
|
|
542
542
|
)
|
|
@@ -55,7 +55,8 @@ class ItemType(Enum):
|
|
|
55
55
|
concept = "concept"
|
|
56
56
|
resource = "resource"
|
|
57
57
|
asset = "asset"
|
|
58
|
-
|
|
58
|
+
data = "data"
|
|
59
|
+
table = "table"
|
|
59
60
|
export = "export"
|
|
60
61
|
chat = "chat"
|
|
61
62
|
extension = "extension"
|
|
@@ -86,7 +87,9 @@ class ItemType(Enum):
|
|
|
86
87
|
Format.diff: ItemType.doc,
|
|
87
88
|
Format.python: ItemType.extension,
|
|
88
89
|
Format.json: ItemType.doc,
|
|
89
|
-
Format.csv: ItemType.
|
|
90
|
+
Format.csv: ItemType.table,
|
|
91
|
+
Format.xlsx: ItemType.table,
|
|
92
|
+
Format.npz: ItemType.table,
|
|
90
93
|
Format.log: ItemType.log,
|
|
91
94
|
Format.pdf: ItemType.resource,
|
|
92
95
|
Format.jpeg: ItemType.asset,
|
|
@@ -646,7 +649,7 @@ class Item:
|
|
|
646
649
|
body_text = abbrev_str(self.body_text(), max_len)
|
|
647
650
|
|
|
648
651
|
# Just for aesthetics, especially for titles of chat files.
|
|
649
|
-
if self.type in [ItemType.chat, ItemType.
|
|
652
|
+
if self.type in [ItemType.chat, ItemType.data] or self.format == Format.yaml:
|
|
650
653
|
try:
|
|
651
654
|
yaml_obj = list(new_yaml().load_all(self.body_text()))
|
|
652
655
|
if len(yaml_obj) > 0:
|
|
@@ -663,16 +666,16 @@ class Item:
|
|
|
663
666
|
"""
|
|
664
667
|
return bool(self.body and self.body.strip())
|
|
665
668
|
|
|
666
|
-
def
|
|
669
|
+
def read_as_data(self) -> Any:
|
|
667
670
|
"""
|
|
668
|
-
If it is a
|
|
671
|
+
If it is a data Item, return the parsed YAML.
|
|
669
672
|
"""
|
|
670
|
-
if not self.type == ItemType.
|
|
671
|
-
raise FileFormatError(f"Item is not a
|
|
673
|
+
if not self.type == ItemType.data:
|
|
674
|
+
raise FileFormatError(f"Item is not a data item: {self}")
|
|
672
675
|
if not self.body:
|
|
673
|
-
raise FileFormatError(f"
|
|
676
|
+
raise FileFormatError(f"Data item has no body: {self}")
|
|
674
677
|
if self.format != Format.yaml:
|
|
675
|
-
raise FileFormatError(f"
|
|
678
|
+
raise FileFormatError(f"Data item is not YAML: {self.format}: {self}")
|
|
676
679
|
return from_yaml_string(self.body)
|
|
677
680
|
|
|
678
681
|
def get_filename(self) -> str | None:
|
|
@@ -709,8 +712,8 @@ class Item:
|
|
|
709
712
|
elif self.type == ItemType.script:
|
|
710
713
|
# Same for kash/xonsh scripts.
|
|
711
714
|
return f"{self.type.value}.{FileExt.xsh.value}"
|
|
712
|
-
elif self.type
|
|
713
|
-
# For exports, skip the item type to keep it maximally compatible for external tools.
|
|
715
|
+
elif self.type in [ItemType.export, ItemType.data, ItemType.table]:
|
|
716
|
+
# For exports, data, and tables, skip the item type to keep it maximally compatible for external tools.
|
|
714
717
|
return f"{self.get_file_ext().value}"
|
|
715
718
|
else:
|
|
716
719
|
return f"{self.type.value}.{self.get_file_ext().value}"
|
|
@@ -4,7 +4,7 @@ Output to the shell UI. These are for user interaction, not logging.
|
|
|
4
4
|
|
|
5
5
|
import contextvars
|
|
6
6
|
from collections.abc import Callable
|
|
7
|
-
from contextlib import contextmanager
|
|
7
|
+
from contextlib import contextmanager, nullcontext
|
|
8
8
|
from enum import Enum, auto
|
|
9
9
|
|
|
10
10
|
import rich
|
|
@@ -82,12 +82,16 @@ def console_pager(use_pager: bool = True):
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
def multitask_status(
|
|
85
|
-
settings: StatusSettings | None = None, *, auto_summary: bool = True
|
|
86
|
-
) -> MultiTaskStatus:
|
|
85
|
+
settings: StatusSettings | None = None, *, auto_summary: bool = True, enabled: bool = True
|
|
86
|
+
) -> MultiTaskStatus | nullcontext:
|
|
87
87
|
"""
|
|
88
88
|
Create a `MultiTaskStatus` context manager for displaying multiple task progress
|
|
89
|
-
using the global shell console.
|
|
89
|
+
using the global shell console. If disabled, returns a null context, so it's convenient
|
|
90
|
+
to disable status display.
|
|
90
91
|
"""
|
|
92
|
+
if not enabled:
|
|
93
|
+
return nullcontext()
|
|
94
|
+
|
|
91
95
|
return MultiTaskStatus(
|
|
92
96
|
console=get_console(),
|
|
93
97
|
settings=settings,
|