kash-shell 0.3.11__tar.gz → 0.3.13__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.11 → kash_shell-0.3.13}/.copier-answers.yml +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/.github/workflows/ci.yml +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/.github/workflows/publish.yml +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/PKG-INFO +4 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/devtools/lint.py +7 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/pyproject.toml +9 -5
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/markdownify.py +5 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/readability.py +4 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/render_as_html.py +8 -6
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/show_webpage.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/strip_html.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/basic_file_commands.py +24 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/diff_commands.py +38 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/files_command.py +5 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/reformat_command.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/show_command.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/extras/parse_uv_lock.py +12 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/workspace/selection_commands.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/workspace/workspace_commands.py +62 -16
- kash_shell-0.3.13/src/kash/config/env_settings.py +32 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/logger.py +30 -25
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/logger_basic.py +6 -6
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/settings.py +23 -7
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/setup.py +33 -5
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/text_styles.py +25 -22
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/load_source_code.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/embeddings/cosine.py +12 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/embeddings/embeddings.py +16 -6
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/embeddings/text_similarity.py +10 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/__init__.py +3 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/action_decorators.py +4 -19
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/action_exec.py +46 -27
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/fetch_url_metadata.py +8 -5
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/importing.py +4 -4
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/llm_transforms.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/preconditions.py +11 -19
- kash_shell-0.3.13/src/kash/exec/runtime_settings.py +134 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/shell_callable_action.py +5 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/file_store.py +91 -53
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/item_file_format.py +6 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/store_filenames.py +7 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/help_embeddings.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/clean_headings.py +1 -1
- {kash_shell-0.3.11/src/kash/text_handling → kash_shell-0.3.13/src/kash/llm_utils}/custom_sliding_transforms.py +0 -3
- kash_shell-0.3.13/src/kash/llm_utils/init_litellm.py +16 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/llm_api_keys.py +6 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/llm_completion.py +12 -5
- kash_shell-0.3.13/src/kash/local_server/__init__.py +5 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/local_server/local_server_commands.py +2 -1
- kash_shell-0.3.13/src/kash/mcp/__init__.py +5 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/mcp/mcp_cli.py +3 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/mcp/mcp_server_commands.py +8 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/mcp/mcp_server_routes.py +11 -12
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/media_cache.py +10 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/transcription_deepgram.py +15 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/__init__.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/actions_model.py +9 -54
- kash_shell-0.3.13/src/kash/model/exec_model.py +79 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/items_model.py +131 -81
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/operations_model.py +38 -15
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/paths_model.py +2 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/output/shell_output.py +10 -8
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/shell_main.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/ui/shell_results.py +2 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/utils/exception_printing.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/format_utils.py +0 -14
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/import_utils.py +46 -18
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/task_stack.py +4 -15
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/errors.py +14 -9
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/file_formats_model.py +61 -26
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/file_sort_filter.py +10 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/filename_parsing.py +41 -16
- {kash_shell-0.3.11/src/kash → kash_shell-0.3.13/src/kash/utils}/text_handling/doc_normalization.py +23 -13
- kash_shell-0.3.13/src/kash/utils/text_handling/escape_html_tags.py +156 -0
- {kash_shell-0.3.11/src/kash → kash_shell-0.3.13/src/kash/utils}/text_handling/markdown_utils.py +82 -4
- kash_shell-0.3.13/src/kash/utils/text_handling/markdownify_utils.py +87 -0
- {kash_shell-0.3.11/src/kash → kash_shell-0.3.13/src/kash/utils}/text_handling/unified_diffs.py +1 -44
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/file_cache_utils.py +42 -34
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/local_file_cache.py +29 -12
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/web_extract.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/web_extract_readabilipy.py +4 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/web_fetch.py +42 -7
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/web_page_model.py +2 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/simple_webpage.py +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/base_styles.css.jinja +139 -16
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/simple_webpage.html.jinja +1 -1
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/__init__.py +12 -3
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/selections.py +2 -2
- kash_shell-0.3.13/src/kash/workspaces/workspace_dirs.py +58 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/workspace_importing.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/workspace_output.py +2 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/workspaces.py +26 -90
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/load_into_xonsh.py +4 -2
- {kash_shell-0.3.11 → kash_shell-0.3.13}/uv.lock +164 -188
- kash_shell-0.3.11/src/kash/config/env_settings.py +0 -72
- kash_shell-0.3.11/src/kash/local_server/__init__.py +0 -5
- kash_shell-0.3.11/src/kash/mcp/__init__.py +0 -5
- kash_shell-0.3.11/src/kash/shell/utils/argparse_utils.py +0 -20
- kash_shell-0.3.11/src/kash/utils/lang_utils/inflection.py +0 -18
- {kash_shell-0.3.11 → kash_shell-0.3.13}/.env.template +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/.gitignore +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/LICENSE +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/Makefile +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/README.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/development.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/devtools/generate_readme.xsh +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/devtools/profile_main.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/installation.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/publishing.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/__main__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/assistant_chat.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/chat.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/format_markdown_template.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/summarize_as_bullets.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/tabbed_webpage_config.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/core/tabbed_webpage_generate.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/meta/write_instructions.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/actions/meta/write_new_action.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/browser_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/debug_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/general_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/logs_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/model_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/base/search_command.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/extras/utils_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/help/assistant_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/help/doc_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/help/help_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/help/logo.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/commands/help/welcome.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/capture_output.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/colors.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/init.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/lazy_imports.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/logo.txt +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/server_config.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/config/suppress_warnings.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/all_docs.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/load_actions_info.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/load_api_docs.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/load_help_topics.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/api_docs_template.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/assistant_instructions_template.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/readme_template.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/a1_what_is_kash.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/a2_installation.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/a3_getting_started.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/a4_elements.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/a5_tips_for_use_with_other_tools.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/b0_philosophy_of_kash.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/b1_kash_overview.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/b2_workspace_and_file_formats.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/b3_modern_shell_tool_recommendations.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/topics/b4_faq.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/warning.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs/markdown/welcome.md +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/docs_base.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/load_custom_command_info.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/load_faqs.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/load_recipe_snippets.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/recipes/general_system_commands.sh +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/recipes/python_dev_commands.sh +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/docs_base/recipes/tldr_standard_commands.sh +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/action_registry.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/combiners.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/command_exec.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/command_registry.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/history.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/precondition_checks.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/precondition_registry.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec/resolve_args.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec_model/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec_model/args_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec_model/commands_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec_model/script_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/exec_model/shell_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/metadata_dirs.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/persisted_yaml.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/file_storage/store_cache_warmer.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/assistant.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/assistant_instructions.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/assistant_output.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/docstring_utils.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/function_param_info.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/help_lookups.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/help_pages.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/help_printing.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/help_types.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/recommended_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/help/tldr_help.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/fuzzy_parsing.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/llm_features.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/llm_messages.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/llm_names.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/llm_utils/llms.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/local_server/local_server.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/local_server/local_server_routes.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/local_server/local_url_formatters.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/local_server/port_tools.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/local_server/rich_html_template.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/mcp/mcp_main.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/mcp/mcp_server_sse.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/mcp/mcp_server_stdio.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/audio_processing.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/media_services.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/media_tools.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/services/local_file_media.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/timestamp_citations.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/transcription_format.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/media_base/transcription_whisper.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/assistant_response_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/compound_actions_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/concept_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/graph_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/language_list.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/llm_actions_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/media_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/params_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/model/preconditions_model.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/completions/completion_scoring.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/completions/completion_types.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/completions/shell_completions.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/file_icons/color_for_format.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/file_icons/nerd_icons.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/input/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/input/input_prompts.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/input/inquirer_settings.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/input/param_inputs.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/input/shell_confirm.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/output/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/output/kerm_code_utils.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/output/kerm_codes.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/output/kmarkdown.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/output/shell_formatting.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/ui/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/ui/shell_syntax.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/utils/native_utils.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/utils/shell_function_wrapper.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/shell/version.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/function_inspect.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/lazyobject.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/obj_replace.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/parse_key_vals.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/parse_shell_args.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/stack_traces.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/type_utils.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/uniquifier.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/common/url.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_formats/chat_format.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/dir_info.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/file_ext.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/file_formats.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/file_walk.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/ignore_files.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/mtime_cache.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/file_utils/path_utils.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/lang_utils/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/lang_utils/capitalization.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/rich_custom/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/rich_custom/ansi_cell_len.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/rich_custom/rich_char_transform.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/rich_custom/rich_indent.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/utils/rich_custom/rich_markdown_fork.py +0 -0
- {kash_shell-0.3.11/src/kash → kash_shell-0.3.13/src/kash/utils}/text_handling/markdown_render.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/canon_url.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/dir_store.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/file_processing.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_content/web_extract_justext.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/__init__.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/tabbed_webpage.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/template_render.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/base_webpage.html.jinja +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/content_styles.css.jinja +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/explain_view.html.jinja +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/item_view.html.jinja +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/web_gen/templates/tabbed_webpage.html.jinja +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/param_state.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/source_items.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/workspaces/workspace_registry.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/command_nl_utils.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/custom_shell.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/customize_prompt.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/shell_load_commands.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/shell_which.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/xonsh_completers.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/xonsh_env.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/xonsh_keybindings.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/xonsh_modern_tools.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xonsh_custom/xonsh_ranking_completer.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xontrib/fnm.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/src/kash/xontrib/kash_extension.py +0 -0
- {kash_shell-0.3.11 → kash_shell-0.3.13}/tests/test_shell.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kash-shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.13
|
|
4
4
|
Summary: The knowledge agent shell (core)
|
|
5
5
|
Project-URL: Repository, https://github.com/jlevy/kash-shell
|
|
6
6
|
Author-email: Joshua Levy <joshua@cal.berkeley.edu>
|
|
@@ -20,17 +20,16 @@ Requires-Dist: anyio>=4.8.0
|
|
|
20
20
|
Requires-Dist: audioop-lts>=0.2.1; python_version >= '3.13'
|
|
21
21
|
Requires-Dist: cachetools>=5.5.2
|
|
22
22
|
Requires-Dist: chopdiff>=0.2.1
|
|
23
|
-
Requires-Dist: clideps>=0.1.
|
|
23
|
+
Requires-Dist: clideps>=0.1.4
|
|
24
24
|
Requires-Dist: colour>=0.1.5
|
|
25
25
|
Requires-Dist: cssselect>=1.2.0
|
|
26
26
|
Requires-Dist: deepgram-sdk>=3.10.1
|
|
27
27
|
Requires-Dist: dunamai>=1.23.0
|
|
28
28
|
Requires-Dist: fastapi>=0.115.11
|
|
29
|
-
Requires-Dist: flowmark>=0.4.
|
|
29
|
+
Requires-Dist: flowmark>=0.4.6
|
|
30
30
|
Requires-Dist: frontmatter-format>=0.2.1
|
|
31
31
|
Requires-Dist: funlog>=0.2.0
|
|
32
32
|
Requires-Dist: humanfriendly>=10.0
|
|
33
|
-
Requires-Dist: inflect>=7.5.0
|
|
34
33
|
Requires-Dist: inquirerpy>=0.3.4
|
|
35
34
|
Requires-Dist: jinja2>=3.1.6
|
|
36
35
|
Requires-Dist: justext>=3.0.2
|
|
@@ -43,6 +42,7 @@ Requires-Dist: openai>=1.66.3
|
|
|
43
42
|
Requires-Dist: pandas>=2.2.3
|
|
44
43
|
Requires-Dist: patch-ng>=1.18.1
|
|
45
44
|
Requires-Dist: pathspec>=0.12.1
|
|
45
|
+
Requires-Dist: pluralizer>=1.2.0
|
|
46
46
|
Requires-Dist: prettyfmt>=0.3.1
|
|
47
47
|
Requires-Dist: prompt-toolkit>=3.0.50
|
|
48
48
|
Requires-Dist: pydantic>=2.10.6
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
|
|
3
3
|
from funlog import log_calls
|
|
4
|
+
from rich import get_console, reconfigure
|
|
4
5
|
from rich import print as rprint
|
|
5
6
|
|
|
6
7
|
# Update as needed.
|
|
@@ -8,6 +9,9 @@ SRC_PATHS = ["src", "tests", "devtools"]
|
|
|
8
9
|
DOC_PATHS = ["README.md"]
|
|
9
10
|
|
|
10
11
|
|
|
12
|
+
reconfigure(emoji=not get_console().options.legacy_windows) # No emojis on legacy windows.
|
|
13
|
+
|
|
14
|
+
|
|
11
15
|
def main():
|
|
12
16
|
rprint()
|
|
13
17
|
|
|
@@ -21,9 +25,9 @@ def main():
|
|
|
21
25
|
rprint()
|
|
22
26
|
|
|
23
27
|
if errcount != 0:
|
|
24
|
-
rprint(f"[bold red]
|
|
28
|
+
rprint(f"[bold red]:x: Lint failed with {errcount} errors.[/bold red]")
|
|
25
29
|
else:
|
|
26
|
-
rprint("[bold green]
|
|
30
|
+
rprint("[bold green]:white_check_mark: Lint passed![/bold green]")
|
|
27
31
|
rprint()
|
|
28
32
|
|
|
29
33
|
return errcount
|
|
@@ -32,7 +36,7 @@ def main():
|
|
|
32
36
|
@log_calls(level="warning", show_timing_only=True)
|
|
33
37
|
def run(cmd: list[str]) -> int:
|
|
34
38
|
rprint()
|
|
35
|
-
rprint(f"[bold green]
|
|
39
|
+
rprint(f"[bold green]:arrow_forward: {' '.join(cmd)}[/bold green]")
|
|
36
40
|
errcount = 0
|
|
37
41
|
try:
|
|
38
42
|
subprocess.run(cmd, text=True, check=True)
|
|
@@ -38,17 +38,17 @@ classifiers = [
|
|
|
38
38
|
# ---- Main dependencies ----
|
|
39
39
|
|
|
40
40
|
dependencies = [
|
|
41
|
-
|
|
41
|
+
"dunamai>=1.23.0",
|
|
42
42
|
"pydantic>=2.10.6",
|
|
43
43
|
"typing-extensions>=4.12.2",
|
|
44
44
|
# My tools:
|
|
45
45
|
"strif>=3.0.1",
|
|
46
46
|
"funlog>=0.2.0",
|
|
47
47
|
"prettyfmt>=0.3.1",
|
|
48
|
-
"flowmark>=0.4.
|
|
48
|
+
"flowmark>=0.4.6",
|
|
49
49
|
"frontmatter-format>=0.2.1",
|
|
50
50
|
"chopdiff>=0.2.1",
|
|
51
|
-
"clideps>=0.1.
|
|
51
|
+
"clideps>=0.1.4",
|
|
52
52
|
# Shell and file essentials:
|
|
53
53
|
# python-magic is most current and works with libmagic on macOS and Linux.
|
|
54
54
|
# on Windows, python-magic-bin seems like the best option.
|
|
@@ -71,7 +71,6 @@ dependencies = [
|
|
|
71
71
|
"tldr>=3.3.0",
|
|
72
72
|
"jinja2>=3.1.6",
|
|
73
73
|
"pygments>=2.19.1",
|
|
74
|
-
"inflect>=7.5.0",
|
|
75
74
|
"tenacity>=9.0.0",
|
|
76
75
|
"lazyasd>=0.1.4",
|
|
77
76
|
"pathspec>=0.12.1",
|
|
@@ -86,6 +85,7 @@ dependencies = [
|
|
|
86
85
|
"markdownify>=0.13.1",
|
|
87
86
|
"justext>=3.0.2",
|
|
88
87
|
"cssselect>=1.2.0",
|
|
88
|
+
"pluralizer>=1.2.0",
|
|
89
89
|
# Minimal media handling:
|
|
90
90
|
"pydub>=0.25.1",
|
|
91
91
|
# audioop-lts is a backport of audioop for Python 3.13 and later needed for pydub.
|
|
@@ -102,9 +102,12 @@ dependencies = [
|
|
|
102
102
|
"mcp-proxy>=0.5.0",
|
|
103
103
|
]
|
|
104
104
|
|
|
105
|
+
# ---- Dev dependencies ----
|
|
106
|
+
|
|
105
107
|
[dependency-groups]
|
|
106
108
|
dev = [
|
|
107
109
|
"pytest>=8.3.5",
|
|
110
|
+
"pytest-sugar>=1.0.0",
|
|
108
111
|
"ruff>=0.11.0",
|
|
109
112
|
"codespell>=2.4.1",
|
|
110
113
|
"rich>=14.0.0",
|
|
@@ -154,8 +157,8 @@ packages = ["src/kash"]
|
|
|
154
157
|
line-length = 100
|
|
155
158
|
|
|
156
159
|
[tool.ruff.lint]
|
|
157
|
-
# See: https://docs.astral.sh/ruff/rules/
|
|
158
160
|
select = [
|
|
161
|
+
# See: https://docs.astral.sh/ruff/rules/
|
|
159
162
|
# Basic list from: https://docs.astral.sh/ruff/linter/#rule-selection
|
|
160
163
|
"E", # https://docs.astral.sh/ruff/rules/#error-e
|
|
161
164
|
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
|
|
@@ -170,6 +173,7 @@ select = [
|
|
|
170
173
|
|
|
171
174
|
]
|
|
172
175
|
ignore = [
|
|
176
|
+
# Disable some rules that are overly pedantic. Add/remove as desired:
|
|
173
177
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
|
|
174
178
|
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file/
|
|
175
179
|
"E731", # https://docs.astral.sh/ruff/rules/lambda-assignment/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from kash.config.logger import get_logger
|
|
2
2
|
from kash.exec import kash_action
|
|
3
|
-
from kash.exec.preconditions import has_html_body,
|
|
3
|
+
from kash.exec.preconditions import has_html_body, is_url_resource
|
|
4
4
|
from kash.model import Format, Item
|
|
5
5
|
from kash.model.params_model import common_params
|
|
6
|
+
from kash.utils.text_handling.markdownify_utils import markdownify_custom
|
|
6
7
|
from kash.web_content.file_cache_utils import get_url_html
|
|
7
8
|
from kash.web_content.web_extract_readabilipy import extract_text_readabilipy
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ log = get_logger(__name__)
|
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
@kash_action(
|
|
13
|
-
precondition=
|
|
14
|
+
precondition=is_url_resource | has_html_body,
|
|
14
15
|
params=common_params("refetch"),
|
|
15
16
|
mcp_tool=True,
|
|
16
17
|
)
|
|
@@ -19,12 +20,12 @@ def markdownify(item: Item, refetch: bool = False) -> Item:
|
|
|
19
20
|
Converts a URL or raw HTML item to Markdown, fetching with the content
|
|
20
21
|
cache if needed. Also uses readability to clean up the HTML.
|
|
21
22
|
"""
|
|
22
|
-
from markdownify import markdownify as markdownify_convert
|
|
23
23
|
|
|
24
24
|
expiration_sec = 0 if refetch else None
|
|
25
25
|
url, html_content = get_url_html(item, expiration_sec=expiration_sec)
|
|
26
26
|
page_data = extract_text_readabilipy(url, html_content)
|
|
27
|
-
|
|
27
|
+
assert page_data.clean_html
|
|
28
|
+
markdown_content = markdownify_custom(page_data.clean_html)
|
|
28
29
|
|
|
29
30
|
output_item = item.derived_copy(format=Format.markdown, body=markdown_content)
|
|
30
31
|
return output_item
|
|
@@ -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 has_html_body,
|
|
3
|
+
from kash.exec.preconditions import has_html_body, is_url_resource
|
|
4
4
|
from kash.model import Format, Item
|
|
5
5
|
from kash.model.params_model import common_params
|
|
6
6
|
from kash.web_content.file_cache_utils import get_url_html
|
|
@@ -10,7 +10,7 @@ log = get_logger(__name__)
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@kash_action(
|
|
13
|
-
precondition=
|
|
13
|
+
precondition=is_url_resource | has_html_body,
|
|
14
14
|
params=common_params("refetch"),
|
|
15
15
|
mcp_tool=True,
|
|
16
16
|
)
|
|
@@ -20,8 +20,8 @@ def readability(item: Item, refetch: bool = False) -> Item:
|
|
|
20
20
|
See `markdownify` to also convert to Markdown.
|
|
21
21
|
"""
|
|
22
22
|
expiration_sec = 0 if refetch else None
|
|
23
|
-
|
|
24
|
-
page_data = extract_text_readabilipy(
|
|
23
|
+
locator, html_content = get_url_html(item, expiration_sec=expiration_sec)
|
|
24
|
+
page_data = extract_text_readabilipy(locator, html_content)
|
|
25
25
|
|
|
26
26
|
output_item = item.derived_copy(format=Format.html, body=page_data.clean_html)
|
|
27
27
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from kash.actions.core.tabbed_webpage_config import tabbed_webpage_config
|
|
2
2
|
from kash.actions.core.tabbed_webpage_generate import tabbed_webpage_generate
|
|
3
3
|
from kash.exec import kash_action
|
|
4
|
-
from kash.exec.preconditions import has_full_html_page_body,
|
|
4
|
+
from kash.exec.preconditions import has_full_html_page_body, has_html_body, has_simple_text_body
|
|
5
5
|
from kash.exec_model.args_model import ONE_OR_MORE_ARGS
|
|
6
6
|
from kash.model import ActionInput, ActionResult, Param
|
|
7
7
|
from kash.model.items_model import ItemType
|
|
@@ -11,10 +11,10 @@ from kash.web_gen.simple_webpage import simple_webpage_render
|
|
|
11
11
|
|
|
12
12
|
@kash_action(
|
|
13
13
|
expected_args=ONE_OR_MORE_ARGS,
|
|
14
|
-
precondition=(
|
|
15
|
-
params=(Param("
|
|
14
|
+
precondition=(has_html_body | has_simple_text_body) & ~has_full_html_page_body,
|
|
15
|
+
params=(Param("no_title", "Don't add a title to the page body.", type=bool),),
|
|
16
16
|
)
|
|
17
|
-
def render_as_html(input: ActionInput,
|
|
17
|
+
def render_as_html(input: ActionInput, no_title: bool = False) -> ActionResult:
|
|
18
18
|
"""
|
|
19
19
|
Convert text, Markdown, or HTML to pretty, formatted HTML using a clean
|
|
20
20
|
and simple page template. Supports GFM-flavored Markdown tables and footnotes.
|
|
@@ -27,11 +27,13 @@ def render_as_html(input: ActionInput, add_title: bool = False) -> ActionResult:
|
|
|
27
27
|
"""
|
|
28
28
|
if len(input.items) == 1:
|
|
29
29
|
input_item = input.items[0]
|
|
30
|
-
html_body = simple_webpage_render(input_item, add_title_h1=
|
|
30
|
+
html_body = simple_webpage_render(input_item, add_title_h1=not no_title)
|
|
31
31
|
result_item = input_item.derived_copy(
|
|
32
32
|
type=ItemType.export, format=Format.html, body=html_body
|
|
33
33
|
)
|
|
34
34
|
return ActionResult([result_item])
|
|
35
35
|
else:
|
|
36
36
|
config_result = tabbed_webpage_config(input)
|
|
37
|
-
return tabbed_webpage_generate(
|
|
37
|
+
return tabbed_webpage_generate(
|
|
38
|
+
ActionInput(items=config_result.items), add_title=not no_title
|
|
39
|
+
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from kash.actions.core.render_as_html import render_as_html
|
|
2
2
|
from kash.commands.base.show_command import show
|
|
3
3
|
from kash.exec import kash_action
|
|
4
|
-
from kash.exec.preconditions import has_full_html_page_body,
|
|
4
|
+
from kash.exec.preconditions import has_full_html_page_body, has_html_body, has_simple_text_body
|
|
5
5
|
from kash.exec_model.args_model import ONE_OR_MORE_ARGS
|
|
6
6
|
from kash.exec_model.commands_model import Command
|
|
7
7
|
from kash.exec_model.shell_model import ShellResult
|
|
@@ -10,7 +10,7 @@ from kash.model import ActionInput, ActionResult
|
|
|
10
10
|
|
|
11
11
|
@kash_action(
|
|
12
12
|
expected_args=ONE_OR_MORE_ARGS,
|
|
13
|
-
precondition=(
|
|
13
|
+
precondition=(has_html_body | has_simple_text_body) & ~has_full_html_page_body,
|
|
14
14
|
)
|
|
15
15
|
def show_webpage(input: ActionInput) -> ActionResult:
|
|
16
16
|
"""
|
|
@@ -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 has_html_body,
|
|
3
|
+
from kash.exec.preconditions import has_html_body, has_simple_text_body
|
|
4
4
|
from kash.model import Format, Item
|
|
5
5
|
from kash.utils.common.format_utils import html_to_plaintext
|
|
6
6
|
from kash.utils.errors import InvalidInput
|
|
@@ -8,7 +8,7 @@ from kash.utils.errors import InvalidInput
|
|
|
8
8
|
log = get_logger(__name__)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
@kash_action(precondition=has_html_body |
|
|
11
|
+
@kash_action(precondition=has_html_body | has_simple_text_body)
|
|
12
12
|
def strip_html(item: Item) -> Item:
|
|
13
13
|
"""
|
|
14
14
|
Strip HTML tags from HTML or Markdown. This is a simple filter, simply searching
|
|
@@ -2,7 +2,7 @@ import os
|
|
|
2
2
|
|
|
3
3
|
from frontmatter_format import fmf_read_raw, fmf_strip_frontmatter
|
|
4
4
|
from prettyfmt import fmt_lines
|
|
5
|
-
from strif import copyfile_atomic
|
|
5
|
+
from strif import atomic_output_file, copyfile_atomic
|
|
6
6
|
|
|
7
7
|
from kash.config.logger import get_logger
|
|
8
8
|
from kash.config.text_styles import STYLE_EMPH
|
|
@@ -28,10 +28,10 @@ log = get_logger(__name__)
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
@kash_command
|
|
31
|
-
def
|
|
31
|
+
def clipboard_copy(path: str | None = None, raw: bool = False) -> None:
|
|
32
32
|
"""
|
|
33
33
|
Copy the contents of a file (or the first file in the selection) to the OS-native
|
|
34
|
-
clipboard.
|
|
34
|
+
clipboard. Similar to `pbcopy` on macOS.
|
|
35
35
|
|
|
36
36
|
:param raw: Copy the full exact contents of the file. Otherwise frontmatter is omitted.
|
|
37
37
|
"""
|
|
@@ -39,6 +39,8 @@ def cbcopy(path: str | None = None, raw: bool = False) -> None:
|
|
|
39
39
|
import pyperclip
|
|
40
40
|
|
|
41
41
|
input_paths = assemble_path_args(path)
|
|
42
|
+
if not input_paths:
|
|
43
|
+
raise InvalidInput("No path provided")
|
|
42
44
|
input_path = input_paths[0]
|
|
43
45
|
|
|
44
46
|
format = detect_file_format(input_path)
|
|
@@ -69,6 +71,25 @@ def cbcopy(path: str | None = None, raw: bool = False) -> None:
|
|
|
69
71
|
)
|
|
70
72
|
|
|
71
73
|
|
|
74
|
+
@kash_command
|
|
75
|
+
def clipboard_paste(path: str = "untitled_paste.txt") -> None:
|
|
76
|
+
"""
|
|
77
|
+
Paste the contents of the OS-native clipboard into a new file.
|
|
78
|
+
"""
|
|
79
|
+
# TODO: Get this to work for images!
|
|
80
|
+
# And can we convert rich text to Markdown?
|
|
81
|
+
import pyperclip
|
|
82
|
+
|
|
83
|
+
contents = pyperclip.paste()
|
|
84
|
+
if not contents.strip():
|
|
85
|
+
raise InvalidInput("Clipboard is empty")
|
|
86
|
+
|
|
87
|
+
with atomic_output_file(path, backup_suffix=".{timestamp}.bak") as f:
|
|
88
|
+
f.write_text(contents)
|
|
89
|
+
|
|
90
|
+
print_status("Pasted clipboard contents to:\n%s", fmt_lines([fmt_loc(path)]))
|
|
91
|
+
|
|
92
|
+
|
|
72
93
|
@kash_command
|
|
73
94
|
def edit(path: str | None = None, all: bool = False) -> None:
|
|
74
95
|
"""
|
|
@@ -5,16 +5,51 @@ from kash.commands.workspace.selection_commands import select
|
|
|
5
5
|
from kash.config.logger import get_logger
|
|
6
6
|
from kash.exec import import_locator_args, kash_command
|
|
7
7
|
from kash.exec_model.shell_model import ShellResult
|
|
8
|
-
from kash.model.items_model import Item, ItemType
|
|
8
|
+
from kash.model.items_model import Item, ItemRelations, ItemType
|
|
9
|
+
from kash.model.paths_model import StorePath
|
|
9
10
|
from kash.shell.output.shell_output import Wrap, cprint
|
|
10
|
-
from kash.
|
|
11
|
-
from kash.utils.errors import InvalidInput, InvalidOperation
|
|
11
|
+
from kash.utils.errors import ContentError, InvalidInput, InvalidOperation
|
|
12
12
|
from kash.utils.file_utils.file_formats_model import Format
|
|
13
|
+
from kash.utils.text_handling.unified_diffs import unified_diff, unified_diff_files
|
|
13
14
|
from kash.workspaces import current_ws
|
|
14
15
|
|
|
15
16
|
log = get_logger(__name__)
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
def unified_diff_items(from_item: Item, to_item: Item, strict: bool = True) -> Item:
|
|
20
|
+
"""
|
|
21
|
+
Generate a unified diff between two items. If `strict` is true, will raise
|
|
22
|
+
an error if the items are of different formats.
|
|
23
|
+
"""
|
|
24
|
+
if not from_item.body and not to_item.body:
|
|
25
|
+
raise ContentError(f"No body to diff for {from_item} and {to_item}")
|
|
26
|
+
if not from_item.store_path or not to_item.store_path:
|
|
27
|
+
raise ContentError("No store path on items; save before diffing")
|
|
28
|
+
diff_items = [item for item in [from_item, to_item] if item.format == Format.diff]
|
|
29
|
+
if len(diff_items) == 1:
|
|
30
|
+
raise ContentError(
|
|
31
|
+
f"Cannot compare diffs to non-diffs: {from_item.format}, {to_item.format}"
|
|
32
|
+
)
|
|
33
|
+
if len(diff_items) > 0 or from_item.format != to_item.format:
|
|
34
|
+
msg = f"Diffing items of incompatible format: {from_item.format}, {to_item.format}"
|
|
35
|
+
if strict:
|
|
36
|
+
raise ContentError(msg)
|
|
37
|
+
else:
|
|
38
|
+
log.warning("%s", msg)
|
|
39
|
+
|
|
40
|
+
from_path, to_path = StorePath(from_item.store_path), StorePath(to_item.store_path)
|
|
41
|
+
|
|
42
|
+
diff = unified_diff(from_item.body, to_item.body, str(from_path), str(to_path))
|
|
43
|
+
|
|
44
|
+
return Item(
|
|
45
|
+
type=ItemType.doc,
|
|
46
|
+
title=f"Diff of {from_path} and {to_path}",
|
|
47
|
+
format=Format.diff,
|
|
48
|
+
relations=ItemRelations(diff_of=[from_path, to_path]),
|
|
49
|
+
body=diff.patch_text,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
18
53
|
@kash_command
|
|
19
54
|
def diff_items(*paths: str, force: bool = False) -> ShellResult:
|
|
20
55
|
"""
|
|
@@ -75,7 +75,8 @@ def _print_listing_tallies(
|
|
|
75
75
|
cprint("(use --no_max to remove cutoff)", style=STYLE_HINT)
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
DEFAULT_MAX_PER_GROUP = 50
|
|
79
|
+
"""Default maximum number of files to display per group."""
|
|
79
80
|
|
|
80
81
|
|
|
81
82
|
@kash_command
|
|
@@ -301,13 +302,13 @@ def files(
|
|
|
301
302
|
# there are lots of groups and lots of files per group.
|
|
302
303
|
# Default is max 100 per group but if we have 4 * 100 items, cut to 25.
|
|
303
304
|
# If we have 2 * 100 items, cut to 50.
|
|
304
|
-
final_max_pg =
|
|
305
|
+
final_max_pg = DEFAULT_MAX_PER_GROUP if cap_per_group else max_per_group
|
|
305
306
|
max_pg_explicit = max_per_group > 0
|
|
306
307
|
if not max_pg_explicit:
|
|
307
308
|
group_lens = [len(group_df) for group_df in grouped]
|
|
308
309
|
for ratio in [2, 4]:
|
|
309
|
-
if sum(group_lens) > ratio *
|
|
310
|
-
final_max_pg = int(
|
|
310
|
+
if sum(group_lens) > ratio * DEFAULT_MAX_PER_GROUP:
|
|
311
|
+
final_max_pg = int(DEFAULT_MAX_PER_GROUP / ratio)
|
|
311
312
|
|
|
312
313
|
total_displayed = 0
|
|
313
314
|
total_displayed_size = 0
|
|
@@ -8,9 +8,9 @@ from kash.config.logger import get_logger
|
|
|
8
8
|
from kash.exec import assemble_path_args, kash_command, resolvable_paths
|
|
9
9
|
from kash.exec_model.shell_model import ShellResult
|
|
10
10
|
from kash.shell.output.shell_output import print_status
|
|
11
|
-
from kash.text_handling.doc_normalization import normalize_text_file
|
|
12
11
|
from kash.utils.common.format_utils import fmt_loc
|
|
13
12
|
from kash.utils.file_utils.filename_parsing import join_filename, split_filename
|
|
13
|
+
from kash.utils.text_handling.doc_normalization import normalize_text_file
|
|
14
14
|
|
|
15
15
|
log = get_logger(__name__)
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ def show(
|
|
|
54
54
|
item = ws.load(input_path)
|
|
55
55
|
if thumbnail and item.thumbnail_url:
|
|
56
56
|
try:
|
|
57
|
-
local_path
|
|
57
|
+
local_path = cache_file(item.thumbnail_url).content.path
|
|
58
58
|
terminal_show_image(local_path)
|
|
59
59
|
except Exception as e:
|
|
60
60
|
log.info("Had trouble showing thumbnail image (will skip): %s", e)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import subprocess
|
|
2
4
|
import tomllib
|
|
3
5
|
from pathlib import Path
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
4
7
|
|
|
5
|
-
import pandas as pd
|
|
6
8
|
from packaging.tags import Tag, sys_tags
|
|
7
9
|
from packaging.utils import parse_wheel_filename
|
|
8
10
|
from prettyfmt import fmt_size_dual
|
|
@@ -13,6 +15,9 @@ from kash.config.text_styles import COLOR_STATUS
|
|
|
13
15
|
from kash.exec import kash_command
|
|
14
16
|
from kash.shell.output.shell_output import cprint
|
|
15
17
|
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from pandas import DataFrame
|
|
20
|
+
|
|
16
21
|
log = get_logger(__name__)
|
|
17
22
|
|
|
18
23
|
|
|
@@ -49,13 +54,15 @@ def get_platform() -> str:
|
|
|
49
54
|
return next(sys_tags()).platform
|
|
50
55
|
|
|
51
56
|
|
|
52
|
-
def parse_uv_lock(lock_path: Path) ->
|
|
57
|
+
def parse_uv_lock(lock_path: Path) -> DataFrame:
|
|
53
58
|
"""
|
|
54
59
|
Return one row per package from a uv.lock file, selecting the best
|
|
55
60
|
matching wheel for the current interpreter or falling back to the sdist.
|
|
56
61
|
|
|
57
62
|
Columns: name, version, registry, file_type, url, hash, size, filename.
|
|
58
63
|
"""
|
|
64
|
+
from pandas import DataFrame
|
|
65
|
+
|
|
59
66
|
with open(lock_path, "rb") as f:
|
|
60
67
|
data = tomllib.load(f)
|
|
61
68
|
|
|
@@ -88,7 +95,7 @@ def parse_uv_lock(lock_path: Path) -> pd.DataFrame:
|
|
|
88
95
|
}
|
|
89
96
|
)
|
|
90
97
|
|
|
91
|
-
return
|
|
98
|
+
return DataFrame(rows)
|
|
92
99
|
|
|
93
100
|
|
|
94
101
|
def uv_runtime_packages(
|
|
@@ -141,6 +148,8 @@ def uv_dep_info(
|
|
|
141
148
|
By default, filters to show only 'main' dependencies from pyproject.toml.
|
|
142
149
|
Helpful for looking at sizes of dependencies.
|
|
143
150
|
"""
|
|
151
|
+
import pandas as pd
|
|
152
|
+
|
|
144
153
|
uv_lock_path = Path(uv_lock)
|
|
145
154
|
pyproject_path = Path(pyproject)
|
|
146
155
|
|
|
@@ -2,6 +2,7 @@ from os.path import basename
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
from frontmatter_format import fmf_strip_frontmatter
|
|
5
|
+
from prettyfmt import plural
|
|
5
6
|
from strif import copyfile_atomic
|
|
6
7
|
|
|
7
8
|
from kash.config.logger import get_logger
|
|
@@ -11,7 +12,6 @@ from kash.model.paths_model import StorePath
|
|
|
11
12
|
from kash.shell.ui.shell_results import shell_print_selection_history
|
|
12
13
|
from kash.utils.common.format_utils import fmt_loc
|
|
13
14
|
from kash.utils.errors import InvalidInput
|
|
14
|
-
from kash.utils.lang_utils.inflection import plural
|
|
15
15
|
from kash.workspaces import Selection, current_ws
|
|
16
16
|
|
|
17
17
|
log = get_logger(__name__)
|