kash-shell 0.3.11__tar.gz → 0.3.13__tar.gz

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