kash-shell 0.3.20__tar.gz → 0.3.22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.copier-answers.yml +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.cursor/rules/general.mdc +18 -13
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.cursor/rules/python.mdc +52 -12
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.github/workflows/ci.yml +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.github/workflows/publish.yml +4 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/Makefile +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/PKG-INFO +3 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/development.md +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/pyproject.toml +4 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/markdownify_html.py +11 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/tabbed_webpage_generate.py +2 -2
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/help/assistant_commands.py +2 -4
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/help/logo.py +12 -17
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/help/welcome.py +5 -4
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/colors.py +8 -6
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/text_styles.py +2 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/b1_kash_overview.md +34 -45
- kash_shell-0.3.22/src/kash/docs/markdown/warning.md +3 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/welcome.md +2 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/action_decorators.py +20 -5
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/fetch_url_items.py +6 -4
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/llm_transforms.py +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/preconditions.py +7 -2
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/shell_callable_action.py +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/llm_completion.py +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/actions_model.py +6 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/items_model.py +14 -11
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/output/shell_output.py +20 -1
- kash_shell-0.3.22/src/kash/utils/api_utils/api_retries.py +305 -0
- kash_shell-0.3.22/src/kash/utils/api_utils/cache_requests_limited.py +84 -0
- kash_shell-0.3.22/src/kash/utils/api_utils/gather_limited.py +987 -0
- kash_shell-0.3.22/src/kash/utils/api_utils/progress_protocol.py +299 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/function_inspect.py +66 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/testing.py +10 -7
- kash_shell-0.3.22/src/kash/utils/rich_custom/multitask_status.py +631 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/text_handling/escape_html_tags.py +16 -11
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/text_handling/markdown_render.py +1 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/text_handling/markdown_utils.py +158 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/tabbed_webpage.py +2 -2
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/base_styles.css.jinja +26 -20
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/components/toc_styles.css.jinja +1 -1
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/components/tooltip_scripts.js.jinja +171 -19
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/components/tooltip_styles.css.jinja +23 -8
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/load_into_xonsh.py +0 -3
- kash_shell-0.3.22/tests/kash/utils/rich_custom/test_multitask_status.py +564 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/uv.lock +269 -269
- kash_shell-0.3.20/src/kash/docs/markdown/warning.md +0 -3
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.env.template +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/.gitignore +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/LICENSE +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/README.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/devtools/generate_readme.xsh +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/devtools/lint.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/devtools/profile_main.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/installation.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/publishing.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/__main__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/assistant_chat.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/chat.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/format_markdown_template.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/minify_html.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/readability.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/render_as_html.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/show_webpage.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/strip_html.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/summarize_as_bullets.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/core/tabbed_webpage_config.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/meta/write_instructions.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/actions/meta/write_new_action.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/basic_file_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/browser_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/debug_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/diff_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/files_command.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/general_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/logs_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/model_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/reformat_command.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/search_command.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/base/show_command.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/extras/parse_uv_lock.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/extras/utils_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/help/doc_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/help/help_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/workspace/selection_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/commands/workspace/workspace_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/capture_output.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/env_settings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/init.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/lazy_imports.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/logger.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/logger_basic.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/logo.txt +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/server_config.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/settings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/setup.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/config/suppress_warnings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/all_docs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/load_actions_info.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/load_api_docs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/load_help_topics.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/load_source_code.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/api_docs_template.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/assistant_instructions_template.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/readme_template.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/a1_what_is_kash.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/a2_installation.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/a3_getting_started.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/a4_elements.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/a5_tips_for_use_with_other_tools.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/b0_philosophy_of_kash.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/b2_workspace_and_file_formats.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/b3_modern_shell_tool_recommendations.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs/markdown/topics/b4_faq.md +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/docs_base.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/load_custom_command_info.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/load_faqs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/load_recipe_snippets.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/recipes/general_system_commands.sh +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/recipes/python_dev_commands.sh +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/docs_base/recipes/tldr_standard_commands.sh +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/embeddings/cosine.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/embeddings/embeddings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/embeddings/text_similarity.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/action_exec.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/action_registry.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/combiners.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/command_exec.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/command_registry.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/history.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/importing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/precondition_checks.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/precondition_registry.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/resolve_args.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec/runtime_settings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec_model/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec_model/args_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec_model/commands_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec_model/script_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/exec_model/shell_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/file_store.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/item_file_format.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/metadata_dirs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/persisted_yaml.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/store_cache_warmer.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/file_storage/store_filenames.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/assistant.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/assistant_instructions.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/assistant_output.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/function_param_info.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/help_embeddings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/help_lookups.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/help_pages.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/help_printing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/help_types.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/recommended_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/help/tldr_help.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/clean_headings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/custom_sliding_transforms.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/fuzzy_parsing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/init_litellm.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/llm_api_keys.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/llm_features.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/llm_messages.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/llm_names.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/llm_utils/llms.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/local_server.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/local_server_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/local_server_routes.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/local_url_formatters.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/port_tools.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/local_server/rich_html_template.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/mcp_cli.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/mcp_main.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/mcp_server_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/mcp_server_routes.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/mcp_server_sse.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/mcp/mcp_server_stdio.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/audio_processing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/media_cache.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/media_services.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/media_tools.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/services/local_file_media.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/timestamp_citations.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/transcription_deepgram.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/transcription_format.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/media_base/transcription_whisper.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/assistant_response_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/compound_actions_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/concept_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/exec_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/graph_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/language_list.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/llm_actions_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/media_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/operations_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/params_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/paths_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/model/preconditions_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/completions/completion_scoring.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/completions/completion_types.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/completions/shell_completions.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/file_icons/color_for_format.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/file_icons/nerd_icons.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/input/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/input/input_prompts.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/input/inquirer_settings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/input/param_inputs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/input/shell_confirm.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/output/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/output/kerm_code_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/output/kerm_codes.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/output/kmarkdown.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/output/shell_formatting.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/shell_main.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/ui/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/ui/shell_results.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/ui/shell_syntax.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/utils/exception_printing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/utils/native_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/utils/shell_function_wrapper.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/shell/version.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/format_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/import_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/lazyobject.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/obj_replace.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/parse_docstring.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/parse_key_vals.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/parse_shell_args.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/stack_traces.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/task_stack.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/type_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/uniquifier.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/url.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/common/url_slice.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/errors.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_formats/chat_format.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/dir_info.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/file_ext.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/file_formats.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/file_formats_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/file_sort_filter.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/file_walk.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/filename_parsing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/ignore_files.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/mtime_cache.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/file_utils/path_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/lang_utils/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/lang_utils/capitalization.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/rich_custom/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/rich_custom/ansi_cell_len.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/rich_custom/rich_char_transform.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/rich_custom/rich_indent.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/rich_custom/rich_markdown_fork.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/text_handling/doc_normalization.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/text_handling/markdownify_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/utils/text_handling/unified_diffs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/canon_url.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/dir_store.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/file_cache_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/file_processing.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/local_file_cache.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/web_extract.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/web_extract_justext.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/web_extract_readabilipy.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/web_fetch.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_content/web_page_model.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/simple_webpage.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/template_render.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/base_webpage.html.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/components/toc_scripts.js.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/content_styles.css.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/explain_view.html.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/item_view.html.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/simple_webpage.html.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/web_gen/templates/tabbed_webpage.html.jinja +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/__init__.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/param_state.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/selections.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/source_items.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/workspace_dirs.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/workspace_output.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/workspace_registry.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/workspaces/workspaces.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/command_nl_utils.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/custom_shell.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/customize_prompt.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/shell_load_commands.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/shell_which.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/xonsh_completers.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/xonsh_env.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/xonsh_keybindings.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/xonsh_modern_tools.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xonsh_custom/xonsh_ranking_completer.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xontrib/fnm.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/src/kash/xontrib/kash_extension.py +0 -0
- {kash_shell-0.3.20 → kash_shell-0.3.22}/tests/test_shell.py +0 -0
|
@@ -3,11 +3,14 @@ description: General Guidelines
|
|
|
3
3
|
globs:
|
|
4
4
|
alwaysApply: true
|
|
5
5
|
---
|
|
6
|
-
#
|
|
6
|
+
# Assistant Rules
|
|
7
7
|
|
|
8
|
-
Remember you are a senior engineer and have a
|
|
9
|
-
factual, think step by step and be systematic,
|
|
10
|
-
the user's attention wisely.
|
|
8
|
+
**Your fundamental responsibility:** Remember you are a senior engineer and have a
|
|
9
|
+
serious responsibility to be clear, factual, think step by step and be systematic,
|
|
10
|
+
express expert opinion, and make use of the user's attention wisely.
|
|
11
|
+
|
|
12
|
+
**Rules must be followed:** It is your responsibility to carefully read these rules as
|
|
13
|
+
well as Python or other language-specific rules included here.
|
|
11
14
|
|
|
12
15
|
Therefore:
|
|
13
16
|
|
|
@@ -22,8 +25,8 @@ Therefore:
|
|
|
22
25
|
it. It's your responsibility to suggest approaches that lead to better, simpler
|
|
23
26
|
solutions.
|
|
24
27
|
|
|
25
|
-
- Give thoughtful opinions on better/worse approaches, but
|
|
26
|
-
or "good job" or other non-essential banter
|
|
28
|
+
- Give thoughtful opinions on better/worse approaches, but NEVER say "great idea!"
|
|
29
|
+
or "good job" or other compliments, encouragement, or non-essential banter.
|
|
27
30
|
Your job is to give expert opinions and to solve problems, not to motivate the user.
|
|
28
31
|
|
|
29
32
|
- Avoid gratuitous enthusiasm or generalizations.
|
|
@@ -50,18 +53,20 @@ Therefore:
|
|
|
50
53
|
this is meaningless to anyone reading the code later.
|
|
51
54
|
(Instead, describe in your message to the user any other contextual information.)
|
|
52
55
|
|
|
53
|
-
- DO NOT use fancy headings like "=====
|
|
56
|
+
- DO NOT use fancy or needlessly decorated headings like "===== MIGRATION TOOLS ====="
|
|
57
|
+
in comments
|
|
54
58
|
|
|
55
|
-
- DO NOT
|
|
59
|
+
- DO NOT number steps in comments.
|
|
56
60
|
These are hard to maintain if the code changes.
|
|
57
|
-
|
|
58
|
-
the cache"
|
|
59
|
-
|
|
60
|
-
## Using Emojis
|
|
61
|
+
NEVER DO THIS: "// Step 3: Fetch the data from the cache"\
|
|
62
|
+
This is fine: "// Now fetch the data from the cache"
|
|
61
63
|
|
|
62
64
|
- DO NOT use emojis or special unicode characters like ① or • or – or — in comments.
|
|
63
65
|
|
|
64
66
|
- Use emojis in output if it enhances the clarity and can be done consistently.
|
|
65
67
|
You may use ✔︎ and ✘ to indicate success and failure, and ∆ and ‼︎ for user-facing
|
|
66
68
|
warnings and errors, for example, but be sure to do it consistently.
|
|
67
|
-
|
|
69
|
+
DO NOT use emojis gratuitously in comments or output.
|
|
70
|
+
You may use then ONLY when they have clear meanings (like success or failure).
|
|
71
|
+
Unless the user says otherwise, avoid emojis and Unicode in comments as clutters the
|
|
72
|
+
output with little benefit.
|
|
@@ -90,18 +90,27 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
90
90
|
- Use strif's `atomic_output_file` context manager when writing files to ensure output
|
|
91
91
|
files are written atomically.
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
## Use Modern Python Practices
|
|
94
|
+
|
|
95
|
+
- ALWAYS use `@override` decorators to override methods from base classes.
|
|
96
|
+
This is a modern Python practice and helps avoid bugs.
|
|
94
97
|
|
|
95
98
|
## Testing
|
|
96
99
|
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
- For longer tests put them in a file like `tests/test_somename.py` in the `tests/`
|
|
101
|
+
directory (or `tests/module_name/test_somename.py` file for a submodule).
|
|
102
|
+
|
|
103
|
+
- For simple tests, prefer inline functions in the original code file below a `## Tests`
|
|
104
|
+
comment. This keeps the tests easy to maintain and close to the code.
|
|
105
|
+
Inline tests should NOT import pytest or pytest fixtures as we do not want runtime
|
|
106
|
+
dependency on pytest.
|
|
101
107
|
|
|
102
|
-
-
|
|
108
|
+
- DO NOT write one-off test code in extra files that are throwaway.
|
|
103
109
|
|
|
104
|
-
-
|
|
110
|
+
- DO NOT put `if __name__ == "__main__":` just for quick testing.
|
|
111
|
+
Instead use the inline function tests and run them with `uv run pytest`.
|
|
112
|
+
|
|
113
|
+
- You can run such individual tests with `uv run pytest -s src/.../path/to/test`
|
|
105
114
|
|
|
106
115
|
- Don't add docs to assertions unless it's not obvious what they're checking - the
|
|
107
116
|
assertion appears in the stack trace.
|
|
@@ -109,16 +118,19 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
109
118
|
x is 5`. That is redundant.
|
|
110
119
|
Just write `assert x == 5`.
|
|
111
120
|
|
|
121
|
+
- DO NOT write trivial or obvious tests that are evident directly from code, such as
|
|
122
|
+
assertions that confirm the value of a constant setting.
|
|
123
|
+
|
|
112
124
|
- NEVER write `assert False`. If a test reaches an unexpected branch and must fail
|
|
113
125
|
explicitly, `raise AssertionError("Explanation")` instead.
|
|
114
126
|
This is best typical best practice in Python since assertions can be removed with
|
|
115
127
|
optimization.
|
|
116
128
|
|
|
117
|
-
-
|
|
129
|
+
- DO NOT use pytest fixtures like parameterized tests or expected exception decorators
|
|
118
130
|
unless absolutely necessary in more complex tests.
|
|
119
|
-
It is
|
|
120
|
-
This is preferable because then
|
|
121
|
-
|
|
131
|
+
It is typically simpler to use simple assertions and put the checks inside the test.
|
|
132
|
+
This is also preferable because then simple tests have no explicit pytest dependencies
|
|
133
|
+
and can be placed in code anywhere.
|
|
122
134
|
|
|
123
135
|
## Types and Type Annotations
|
|
124
136
|
|
|
@@ -150,7 +162,7 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
150
162
|
binary = "binary"
|
|
151
163
|
```
|
|
152
164
|
|
|
153
|
-
## Guidelines for
|
|
165
|
+
## Guidelines for Literal Strings
|
|
154
166
|
|
|
155
167
|
- For multi-line strings NEVER put multi-line strings flush against the left margin.
|
|
156
168
|
ALWAYS use a `dedent()` function to make it more readable.
|
|
@@ -166,6 +178,22 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
166
178
|
""").strip()
|
|
167
179
|
```
|
|
168
180
|
|
|
181
|
+
## Guidelines for Comments
|
|
182
|
+
|
|
183
|
+
- Comments should be EXPLANATORY: Explain *WHY* something is done a certain way and not
|
|
184
|
+
just *what* is done.
|
|
185
|
+
|
|
186
|
+
- Comments should be CONCISE: Remove all extraneous words.
|
|
187
|
+
|
|
188
|
+
- DO NOT use comments to state obvious things or repeat what is evident from the code.
|
|
189
|
+
Here is an example of a comment that SHOULD BE REMOVED because it simply repeats the
|
|
190
|
+
code, which is distracting and adds no value:
|
|
191
|
+
```python
|
|
192
|
+
if self.failed == 0:
|
|
193
|
+
# All successful
|
|
194
|
+
return "All tasks finished successfully"
|
|
195
|
+
```
|
|
196
|
+
|
|
169
197
|
## Guidelines for Docstrings
|
|
170
198
|
|
|
171
199
|
- Here is an example of the correct style for docstrings:
|
|
@@ -233,3 +261,15 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
233
261
|
return self.paragraph.reassemble()
|
|
234
262
|
```
|
|
235
263
|
In general, the user can just call the enclosed objects methods, reducing code bloat.
|
|
264
|
+
|
|
265
|
+
- If a function does not use a parameter, but it should still be present, you can use `#
|
|
266
|
+
pyright: ignore[reportUnusedParameter]` in a comment to suppress the linter warning.
|
|
267
|
+
|
|
268
|
+
## Guidelines for Backward Compatibility
|
|
269
|
+
|
|
270
|
+
- When changing code in a library or general function, if a change to an API or library
|
|
271
|
+
will break backward compatibility, MENTION THIS to the user.
|
|
272
|
+
|
|
273
|
+
- DO NOT implement additional code for backward compatiblity (such as extra methods or
|
|
274
|
+
variable aliases or comments about backward compatibility) UNLESS the user has
|
|
275
|
+
confirmed that it is necessary.
|
|
@@ -33,7 +33,7 @@ jobs:
|
|
|
33
33
|
run: uv python install
|
|
34
34
|
|
|
35
35
|
- name: Install all dependencies
|
|
36
|
-
run: uv sync --all-extras
|
|
36
|
+
run: uv sync --all-extras
|
|
37
37
|
|
|
38
38
|
- name: Run tests
|
|
39
39
|
run: uv run pytest
|
|
@@ -45,3 +45,6 @@ jobs:
|
|
|
45
45
|
|
|
46
46
|
- name: Publish to PyPI
|
|
47
47
|
run: uv publish --trusted-publishing always
|
|
48
|
+
# Although uv is newer and faster, the "official" publishing option is the one from PyPA,
|
|
49
|
+
# which uses twine. If desired, replace `uv publish` with:
|
|
50
|
+
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kash-shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.22
|
|
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>
|
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Typing :: Typed
|
|
18
18
|
Requires-Python: <4.0,>=3.11
|
|
19
|
+
Requires-Dist: aiolimiter>=1.2.1
|
|
19
20
|
Requires-Dist: anyio>=4.8.0
|
|
20
21
|
Requires-Dist: audioop-lts>=0.2.1; python_version >= '3.13'
|
|
21
22
|
Requires-Dist: cachetools>=5.5.2
|
|
@@ -50,6 +51,7 @@ Requires-Dist: pydantic>=2.10.6
|
|
|
50
51
|
Requires-Dist: pydub>=0.25.1
|
|
51
52
|
Requires-Dist: pygments>=2.19.1
|
|
52
53
|
Requires-Dist: pyperclip>=1.9.0
|
|
54
|
+
Requires-Dist: pyrate-limiter>=3.7.0
|
|
53
55
|
Requires-Dist: python-dotenv>=1.0.1
|
|
54
56
|
Requires-Dist: python-magic-bin>=0.4.14; platform_system == 'Windows'
|
|
55
57
|
Requires-Dist: python-magic>=0.4.27; platform_system == 'Linux' or platform_system == 'Darwin'
|
|
@@ -17,7 +17,7 @@ The `Makefile` simply offers shortcuts to `uv` commands for developer convenienc
|
|
|
17
17
|
|
|
18
18
|
```shell
|
|
19
19
|
# First, install all dependencies and set up your virtual environment.
|
|
20
|
-
# This simply runs `uv sync --all-extras
|
|
20
|
+
# This simply runs `uv sync --all-extras` to install all packages,
|
|
21
21
|
# including dev dependencies and optional dependencies.
|
|
22
22
|
make install
|
|
23
23
|
|
|
@@ -77,10 +77,12 @@ dependencies = [
|
|
|
77
77
|
"pathspec>=0.12.1",
|
|
78
78
|
"patch-ng>=1.18.1",
|
|
79
79
|
"inquirerpy>=0.3.4",
|
|
80
|
-
# LLM essentials:
|
|
80
|
+
# LLM and API essentials:
|
|
81
81
|
"tiktoken>=0.9.0",
|
|
82
82
|
"openai>=1.66.3",
|
|
83
83
|
"litellm>=1.63.11",
|
|
84
|
+
"pyrate-limiter>=3.7.0",
|
|
85
|
+
"aiolimiter>=1.2.1",
|
|
84
86
|
# Basic text handling and web scraping:
|
|
85
87
|
"readabilipy>=0.3.0",
|
|
86
88
|
"markdownify>=0.13.1",
|
|
@@ -223,6 +225,7 @@ reportMissingParameterType = false
|
|
|
223
225
|
reportUnannotatedClassAttribute = false
|
|
224
226
|
reportUninitializedInstanceVariable = false
|
|
225
227
|
reportCallInDefaultInitializer = false
|
|
228
|
+
reportUntypedBaseClass = false
|
|
226
229
|
# Make ignoring easier:
|
|
227
230
|
reportIgnoreCommentWithoutRule = false
|
|
228
231
|
reportUnnecessaryTypeIgnoreComment = false
|
|
@@ -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())
|
|
@@ -139,14 +139,15 @@ web_light_translucent = SimpleNamespace(
|
|
|
139
139
|
bg_header=hsl_to_hex("hsla(188, 42%, 70%, 0.2)"),
|
|
140
140
|
bg_alt=hsl_to_hex("hsla(39, 24%, 90%, 0.3)"),
|
|
141
141
|
bg_alt_solid=hsl_to_hex("hsla(39, 24%, 97%, 1)"),
|
|
142
|
-
|
|
142
|
+
bg_meta_solid=hsl_to_hex("hsla(39, 24%, 94%, 1)"),
|
|
143
|
+
bg_selected=hsl_to_hex("hsla(188, 21%, 94%, 0.9)"),
|
|
143
144
|
text=hsl_to_hex("hsl(188, 39%, 11%)"),
|
|
144
145
|
code=hsl_to_hex("hsl(44, 38%, 23%)"),
|
|
145
146
|
border=hsl_to_hex("hsl(188, 8%, 50%)"),
|
|
146
147
|
border_hint=hsl_to_hex("hsla(188, 8%, 72%, 0.3)"),
|
|
147
148
|
border_accent=hsl_to_hex("hsla(305, 18%, 65%, 0.85)"),
|
|
148
149
|
hover=hsl_to_hex("hsl(188, 12%, 84%)"),
|
|
149
|
-
hover_bg=hsl_to_hex("hsla(188,
|
|
150
|
+
hover_bg=hsl_to_hex("hsla(188, 18%, 97%, 1)"),
|
|
150
151
|
hint=hsl_to_hex("hsl(188, 11%, 65%)"),
|
|
151
152
|
hint_strong=hsl_to_hex("hsl(188, 11%, 46%)"),
|
|
152
153
|
hint_gentle=hsl_to_hex("hsla(188, 11%, 65%, 0.2)"),
|
|
@@ -165,14 +166,15 @@ web_light_translucent = SimpleNamespace(
|
|
|
165
166
|
web_dark_translucent = SimpleNamespace(
|
|
166
167
|
primary=hsl_to_hex("hsl(188, 40%, 62%)"),
|
|
167
168
|
primary_light=hsl_to_hex("hsl(188, 50%, 72%)"),
|
|
168
|
-
secondary=hsl_to_hex("hsl(188, 12%,
|
|
169
|
-
tertiary=hsl_to_hex("hsl(188, 7%,
|
|
169
|
+
secondary=hsl_to_hex("hsl(188, 12%, 70%)"),
|
|
170
|
+
tertiary=hsl_to_hex("hsl(188, 7%, 45%)"),
|
|
170
171
|
bg=hsl_to_hex("hsla(220, 14%, 7%, 0.95)"),
|
|
171
172
|
bg_solid=hsl_to_hex("hsl(220, 14%, 7%)"),
|
|
172
173
|
bg_header=hsl_to_hex("hsla(188, 42%, 20%, 0.3)"),
|
|
173
174
|
bg_alt=hsl_to_hex("hsla(220, 14%, 12%, 0.5)"),
|
|
174
|
-
bg_alt_solid=hsl_to_hex("hsl(220,
|
|
175
|
-
|
|
175
|
+
bg_alt_solid=hsl_to_hex("hsl(220, 15%, 16%)"),
|
|
176
|
+
bg_meta_solid=hsl_to_hex("hsl(220, 14%, 25%)"),
|
|
177
|
+
bg_selected=hsl_to_hex("hsla(188, 13%, 33%, 0.95)"),
|
|
176
178
|
text=hsl_to_hex("hsl(188, 10%, 90%)"),
|
|
177
179
|
code=hsl_to_hex("hsl(44, 38%, 72%)"),
|
|
178
180
|
border=hsl_to_hex("hsl(188, 8%, 25%)"),
|
|
@@ -165,48 +165,37 @@ works on readable text such as Markdown.
|
|
|
165
165
|
This catches errors and allows you to find actions that might apply to a given selected
|
|
166
166
|
set of items using `suggest_actions`.
|
|
167
167
|
|
|
168
|
-
### Programmatic
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
Kash
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
doc into an edited document, such as pulling timestamps from a full transcript back
|
|
203
|
-
into an edited transcript or summary.
|
|
204
|
-
|
|
205
|
-
- Paragraph and sentence operations: A lot of operations within actions should be done
|
|
206
|
-
in chunks at the paragraph or sentence level.
|
|
207
|
-
Kash offers simple tools to subdivide documents into paragraphs and sentences and
|
|
208
|
-
these can be used together with sliding windows to process large documents.
|
|
209
|
-
|
|
210
|
-
In addition, there are built-in kash commands that are part of the kash tool itself.
|
|
211
|
-
These allow you to list items in the workspace, see or change the current selection,
|
|
212
|
-
archive items, view logs, etc.
|
|
168
|
+
### Programmatic Usage
|
|
169
|
+
|
|
170
|
+
Kash can be used entirely programmatically, so that actions are called just like
|
|
171
|
+
functions from Python, but the additional functionality of the items model, saving files
|
|
172
|
+
to a workspace, and so on, are all automatic.
|
|
173
|
+
|
|
174
|
+
This means you can use Kash to build your own CLI apps much more quickly.
|
|
175
|
+
|
|
176
|
+
For an example of this, see [textpress](https://github.com/jlevy/textpress), which wraps
|
|
177
|
+
quite a few kash actions to allow clean publishing of docx or PDF files on
|
|
178
|
+
[textpress.md](https://textpress.md/).
|
|
179
|
+
|
|
180
|
+
### Utilities and Supporting Libraries
|
|
181
|
+
|
|
182
|
+
Kash includes a number of utility libraries to help with common tasks, either in the
|
|
183
|
+
base `kash-shell` package or or smaller dependencies:
|
|
184
|
+
|
|
185
|
+
- See [frontmatter-format](https://github.com/jlevy/frontmatter-format) for the spec and
|
|
186
|
+
implementation we use of frontmatter YAML format.
|
|
187
|
+
|
|
188
|
+
- See
|
|
189
|
+
[utils/file_utils](https://github.com/jlevy/kash/tree/main/src/kash/utils/file_utils)
|
|
190
|
+
for file format detection, conversion, filename handling, etc.
|
|
191
|
+
|
|
192
|
+
- See [chopdiff](https://github.com/jlevy/chopdiff) for a simple text doc data model
|
|
193
|
+
that includes sentences and paragraphs and fairly advanced diffing, filtered diffing,
|
|
194
|
+
and windowed transformations of text via LLM calls.
|
|
195
|
+
|
|
196
|
+
- See [clideps](https://github.com/jlevy/clideps) for utilities for helping with dot-env
|
|
197
|
+
files, API key setup, and dependency checks.
|
|
198
|
+
|
|
199
|
+
- See [utils/common](https://github.com/jlevy/kash/tree/main/src/kash/utils/common) the
|
|
200
|
+
rest of [utils/](https://github.com/jlevy/kash/tree/main/src/kash/utils) for a variety
|
|
201
|
+
of other general utilities.
|
|
@@ -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.
|
|
@@ -105,7 +105,10 @@ def kash_action_class(cls: type[A]) -> type[A]:
|
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
def _register_dynamic_action(
|
|
108
|
-
action_cls: type[A],
|
|
108
|
+
action_cls: type[A],
|
|
109
|
+
action_name: str,
|
|
110
|
+
action_description: str,
|
|
111
|
+
source_path: Path | None,
|
|
109
112
|
) -> type[A]:
|
|
110
113
|
# Set class fields for name and description for convenience.
|
|
111
114
|
action_cls.name = action_name
|
|
@@ -206,6 +209,7 @@ def kash_action(
|
|
|
206
209
|
run_per_item: bool | None = None,
|
|
207
210
|
uses_selection: bool = True,
|
|
208
211
|
interactive_input: bool = False,
|
|
212
|
+
live_output: bool = False,
|
|
209
213
|
mcp_tool: bool = False,
|
|
210
214
|
title_template: TitleTemplate = TitleTemplate("{title}"),
|
|
211
215
|
llm_options: LLMOptions = LLMOptions(),
|
|
@@ -235,13 +239,17 @@ def kash_action(
|
|
|
235
239
|
def decorator(orig_func: AF) -> AF:
|
|
236
240
|
if hasattr(orig_func, "__action_class__"):
|
|
237
241
|
log.warning(
|
|
238
|
-
"Function `%s` is already decorated with `@kash_action`",
|
|
242
|
+
"Function `%s` is already decorated with `@kash_action`",
|
|
243
|
+
orig_func.__name__,
|
|
239
244
|
)
|
|
240
245
|
return orig_func
|
|
241
246
|
|
|
242
247
|
# Inspect and sanity check the formal params.
|
|
243
248
|
func_params = inspect_function_params(orig_func)
|
|
244
|
-
if len(func_params) == 0 or func_params[0].effective_type not in (
|
|
249
|
+
if len(func_params) == 0 or func_params[0].effective_type not in (
|
|
250
|
+
ActionInput,
|
|
251
|
+
Item,
|
|
252
|
+
):
|
|
245
253
|
raise InvalidDefinition(
|
|
246
254
|
f"Decorator `@kash_action` requires exactly one positional parameter, "
|
|
247
255
|
f"`input` of type `ActionInput` or `Item` on function `{orig_func.__name__}` but "
|
|
@@ -311,6 +319,7 @@ def kash_action(
|
|
|
311
319
|
self.uses_selection = uses_selection
|
|
312
320
|
self.output_type = output_type
|
|
313
321
|
self.interactive_input = interactive_input
|
|
322
|
+
self.live_output = live_output
|
|
314
323
|
self.mcp_tool = mcp_tool
|
|
315
324
|
self.title_template = title_template
|
|
316
325
|
self.llm_options = llm_options
|
|
@@ -332,8 +341,14 @@ def kash_action(
|
|
|
332
341
|
kw_args[fp.name] = self.get_param(fp.name)
|
|
333
342
|
|
|
334
343
|
if self.params:
|
|
335
|
-
log.info(
|
|
336
|
-
|
|
344
|
+
log.info(
|
|
345
|
+
"Action function param declarations:\n%s",
|
|
346
|
+
fmt_lines(self.params),
|
|
347
|
+
)
|
|
348
|
+
log.info(
|
|
349
|
+
"Action function param values:\n%s",
|
|
350
|
+
self.param_value_summary_str(),
|
|
351
|
+
)
|
|
337
352
|
else:
|
|
338
353
|
log.info("Action function has no declared params")
|
|
339
354
|
|