kash-shell 0.3.34__tar.gz → 0.3.36__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.34 → kash_shell-0.3.36}/.copier-answers.yml +1 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/.cursor/rules/general.mdc +11 -11
- {kash_shell-0.3.34 → kash_shell-0.3.36}/.cursor/rules/python.mdc +23 -8
- {kash_shell-0.3.34 → kash_shell-0.3.36}/.github/workflows/ci.yml +1 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/.github/workflows/publish.yml +1 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/PKG-INFO +2 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/pyproject.toml +2 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/env_settings.py +0 -3
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/logger.py +2 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/logger_basic.py +10 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/settings.py +0 -12
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/setup.py +15 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/text_styles.py +1 -1
- kash_shell-0.3.36/src/kash/config/warm_slow_imports.py +60 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/action_decorators.py +2 -2
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/action_exec.py +1 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/fetch_url_items.py +4 -2
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/llm_transforms.py +4 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/file_store.py +4 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/llm_completion.py +115 -19
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/llms.py +8 -7
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/mcp_cli.py +17 -5
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/mcp_server_routes.py +6 -4
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/actions_model.py +17 -5
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/items_model.py +24 -12
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/params_model.py +4 -4
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/shell_main.py +3 -14
- kash_shell-0.3.36/src/kash/utils/common/import_utils.py +250 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/s3_utils.py +89 -7
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/web_extract.py +0 -1
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/web_fetch.py +270 -98
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/youtube_webpage.html.jinja +3 -2
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/workspaces.py +2 -0
- kash_shell-0.3.36/uv.lock +3575 -0
- kash_shell-0.3.34/src/kash/utils/common/import_utils.py +0 -126
- kash_shell-0.3.34/uv.lock +0 -3081
- {kash_shell-0.3.34 → kash_shell-0.3.36}/.env.template +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/.gitignore +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/LICENSE +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/Makefile +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/README.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/development.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/devtools/generate_readme.xsh +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/devtools/lint.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/devtools/profile_main.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/installation.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/publishing.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/__main__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/assistant_chat.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/chat.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/combine_docs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/concat_docs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/format_markdown_template.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/markdownify_html.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/minify_html.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/readability.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/render_as_html.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/save_sidematter_meta.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/show_webpage.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/strip_html.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/summarize_as_bullets.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/tabbed_webpage_config.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/tabbed_webpage_generate.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/core/zip_sidematter.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/meta/write_instructions.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/actions/meta/write_new_action.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/basic_file_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/browser_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/debug_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/diff_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/files_command.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/general_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/logs_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/model_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/reformat_command.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/search_command.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/base/show_command.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/extras/parse_uv_lock.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/extras/utils_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/help/assistant_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/help/doc_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/help/help_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/help/logo.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/help/welcome.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/workspace/selection_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/commands/workspace/workspace_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/capture_output.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/colors.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/init.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/lazy_imports.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/logo.txt +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/server_config.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/suppress_warnings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/config/unified_live.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/all_docs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/load_actions_info.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/load_api_docs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/load_help_topics.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/load_source_code.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/api_docs_template.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/assistant_instructions_template.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/readme_template.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/a1_what_is_kash.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/a2_installation.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/a3_getting_started.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/a4_elements.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/a5_tips_for_use_with_other_tools.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/b0_philosophy_of_kash.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/b1_kash_overview.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/b2_workspace_and_file_formats.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/b3_modern_shell_tool_recommendations.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/topics/b4_faq.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/warning.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs/markdown/welcome.md +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/docs_base.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/load_custom_command_info.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/load_faqs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/load_recipe_snippets.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/recipes/general_system_commands.sh +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/recipes/python_dev_commands.sh +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/docs_base/recipes/tldr_standard_commands.sh +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/embeddings/cosine.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/embeddings/embeddings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/embeddings/text_similarity.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/action_registry.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/combiners.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/command_exec.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/command_registry.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/history.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/importing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/precondition_checks.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/precondition_registry.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/preconditions.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/resolve_args.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/runtime_settings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec/shell_callable_action.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec_model/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec_model/args_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec_model/commands_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec_model/script_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/exec_model/shell_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/item_file_format.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/item_id_index.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/metadata_dirs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/persisted_yaml.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/store_cache_warmer.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/file_storage/store_filenames.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/assistant.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/assistant_instructions.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/assistant_output.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/function_param_info.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/help_embeddings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/help_lookups.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/help_pages.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/help_printing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/help_types.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/recommended_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/help/tldr_help.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/clean_headings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/custom_sliding_transforms.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/fuzzy_parsing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/init_litellm.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/llm_api_keys.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/llm_messages.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/llm_utils/llm_names.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/local_server.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/local_server_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/local_server_routes.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/local_url_formatters.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/port_tools.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/local_server/rich_html_template.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/mcp_main.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/mcp_server_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/mcp_server_sse.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/mcp/mcp_server_stdio.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/audio_processing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/media_cache.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/media_services.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/media_tools.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/services/local_file_media.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/timestamp_citations.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/transcription_deepgram.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/transcription_format.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/media_base/transcription_whisper.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/assistant_response_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/compound_actions_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/concept_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/exec_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/graph_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/language_list.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/llm_actions_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/media_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/operations_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/paths_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/model/preconditions_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/completions/completion_scoring.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/completions/completion_types.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/completions/shell_completions.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/file_icons/color_for_format.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/file_icons/nerd_icons.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/input/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/input/input_prompts.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/input/inquirer_settings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/input/param_inputs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/input/shell_confirm.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/output/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/output/kerm_code_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/output/kerm_codes.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/output/kmarkdown.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/output/shell_formatting.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/output/shell_output.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/ui/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/ui/shell_results.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/ui/shell_syntax.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/utils/exception_printing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/utils/native_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/utils/shell_function_wrapper.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/shell/version.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/api_utils/api_retries.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/api_utils/cache_requests_limited.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/api_utils/gather_limited.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/api_utils/http_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/api_utils/multitask_gather.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/api_utils/progress_protocol.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/format_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/function_inspect.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/lazyobject.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/obj_replace.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/parse_docstring.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/parse_key_vals.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/parse_shell_args.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/stack_traces.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/task_stack.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/testing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/type_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/uniquifier.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/url.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/common/url_slice.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/errors.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_formats/chat_format.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/csv_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/dir_info.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/file_ext.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/file_formats.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/file_formats_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/file_sort_filter.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/file_walk.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/filename_parsing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/ignore_files.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/mtime_cache.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/file_utils/path_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/lang_utils/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/lang_utils/capitalization.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/rich_custom/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/rich_custom/ansi_cell_len.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/rich_custom/multitask_status.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/rich_custom/rich_char_transform.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/rich_custom/rich_indent.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/rich_custom/rich_markdown_fork.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/doc_normalization.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/escape_html_tags.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/markdown_footnotes.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/markdown_render.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/markdown_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/markdownify_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/utils/text_handling/unified_diffs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/canon_url.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/dir_store.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/file_cache_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/file_processing.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/local_file_cache.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/web_extract_justext.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/web_extract_readabilipy.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_content/web_page_model.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/tabbed_webpage.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/template_render.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/base_styles.css.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/base_webpage.html.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/components/toc_scripts.js.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/components/toc_styles.css.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/components/tooltip_scripts.js.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/components/tooltip_styles.css.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/components/youtube_popover_scripts.js.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/components/youtube_popover_styles.css.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/content_styles.css.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/explain_view.html.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/item_view.html.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/simple_webpage.html.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/templates/tabbed_webpage.html.jinja +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/web_gen/webpage_render.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/__init__.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/param_state.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/selections.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/source_items.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/workspace_dirs.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/workspace_output.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/workspaces/workspace_registry.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/command_nl_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/custom_shell.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/customize_prompt.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/load_into_xonsh.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/shell_load_commands.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/shell_which.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/xonsh_completers.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/xonsh_env.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/xonsh_keybindings.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/xonsh_modern_tools.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xonsh_custom/xonsh_ranking_completer.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xontrib/fnm.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/src/kash/xontrib/kash_extension.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/file_storage/test_file_store.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/kash/utils/api_utils/test_gather_limited.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/kash/utils/file_utils/test_csv_utils.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/kash/utils/rich_custom/test_multitask_status.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/model/test_item_serialization.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/shell/input/interactive_input_test.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/test_shell.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/utils/text_handling/test_markdown_footnotes.py +0 -0
- {kash_shell-0.3.34 → kash_shell-0.3.36}/tests/web_gen/test_social_metadata.py +0 -0
|
@@ -7,7 +7,7 @@ alwaysApply: true
|
|
|
7
7
|
|
|
8
8
|
**Your fundamental responsibility:** Remember you are a senior engineer and have a
|
|
9
9
|
serious responsibility to be clear, factual, think step by step and be systematic,
|
|
10
|
-
express expert opinion, and make use of the user
|
|
10
|
+
express expert opinion, and make use of the user’s attention wisely.
|
|
11
11
|
|
|
12
12
|
**Rules must be followed:** It is your responsibility to carefully read these rules as
|
|
13
13
|
well as Python or other language-specific rules included here.
|
|
@@ -22,19 +22,19 @@ Therefore:
|
|
|
22
22
|
confirmation.
|
|
23
23
|
|
|
24
24
|
- If you can think of a much better approach that the user requests, be sure to mention
|
|
25
|
-
it. It
|
|
25
|
+
it. It’s your responsibility to suggest approaches that lead to better, simpler
|
|
26
26
|
solutions.
|
|
27
27
|
|
|
28
|
-
- Give thoughtful opinions on better/worse approaches, but NEVER say
|
|
29
|
-
or
|
|
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.
|
|
30
30
|
Your job is to give expert opinions and to solve problems, not to motivate the user.
|
|
31
31
|
|
|
32
32
|
- Avoid gratuitous enthusiasm or generalizations.
|
|
33
|
-
Use thoughtful comparisons like saying which code is
|
|
33
|
+
Use thoughtful comparisons like saying which code is “cleaner” but don’t congratulate
|
|
34
34
|
yourself. Avoid subjective descriptions.
|
|
35
|
-
For example, don
|
|
35
|
+
For example, don’t say “I’ve meticulously improved the code and it is in great shape!”
|
|
36
36
|
That is useless generalization.
|
|
37
|
-
Instead, specifically say what you
|
|
37
|
+
Instead, specifically say what you’ve done, e.g., "I’ve added types, including
|
|
38
38
|
generics, to all the methods in `Foo` and fixed all linter errors."
|
|
39
39
|
|
|
40
40
|
# General Coding Guidelines
|
|
@@ -49,17 +49,17 @@ Therefore:
|
|
|
49
49
|
- DO NOT repeat in comments what is obvious from the names of functions or variables or
|
|
50
50
|
types.
|
|
51
51
|
|
|
52
|
-
- DO NOT include comments that reflect what you did, such as
|
|
52
|
+
- DO NOT include comments that reflect what you did, such as “Added this function” as
|
|
53
53
|
this is meaningless to anyone reading the code later.
|
|
54
54
|
(Instead, describe in your message to the user any other contextual information.)
|
|
55
55
|
|
|
56
|
-
- DO NOT use fancy or needlessly decorated headings like
|
|
56
|
+
- DO NOT use fancy or needlessly decorated headings like “===== MIGRATION TOOLS =====”
|
|
57
57
|
in comments
|
|
58
58
|
|
|
59
59
|
- DO NOT number steps in comments.
|
|
60
60
|
These are hard to maintain if the code changes.
|
|
61
|
-
NEVER DO THIS:
|
|
62
|
-
This is fine:
|
|
61
|
+
NEVER DO THIS: “// Step 3: Fetch the data from the cache”\
|
|
62
|
+
This is fine: “// Now fetch the data from the cache”
|
|
63
63
|
|
|
64
64
|
- DO NOT use emojis or special unicode characters like ① or • or – or — in comments.
|
|
65
65
|
|
|
@@ -87,7 +87,7 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
87
87
|
- Use pathlib `Path` instead of strings.
|
|
88
88
|
Use `Path(filename).read_text()` instead of two-line `with open(...)` blocks.
|
|
89
89
|
|
|
90
|
-
- Use strif
|
|
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
|
|
@@ -112,7 +112,7 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
112
112
|
|
|
113
113
|
- You can run such individual tests with `uv run pytest -s src/.../path/to/test`
|
|
114
114
|
|
|
115
|
-
- Don
|
|
115
|
+
- Don’t add docs to assertions unless it’s not obvious what they’re checking - the
|
|
116
116
|
assertion appears in the stack trace.
|
|
117
117
|
Do NOT write `assert x == 5, "x should be 5"`. Do NOT write `assert x == 5 # Check if
|
|
118
118
|
x is 5`. That is redundant.
|
|
@@ -122,7 +122,7 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
122
122
|
assertions that confirm the value of a constant setting.
|
|
123
123
|
|
|
124
124
|
- NEVER write `assert False`. If a test reaches an unexpected branch and must fail
|
|
125
|
-
explicitly, `raise AssertionError("
|
|
125
|
+
explicitly, `raise AssertionError("Some explanation")` instead.
|
|
126
126
|
This is best typical best practice in Python since assertions can be removed with
|
|
127
127
|
optimization.
|
|
128
128
|
|
|
@@ -132,6 +132,21 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
132
132
|
This is also preferable because then simple tests have no explicit pytest dependencies
|
|
133
133
|
and can be placed in code anywhere.
|
|
134
134
|
|
|
135
|
+
- DO NOT write trivial tests that test something we know already works, like
|
|
136
|
+
instantiating a Pydantic object.
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
class Link(BaseModel):
|
|
140
|
+
url: str
|
|
141
|
+
title: str = None
|
|
142
|
+
|
|
143
|
+
# DO NOT write tests like this. They are trivial and only create clutter!
|
|
144
|
+
def test_link_model():
|
|
145
|
+
link = Link(url="https://example.com", title="Example")
|
|
146
|
+
assert link.url == "https://example.com"
|
|
147
|
+
assert link.title == "Example"
|
|
148
|
+
```
|
|
149
|
+
|
|
135
150
|
## Types and Type Annotations
|
|
136
151
|
|
|
137
152
|
- Use modern union syntax: `str | None` instead of `Optional[str]`, `dict[str]` instead
|
|
@@ -142,7 +157,7 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
142
157
|
- Use modern enums like `StrEnum` if appropriate.
|
|
143
158
|
|
|
144
159
|
- One exception to common practice on enums: If an enum has many values that are
|
|
145
|
-
strings, and they have a literal value as a string (like in a JSON protocol), it
|
|
160
|
+
strings, and they have a literal value as a string (like in a JSON protocol), it’s
|
|
146
161
|
fine to use lower_snake_case for enum values to match the actual value.
|
|
147
162
|
This is more readable than LONG_ALL_CAPS_VALUES, and you can simply set the value to
|
|
148
163
|
be the same as the name for each.
|
|
@@ -228,7 +243,7 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
228
243
|
- For classes with many methods, use a concise docstring on the class that explains all
|
|
229
244
|
the common information, and avoid repeating the same information on every method.
|
|
230
245
|
|
|
231
|
-
- Docstrings should provide context or as concisely as possible explain
|
|
246
|
+
- Docstrings should provide context or as concisely as possible explain “why”, not
|
|
232
247
|
obvious details evident from the class names, function names, parameter names, and
|
|
233
248
|
type annotations.
|
|
234
249
|
|
|
@@ -240,10 +255,10 @@ Always use full type annotations, generics, and other modern practices.
|
|
|
240
255
|
name, variable name, or types.
|
|
241
256
|
That is silly and obvious and makes the code longer for no reason.
|
|
242
257
|
|
|
243
|
-
- Do NOT list args and return values if they
|
|
258
|
+
- Do NOT list args and return values if they’re obvious.
|
|
244
259
|
In the above examples, you do not need and `Arguments:` or `Returns:` section, since
|
|
245
|
-
|
|
246
|
-
do list these if there are many arguments and their meaning isn
|
|
260
|
+
sections as it is obvious from context.
|
|
261
|
+
do list these if there are many arguments and their meaning isn’t clear.
|
|
247
262
|
If it returns a less obvious type like a tuple, do explain in the pydoc.
|
|
248
263
|
|
|
249
264
|
- Exported/public variables, functions, or methods SHOULD have concise docstrings.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kash-shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.36
|
|
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>
|
|
@@ -72,6 +72,7 @@ Requires-Dist: thefuzz>=0.22.1
|
|
|
72
72
|
Requires-Dist: tiktoken>=0.9.0
|
|
73
73
|
Requires-Dist: tldr>=3.3.0
|
|
74
74
|
Requires-Dist: tminify>=0.1.6
|
|
75
|
+
Requires-Dist: truststore>=0.10.4
|
|
75
76
|
Requires-Dist: typing-extensions>=4.12.2
|
|
76
77
|
Requires-Dist: uvicorn>=0.34.0
|
|
77
78
|
Requires-Dist: xonsh>=0.19.3
|
|
@@ -82,9 +82,10 @@ dependencies = [
|
|
|
82
82
|
# HTTP clients:
|
|
83
83
|
"httpx[brotli]>=0.28.1", # Include brotli for better compression and browser fingerprint.
|
|
84
84
|
"curl-cffi>=0.11.4",
|
|
85
|
+
"truststore>=0.10.4",
|
|
85
86
|
# LLM and API essentials:
|
|
86
87
|
"tiktoken>=0.9.0",
|
|
87
|
-
"openai==1.99.9",
|
|
88
|
+
"openai==1.99.9", # FIXME: Pinning for now due to import errors (ImportError: cannot import name 'ResponseTextConfig' from 'openai.types.responses.response')
|
|
88
89
|
"litellm>=1.74.15.post1",
|
|
89
90
|
"pyrate-limiter>=3.7.0",
|
|
90
91
|
"aiolimiter>=1.2.1",
|
|
@@ -22,9 +22,6 @@ class KashEnv(EnvEnum):
|
|
|
22
22
|
KASH_SYSTEM_CACHE_DIR = "KASH_SYSTEM_CACHE_DIR"
|
|
23
23
|
"""The directory for system cache (caches separate from workspace caches)."""
|
|
24
24
|
|
|
25
|
-
KASH_MCP_WS = "KASH_MCP_WS"
|
|
26
|
-
"""The directory for the workspace for MCP servers."""
|
|
27
|
-
|
|
28
25
|
KASH_SHOW_TRACEBACK = "KASH_SHOW_TRACEBACK"
|
|
29
26
|
"""Whether to show tracebacks on actions and commands in the shell."""
|
|
30
27
|
|
|
@@ -281,6 +281,8 @@ def _do_logging_setup(log_settings: LogSettings):
|
|
|
281
281
|
def prefix(line: str, emoji: str = "", warn_emoji: str = "") -> str:
|
|
282
282
|
prefix = task_stack_prefix_str()
|
|
283
283
|
emojis = f"{warn_emoji}{emoji}".strip()
|
|
284
|
+
if emojis:
|
|
285
|
+
emojis += " "
|
|
284
286
|
return "".join(filter(None, [prefix, emojis, line]))
|
|
285
287
|
|
|
286
288
|
|
|
@@ -19,7 +19,16 @@ class SuppressedWarningsStreamHandler(logging.StreamHandler):
|
|
|
19
19
|
def basic_file_handler(path: Path, level: LogLevel | LogLevelStr) -> logging.FileHandler:
|
|
20
20
|
handler = logging.FileHandler(path)
|
|
21
21
|
handler.setLevel(LogLevel.parse(level).value)
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
class ThreadIdFormatter(Formatter):
|
|
24
|
+
def format(self, record):
|
|
25
|
+
# Add shortened thread ID as an attribute
|
|
26
|
+
record.thread_short = str(record.thread)[-5:]
|
|
27
|
+
return super().format(record)
|
|
28
|
+
|
|
29
|
+
handler.setFormatter(
|
|
30
|
+
ThreadIdFormatter("%(asctime)s %(levelname).1s [T%(thread_short)s] %(name)s - %(message)s")
|
|
31
|
+
)
|
|
23
32
|
return handler
|
|
24
33
|
|
|
25
34
|
|
|
@@ -166,9 +166,6 @@ class Settings:
|
|
|
166
166
|
system_cache_dir: Path
|
|
167
167
|
"""Default global and system cache directory (for global media, content, etc)."""
|
|
168
168
|
|
|
169
|
-
mcp_ws_dir: Path | None
|
|
170
|
-
"""The directory for the MCP workspace, if set."""
|
|
171
|
-
|
|
172
169
|
local_server_log_path: Path
|
|
173
170
|
"""The path to the local server log."""
|
|
174
171
|
|
|
@@ -245,14 +242,6 @@ def _get_system_cache_dir() -> Path:
|
|
|
245
242
|
return KashEnv.KASH_SYSTEM_CACHE_DIR.read_path(default=_get_ws_root_dir() / "cache")
|
|
246
243
|
|
|
247
244
|
|
|
248
|
-
def _get_mcp_ws_dir() -> Path | None:
|
|
249
|
-
mcp_dir = KashEnv.KASH_MCP_WS.read_str(default=None)
|
|
250
|
-
if mcp_dir:
|
|
251
|
-
return Path(mcp_dir).expanduser().resolve()
|
|
252
|
-
else:
|
|
253
|
-
return None
|
|
254
|
-
|
|
255
|
-
|
|
256
245
|
@cache
|
|
257
246
|
def _get_local_server_log_path() -> Path:
|
|
258
247
|
return resolve_and_create_dirs(get_system_logs_dir() / f"{LOCAL_SERVER_LOG_NAME}.log")
|
|
@@ -266,7 +255,6 @@ def _read_settings():
|
|
|
266
255
|
system_config_dir=_get_system_config_dir(),
|
|
267
256
|
system_logs_dir=get_system_logs_dir(),
|
|
268
257
|
system_cache_dir=_get_system_cache_dir(),
|
|
269
|
-
mcp_ws_dir=_get_mcp_ws_dir(),
|
|
270
258
|
local_server_log_path=_get_local_server_log_path(),
|
|
271
259
|
# These default to the global but can be overridden by workspace settings.
|
|
272
260
|
media_cache_dir=_get_system_cache_dir() / MEDIA_CACHE_NAME,
|
|
@@ -75,6 +75,21 @@ def kash_setup(
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def _lib_setup():
|
|
78
|
+
import logging
|
|
79
|
+
|
|
80
|
+
log = logging.getLogger(__name__)
|
|
81
|
+
|
|
82
|
+
# Trust store integration, for consistent TLS behavior.
|
|
83
|
+
try:
|
|
84
|
+
import truststore # type: ignore
|
|
85
|
+
|
|
86
|
+
truststore.inject_into_ssl()
|
|
87
|
+
log.info("truststore initialized: using system TLS trust store")
|
|
88
|
+
except Exception as exc:
|
|
89
|
+
# If not installed or fails, default TLS trust will be used.
|
|
90
|
+
log.warning("truststore not available at import time: %s", exc)
|
|
91
|
+
|
|
92
|
+
# Handle default YAML representers.
|
|
78
93
|
from sidematter_format import register_default_yaml_representers
|
|
79
94
|
|
|
80
95
|
register_default_yaml_representers()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from funlog import log_calls
|
|
2
|
+
|
|
3
|
+
from kash.config.logger import get_logger
|
|
4
|
+
from kash.utils.common.import_utils import warm_import_library
|
|
5
|
+
|
|
6
|
+
log = get_logger(__name__)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@log_calls(level="info", show_timing_only=True)
|
|
10
|
+
def warm_slow_imports(include_extras: bool = True):
|
|
11
|
+
"""
|
|
12
|
+
Pre-import slow packages to avoid delays when they are first used.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
include_extras: If True, warm import optional libraries like LLM packages,
|
|
16
|
+
scipy, torch, etc. Set to False for minimal/faster startup.
|
|
17
|
+
"""
|
|
18
|
+
try:
|
|
19
|
+
# Loading actions also loads any kits that are discovered.
|
|
20
|
+
import kash.actions # noqa: F401
|
|
21
|
+
import kash.local_server # noqa: F401
|
|
22
|
+
import kash.local_server.local_server # noqa: F401
|
|
23
|
+
import kash.mcp.mcp_server_sse # noqa: F401
|
|
24
|
+
|
|
25
|
+
# Core libraries that should usually be present
|
|
26
|
+
for lib_name, max_depth in [("xonsh", 3), ("uvicorn", 3)]:
|
|
27
|
+
try:
|
|
28
|
+
warm_import_library(lib_name, max_depth=max_depth)
|
|
29
|
+
except Exception as e:
|
|
30
|
+
log.debug(f"Could not warm import {lib_name}: {e}")
|
|
31
|
+
|
|
32
|
+
if include_extras:
|
|
33
|
+
# Fully warm import larger libraries (only if they're installed)
|
|
34
|
+
# These are optional dependencies that may not be present
|
|
35
|
+
optional_libraries = [
|
|
36
|
+
("pydantic", 5),
|
|
37
|
+
("litellm", 5),
|
|
38
|
+
("openai", 5),
|
|
39
|
+
("torch", 3), # torch is huge, limit depth
|
|
40
|
+
("scipy", 3), # scipy has test modules we want to skip
|
|
41
|
+
("marker", 4),
|
|
42
|
+
("pandas", 3),
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
for lib_name, max_depth in optional_libraries:
|
|
46
|
+
try:
|
|
47
|
+
warm_import_library(lib_name, max_depth=max_depth)
|
|
48
|
+
except Exception as e:
|
|
49
|
+
log.debug(f"Could not warm import {lib_name}: {e}")
|
|
50
|
+
|
|
51
|
+
# Initialize litellm configuration if available
|
|
52
|
+
try:
|
|
53
|
+
from kash.llm_utils.init_litellm import init_litellm
|
|
54
|
+
|
|
55
|
+
init_litellm()
|
|
56
|
+
except ImportError:
|
|
57
|
+
pass # litellm not installed
|
|
58
|
+
|
|
59
|
+
except ImportError as e:
|
|
60
|
+
log.warning(f"Error pre-importing packages: {e}")
|
|
@@ -204,7 +204,7 @@ def kash_action(
|
|
|
204
204
|
precondition: Precondition = Precondition.always,
|
|
205
205
|
arg_type: ArgType = ArgType.Locator,
|
|
206
206
|
expected_args: ArgCount = ONE_ARG,
|
|
207
|
-
output_type: ItemType =
|
|
207
|
+
output_type: ItemType | None = None,
|
|
208
208
|
output_format: Format | None = None,
|
|
209
209
|
expected_outputs: ArgCount = ONE_ARG,
|
|
210
210
|
params: ParamDeclarations = (),
|
|
@@ -349,7 +349,7 @@ def kash_action(
|
|
|
349
349
|
fmt_lines(self.params),
|
|
350
350
|
)
|
|
351
351
|
log.info(
|
|
352
|
-
"Action function param values
|
|
352
|
+
"Action function param values: %s",
|
|
353
353
|
self.param_value_summary_str(),
|
|
354
354
|
)
|
|
355
355
|
else:
|
|
@@ -107,7 +107,7 @@ def log_action(action: Action, action_input: ActionInput, operation: Operation):
|
|
|
107
107
|
log.message("%s Action: `%s`", EMOJI_START, action.name)
|
|
108
108
|
log.info("Running: `%s`", operation.command_line(with_options=True))
|
|
109
109
|
if len(action.param_value_summary()) > 0:
|
|
110
|
-
log.message("Parameters
|
|
110
|
+
log.message("Parameters: %s", action.param_value_summary_str())
|
|
111
111
|
log.info("Operation is: %s", operation)
|
|
112
112
|
log.info("Input items are:\n%s", fmt_lines(action_input.items))
|
|
113
113
|
|
|
@@ -144,15 +144,17 @@ def fetch_url_item_content(
|
|
|
144
144
|
if save_content:
|
|
145
145
|
assert page_data.saved_content
|
|
146
146
|
assert page_data.format_info
|
|
147
|
+
if not page_data.format_info.format:
|
|
148
|
+
log.warning("No format detected for content, defaulting to HTML: %s", url)
|
|
147
149
|
content_item = url_item.new_copy_with(
|
|
148
150
|
external_path=str(page_data.saved_content),
|
|
149
151
|
# Use the original filename, not the local cache filename (which has a hash suffix).
|
|
150
152
|
original_filename=item.get_filename(),
|
|
151
|
-
format=page_data.format_info.format,
|
|
153
|
+
format=page_data.format_info.format or Format.html,
|
|
152
154
|
)
|
|
153
155
|
|
|
154
156
|
if not url_item.title:
|
|
155
|
-
log.
|
|
157
|
+
log.info("Title is missing for url item: %s", item)
|
|
156
158
|
|
|
157
159
|
# Now save the updated URL item and also the content item if we have one.
|
|
158
160
|
ws.save(url_item, overwrite=overwrite)
|
|
@@ -29,6 +29,7 @@ def windowed_llm_transform(
|
|
|
29
29
|
windowing: WindowSettings | None,
|
|
30
30
|
diff_filter: DiffFilter | None = None,
|
|
31
31
|
check_no_results: bool = True,
|
|
32
|
+
enable_web_search: bool = False,
|
|
32
33
|
) -> TextDoc:
|
|
33
34
|
def doc_transform(input_doc: TextDoc) -> TextDoc:
|
|
34
35
|
return TextDoc.from_text(
|
|
@@ -41,6 +42,7 @@ def windowed_llm_transform(
|
|
|
41
42
|
input=input_doc.reassemble(),
|
|
42
43
|
body_template=template,
|
|
43
44
|
check_no_results=check_no_results,
|
|
45
|
+
enable_web_search=enable_web_search,
|
|
44
46
|
).content
|
|
45
47
|
)
|
|
46
48
|
)
|
|
@@ -67,6 +69,7 @@ def llm_transform_str(options: LLMOptions, input_str: str, check_no_results: boo
|
|
|
67
69
|
input_str,
|
|
68
70
|
options.windowing,
|
|
69
71
|
diff_filter=options.diff_filter,
|
|
72
|
+
enable_web_search=options.enable_web_search,
|
|
70
73
|
).reassemble()
|
|
71
74
|
else:
|
|
72
75
|
log.info(
|
|
@@ -81,6 +84,7 @@ def llm_transform_str(options: LLMOptions, input_str: str, check_no_results: boo
|
|
|
81
84
|
body_template=options.body_template,
|
|
82
85
|
input=input_str,
|
|
83
86
|
check_no_results=check_no_results,
|
|
87
|
+
enable_web_search=options.enable_web_search,
|
|
84
88
|
).content
|
|
85
89
|
|
|
86
90
|
return result_str
|
|
@@ -485,6 +485,9 @@ class FileStore(Workspace):
|
|
|
485
485
|
If `with_sidematter` is true, will copy any sidematter files (metadata/assets) to
|
|
486
486
|
the destination.
|
|
487
487
|
"""
|
|
488
|
+
# TODO: Make sure importing a text item that already has
|
|
489
|
+
# frontmatter doesn't accidentally duplicate the frontmatter
|
|
490
|
+
|
|
488
491
|
from kash.file_storage.item_file_format import read_item
|
|
489
492
|
from kash.web_content.canon_url import canonicalize_url
|
|
490
493
|
|
|
@@ -531,6 +534,7 @@ class FileStore(Workspace):
|
|
|
531
534
|
# This will read the file with or without frontmatter.
|
|
532
535
|
# We are importing so we want to drop the external path so we save the body.
|
|
533
536
|
item = read_item(path, self.base_dir)
|
|
537
|
+
log.info("Imported text item: %s", item)
|
|
534
538
|
item.external_path = None
|
|
535
539
|
|
|
536
540
|
if item.type and as_type and item.type != as_type:
|