kash-shell 0.3.9__tar.gz → 0.3.11__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 (320) hide show
  1. {kash_shell-0.3.9 → kash_shell-0.3.11}/PKG-INFO +10 -8
  2. {kash_shell-0.3.9 → kash_shell-0.3.11}/README.md +3 -2
  3. {kash_shell-0.3.9 → kash_shell-0.3.11}/pyproject.toml +9 -5
  4. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/__init__.py +4 -4
  5. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/format_markdown_template.py +2 -5
  6. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/markdownify.py +7 -6
  7. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/readability.py +7 -6
  8. kash_shell-0.3.11/src/kash/actions/core/render_as_html.py +37 -0
  9. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/show_webpage.py +6 -11
  10. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/strip_html.py +2 -6
  11. kash_shell-0.3.11/src/kash/actions/core/tabbed_webpage_config.py +31 -0
  12. kash_shell-0.3.9/src/kash/actions/core/webpage_generate.py → kash_shell-0.3.11/src/kash/actions/core/tabbed_webpage_generate.py +5 -4
  13. kash_shell-0.3.11/src/kash/commands/__init__.py +9 -0
  14. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/basic_file_commands.py +15 -0
  15. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/debug_commands.py +13 -0
  16. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/files_command.py +28 -10
  17. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/general_commands.py +21 -16
  18. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/logs_commands.py +4 -2
  19. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/model_commands.py +8 -8
  20. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/search_command.py +3 -2
  21. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/show_command.py +5 -3
  22. kash_shell-0.3.11/src/kash/commands/extras/parse_uv_lock.py +186 -0
  23. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/help/doc_commands.py +2 -31
  24. kash_shell-0.3.11/src/kash/commands/help/welcome.py +33 -0
  25. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/workspace/selection_commands.py +11 -6
  26. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/workspace/workspace_commands.py +19 -17
  27. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/colors.py +3 -1
  28. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/env_settings.py +14 -1
  29. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/init.py +2 -2
  30. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/logger.py +59 -56
  31. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/logger_basic.py +3 -3
  32. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/settings.py +116 -57
  33. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/setup.py +28 -12
  34. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/text_styles.py +3 -13
  35. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/load_api_docs.py +2 -1
  36. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/a3_getting_started.md +3 -2
  37. {kash_shell-0.3.9/src/kash/concepts → kash_shell-0.3.11/src/kash/embeddings}/text_similarity.py +2 -2
  38. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/__init__.py +20 -3
  39. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/action_decorators.py +24 -10
  40. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/action_exec.py +41 -23
  41. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/action_registry.py +13 -48
  42. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/command_registry.py +2 -1
  43. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/fetch_url_metadata.py +4 -6
  44. kash_shell-0.3.11/src/kash/exec/importing.py +56 -0
  45. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/llm_transforms.py +12 -10
  46. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/precondition_registry.py +2 -1
  47. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/preconditions.py +22 -1
  48. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/resolve_args.py +4 -0
  49. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/shell_callable_action.py +33 -19
  50. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/file_store.py +42 -27
  51. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/item_file_format.py +5 -2
  52. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/metadata_dirs.py +11 -2
  53. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/assistant.py +1 -1
  54. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/assistant_instructions.py +2 -1
  55. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/function_param_info.py +1 -1
  56. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/help_embeddings.py +2 -2
  57. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/help_printing.py +7 -11
  58. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/clean_headings.py +1 -1
  59. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/llm_api_keys.py +4 -4
  60. kash_shell-0.3.11/src/kash/llm_utils/llm_features.py +68 -0
  61. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/llm_messages.py +1 -2
  62. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/llm_names.py +1 -1
  63. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/llms.py +8 -3
  64. kash_shell-0.3.11/src/kash/local_server/__init__.py +5 -0
  65. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/local_server/local_server.py +8 -5
  66. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/local_server/local_server_commands.py +2 -2
  67. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/local_server/local_server_routes.py +1 -7
  68. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/local_server/local_url_formatters.py +1 -1
  69. kash_shell-0.3.11/src/kash/mcp/__init__.py +5 -0
  70. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/mcp/mcp_cli.py +5 -5
  71. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/mcp/mcp_server_commands.py +5 -5
  72. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/mcp/mcp_server_routes.py +5 -5
  73. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/mcp/mcp_server_sse.py +4 -2
  74. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/media_cache.py +8 -8
  75. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/media_services.py +1 -1
  76. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/media_tools.py +6 -6
  77. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/services/local_file_media.py +2 -2
  78. kash_shell-0.3.9/src/kash/media_base/speech_transcription.py → kash_shell-0.3.11/src/kash/media_base/transcription_deepgram.py +25 -110
  79. kash_shell-0.3.11/src/kash/media_base/transcription_format.py +73 -0
  80. kash_shell-0.3.11/src/kash/media_base/transcription_whisper.py +38 -0
  81. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/__init__.py +73 -5
  82. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/actions_model.py +38 -4
  83. kash_shell-0.3.11/src/kash/model/concept_model.py +30 -0
  84. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/items_model.py +115 -32
  85. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/params_model.py +24 -0
  86. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/completions/completion_scoring.py +37 -5
  87. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/output/kerm_codes.py +1 -2
  88. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/output/shell_formatting.py +14 -4
  89. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/shell_main.py +2 -2
  90. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/utils/exception_printing.py +6 -0
  91. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/utils/native_utils.py +26 -20
  92. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/utils/shell_function_wrapper.py +15 -15
  93. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/text_handling/custom_sliding_transforms.py +12 -4
  94. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/text_handling/doc_normalization.py +6 -2
  95. kash_shell-0.3.11/src/kash/text_handling/markdown_render.py +118 -0
  96. kash_shell-0.3.11/src/kash/text_handling/markdown_utils.py +226 -0
  97. kash_shell-0.3.11/src/kash/utils/common/function_inspect.py +428 -0
  98. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/import_utils.py +12 -3
  99. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/type_utils.py +0 -29
  100. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/url.py +27 -3
  101. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/errors.py +6 -0
  102. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/file_ext.py +4 -0
  103. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/file_formats.py +2 -2
  104. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/file_formats_model.py +20 -1
  105. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/dir_store.py +1 -2
  106. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/file_cache_utils.py +37 -10
  107. kash_shell-0.3.11/src/kash/web_content/file_processing.py +68 -0
  108. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/local_file_cache.py +12 -9
  109. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/web_extract.py +8 -3
  110. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/web_fetch.py +12 -4
  111. kash_shell-0.3.11/src/kash/web_gen/simple_webpage.py +52 -0
  112. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_gen/tabbed_webpage.py +24 -14
  113. kash_shell-0.3.11/src/kash/web_gen/template_render.py +64 -0
  114. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_gen/templates/base_styles.css.jinja +169 -43
  115. kash_shell-0.3.11/src/kash/web_gen/templates/base_webpage.html.jinja +189 -0
  116. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_gen/templates/content_styles.css.jinja +4 -2
  117. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_gen/templates/item_view.html.jinja +49 -39
  118. kash_shell-0.3.11/src/kash/web_gen/templates/simple_webpage.html.jinja +24 -0
  119. kash_shell-0.3.11/src/kash/web_gen/templates/tabbed_webpage.html.jinja +58 -0
  120. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/__init__.py +15 -2
  121. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/selections.py +18 -3
  122. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/source_items.py +0 -1
  123. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/workspaces.py +5 -11
  124. kash_shell-0.3.11/src/kash/xonsh_custom/command_nl_utils.py +91 -0
  125. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/custom_shell.py +43 -11
  126. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/customize_prompt.py +39 -21
  127. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/load_into_xonsh.py +22 -25
  128. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/shell_load_commands.py +2 -2
  129. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/xonsh_completers.py +2 -249
  130. kash_shell-0.3.11/src/kash/xonsh_custom/xonsh_keybindings.py +282 -0
  131. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/xonsh_modern_tools.py +3 -3
  132. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xontrib/kash_extension.py +5 -6
  133. kash_shell-0.3.11/uv.lock +2713 -0
  134. kash_shell-0.3.9/src/kash/actions/core/webpage_config.py +0 -21
  135. kash_shell-0.3.9/src/kash/commands/__init__.py +0 -21
  136. kash_shell-0.3.9/src/kash/concepts/concept_formats.py +0 -23
  137. kash_shell-0.3.9/src/kash/local_server/__init__.py +0 -2
  138. kash_shell-0.3.9/src/kash/mcp/__init__.py +0 -2
  139. kash_shell-0.3.9/src/kash/shell/clideps/api_keys.py +0 -100
  140. kash_shell-0.3.9/src/kash/shell/clideps/dotenv_setup.py +0 -115
  141. kash_shell-0.3.9/src/kash/shell/clideps/dotenv_utils.py +0 -98
  142. kash_shell-0.3.9/src/kash/shell/clideps/pkg_deps.py +0 -257
  143. kash_shell-0.3.9/src/kash/shell/clideps/platforms.py +0 -11
  144. kash_shell-0.3.9/src/kash/shell/clideps/terminal_features.py +0 -56
  145. kash_shell-0.3.9/src/kash/shell/utils/osc_utils.py +0 -95
  146. kash_shell-0.3.9/src/kash/shell/utils/terminal_images.py +0 -133
  147. kash_shell-0.3.9/src/kash/text_handling/markdown_util.py +0 -167
  148. kash_shell-0.3.9/src/kash/utils/common/atomic_var.py +0 -171
  149. kash_shell-0.3.9/src/kash/utils/common/function_inspect.py +0 -178
  150. kash_shell-0.3.9/src/kash/utils/common/string_replace.py +0 -93
  151. kash_shell-0.3.9/src/kash/utils/common/string_template.py +0 -101
  152. kash_shell-0.3.9/src/kash/web_gen/__init__.py +0 -4
  153. kash_shell-0.3.9/src/kash/web_gen/template_render.py +0 -29
  154. kash_shell-0.3.9/src/kash/web_gen/templates/base_webpage.html.jinja +0 -124
  155. kash_shell-0.3.9/src/kash/web_gen/templates/tabbed_webpage.html.jinja +0 -49
  156. kash_shell-0.3.9/src/kash/xonsh_custom/command_nl_utils.py +0 -70
  157. kash_shell-0.3.9/uv.lock +0 -2599
  158. {kash_shell-0.3.9 → kash_shell-0.3.11}/.copier-answers.yml +0 -0
  159. {kash_shell-0.3.9 → kash_shell-0.3.11}/.env.template +0 -0
  160. {kash_shell-0.3.9 → kash_shell-0.3.11}/.github/workflows/ci.yml +0 -0
  161. {kash_shell-0.3.9 → kash_shell-0.3.11}/.github/workflows/publish.yml +0 -0
  162. {kash_shell-0.3.9 → kash_shell-0.3.11}/.gitignore +0 -0
  163. {kash_shell-0.3.9 → kash_shell-0.3.11}/LICENSE +0 -0
  164. {kash_shell-0.3.9 → kash_shell-0.3.11}/Makefile +0 -0
  165. {kash_shell-0.3.9 → kash_shell-0.3.11}/development.md +0 -0
  166. {kash_shell-0.3.9 → kash_shell-0.3.11}/devtools/generate_readme.xsh +0 -0
  167. {kash_shell-0.3.9 → kash_shell-0.3.11}/devtools/lint.py +0 -0
  168. {kash_shell-0.3.9 → kash_shell-0.3.11}/devtools/profile_main.py +0 -0
  169. {kash_shell-0.3.9 → kash_shell-0.3.11}/installation.md +0 -0
  170. {kash_shell-0.3.9 → kash_shell-0.3.11}/publishing.md +0 -0
  171. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/__init__.py +0 -0
  172. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/__main__.py +0 -0
  173. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/assistant_chat.py +0 -0
  174. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/chat.py +0 -0
  175. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/core/summarize_as_bullets.py +0 -0
  176. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/meta/write_instructions.py +0 -0
  177. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/actions/meta/write_new_action.py +0 -0
  178. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/browser_commands.py +0 -0
  179. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/diff_commands.py +0 -0
  180. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/base/reformat_command.py +0 -0
  181. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/extras/utils_commands.py +0 -0
  182. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/help/assistant_commands.py +0 -0
  183. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/help/help_commands.py +0 -0
  184. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/commands/help/logo.py +0 -0
  185. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/__init__.py +0 -0
  186. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/capture_output.py +0 -0
  187. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/lazy_imports.py +0 -0
  188. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/logo.txt +0 -0
  189. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/server_config.py +0 -0
  190. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/config/suppress_warnings.py +0 -0
  191. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/__init__.py +0 -0
  192. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/all_docs.py +0 -0
  193. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/load_actions_info.py +0 -0
  194. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/load_help_topics.py +0 -0
  195. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/load_source_code.py +0 -0
  196. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/api_docs_template.md +0 -0
  197. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/assistant_instructions_template.md +0 -0
  198. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/readme_template.md +0 -0
  199. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/a1_what_is_kash.md +0 -0
  200. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/a2_installation.md +0 -0
  201. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/a4_elements.md +0 -0
  202. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/a5_tips_for_use_with_other_tools.md +0 -0
  203. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/b0_philosophy_of_kash.md +0 -0
  204. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/b1_kash_overview.md +0 -0
  205. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/b2_workspace_and_file_formats.md +0 -0
  206. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/b3_modern_shell_tool_recommendations.md +0 -0
  207. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/topics/b4_faq.md +0 -0
  208. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/warning.md +0 -0
  209. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs/markdown/welcome.md +0 -0
  210. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/docs_base.py +0 -0
  211. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/load_custom_command_info.py +0 -0
  212. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/load_faqs.py +0 -0
  213. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/load_recipe_snippets.py +0 -0
  214. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/recipes/general_system_commands.sh +0 -0
  215. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/recipes/python_dev_commands.sh +0 -0
  216. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/docs_base/recipes/tldr_standard_commands.sh +0 -0
  217. {kash_shell-0.3.9/src/kash/concepts → kash_shell-0.3.11/src/kash/embeddings}/cosine.py +0 -0
  218. {kash_shell-0.3.9/src/kash/concepts → kash_shell-0.3.11/src/kash/embeddings}/embeddings.py +0 -0
  219. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/combiners.py +0 -0
  220. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/command_exec.py +0 -0
  221. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/history.py +0 -0
  222. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec/precondition_checks.py +0 -0
  223. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec_model/__init__.py +0 -0
  224. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec_model/args_model.py +0 -0
  225. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec_model/commands_model.py +0 -0
  226. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec_model/script_model.py +0 -0
  227. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/exec_model/shell_model.py +0 -0
  228. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/__init__.py +0 -0
  229. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/persisted_yaml.py +0 -0
  230. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/store_cache_warmer.py +0 -0
  231. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/file_storage/store_filenames.py +0 -0
  232. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/__init__.py +0 -0
  233. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/assistant_output.py +0 -0
  234. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/docstring_utils.py +0 -0
  235. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/help_lookups.py +0 -0
  236. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/help_pages.py +0 -0
  237. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/help_types.py +0 -0
  238. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/recommended_commands.py +0 -0
  239. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/help/tldr_help.py +0 -0
  240. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/__init__.py +0 -0
  241. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/fuzzy_parsing.py +0 -0
  242. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/llm_utils/llm_completion.py +0 -0
  243. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/local_server/port_tools.py +0 -0
  244. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/local_server/rich_html_template.py +0 -0
  245. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/mcp/mcp_main.py +0 -0
  246. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/mcp/mcp_server_stdio.py +0 -0
  247. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/__init__.py +0 -0
  248. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/audio_processing.py +0 -0
  249. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/media_base/timestamp_citations.py +0 -0
  250. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/assistant_response_model.py +0 -0
  251. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/compound_actions_model.py +0 -0
  252. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/graph_model.py +0 -0
  253. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/language_list.py +0 -0
  254. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/llm_actions_model.py +0 -0
  255. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/media_model.py +0 -0
  256. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/operations_model.py +0 -0
  257. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/paths_model.py +0 -0
  258. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/model/preconditions_model.py +0 -0
  259. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/__init__.py +0 -0
  260. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/completions/completion_types.py +0 -0
  261. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/completions/shell_completions.py +0 -0
  262. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/file_icons/color_for_format.py +0 -0
  263. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/file_icons/nerd_icons.py +0 -0
  264. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/input/__init__.py +0 -0
  265. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/input/input_prompts.py +0 -0
  266. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/input/inquirer_settings.py +0 -0
  267. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/input/param_inputs.py +0 -0
  268. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/input/shell_confirm.py +0 -0
  269. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/output/__init__.py +0 -0
  270. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/output/kerm_code_utils.py +0 -0
  271. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/output/kmarkdown.py +0 -0
  272. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/output/shell_output.py +0 -0
  273. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/ui/__init__.py +0 -0
  274. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/ui/shell_results.py +0 -0
  275. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/ui/shell_syntax.py +0 -0
  276. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/utils/argparse_utils.py +0 -0
  277. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/shell/version.py +0 -0
  278. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/text_handling/unified_diffs.py +0 -0
  279. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/__init__.py +0 -0
  280. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/__init__.py +0 -0
  281. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/format_utils.py +0 -0
  282. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/lazyobject.py +0 -0
  283. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/obj_replace.py +0 -0
  284. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/parse_key_vals.py +0 -0
  285. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/parse_shell_args.py +0 -0
  286. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/stack_traces.py +0 -0
  287. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/task_stack.py +0 -0
  288. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/common/uniquifier.py +0 -0
  289. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_formats/chat_format.py +0 -0
  290. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/__init__.py +0 -0
  291. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/dir_info.py +0 -0
  292. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/file_sort_filter.py +0 -0
  293. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/file_walk.py +0 -0
  294. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/filename_parsing.py +0 -0
  295. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/ignore_files.py +0 -0
  296. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/mtime_cache.py +0 -0
  297. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/file_utils/path_utils.py +0 -0
  298. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/lang_utils/__init__.py +0 -0
  299. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/lang_utils/capitalization.py +0 -0
  300. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/lang_utils/inflection.py +0 -0
  301. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/rich_custom/__init__.py +0 -0
  302. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/rich_custom/ansi_cell_len.py +0 -0
  303. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/rich_custom/rich_char_transform.py +0 -0
  304. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/rich_custom/rich_indent.py +0 -0
  305. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/utils/rich_custom/rich_markdown_fork.py +0 -0
  306. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/canon_url.py +0 -0
  307. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/web_extract_justext.py +0 -0
  308. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/web_extract_readabilipy.py +0 -0
  309. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_content/web_page_model.py +0 -0
  310. /kash_shell-0.3.9/src/kash_shell/py.typed → /kash_shell-0.3.11/src/kash/web_gen/__init__.py +0 -0
  311. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/web_gen/templates/explain_view.html.jinja +0 -0
  312. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/param_state.py +0 -0
  313. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/workspace_importing.py +0 -0
  314. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/workspace_output.py +0 -0
  315. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/workspaces/workspace_registry.py +0 -0
  316. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/shell_which.py +0 -0
  317. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/xonsh_env.py +0 -0
  318. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xonsh_custom/xonsh_ranking_completer.py +0 -0
  319. {kash_shell-0.3.9 → kash_shell-0.3.11}/src/kash/xontrib/fnm.py +0 -0
  320. {kash_shell-0.3.9 → kash_shell-0.3.11}/tests/test_shell.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kash-shell
3
- Version: 0.3.9
3
+ Version: 0.3.11
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>
@@ -19,13 +19,14 @@ Requires-Python: <4.0,>=3.11
19
19
  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
- Requires-Dist: chopdiff>=0.1.3
22
+ Requires-Dist: chopdiff>=0.2.1
23
+ Requires-Dist: clideps>=0.1.1
23
24
  Requires-Dist: colour>=0.1.5
24
25
  Requires-Dist: cssselect>=1.2.0
25
26
  Requires-Dist: deepgram-sdk>=3.10.1
26
27
  Requires-Dist: dunamai>=1.23.0
27
28
  Requires-Dist: fastapi>=0.115.11
28
- Requires-Dist: flowmark>=0.3.1
29
+ Requires-Dist: flowmark>=0.4.5
29
30
  Requires-Dist: frontmatter-format>=0.2.1
30
31
  Requires-Dist: funlog>=0.2.0
31
32
  Requires-Dist: humanfriendly>=10.0
@@ -35,14 +36,14 @@ Requires-Dist: jinja2>=3.1.6
35
36
  Requires-Dist: justext>=3.0.2
36
37
  Requires-Dist: lazyasd>=0.1.4
37
38
  Requires-Dist: litellm>=1.63.11
38
- Requires-Dist: markdownify>=0.14.1
39
+ Requires-Dist: markdownify>=0.13.1
39
40
  Requires-Dist: mcp-proxy>=0.5.0
40
41
  Requires-Dist: mcp>=1.6.0
41
42
  Requires-Dist: openai>=1.66.3
42
43
  Requires-Dist: pandas>=2.2.3
43
44
  Requires-Dist: patch-ng>=1.18.1
44
45
  Requires-Dist: pathspec>=0.12.1
45
- Requires-Dist: prettyfmt>=0.3.0
46
+ Requires-Dist: prettyfmt>=0.3.1
46
47
  Requires-Dist: prompt-toolkit>=3.0.50
47
48
  Requires-Dist: pydantic>=2.10.6
48
49
  Requires-Dist: pydub>=0.25.1
@@ -58,7 +59,7 @@ Requires-Dist: rich>=14.0.0
58
59
  Requires-Dist: ripgrepy>=2.1.0
59
60
  Requires-Dist: send2trash>=1.8.3
60
61
  Requires-Dist: setproctitle>=1.3.5
61
- Requires-Dist: strif>=2.1.0
62
+ Requires-Dist: strif>=3.0.1
62
63
  Requires-Dist: tenacity>=9.0.0
63
64
  Requires-Dist: thefuzz>=0.22.1
64
65
  Requires-Dist: tiktoken>=0.9.0
@@ -589,8 +590,9 @@ A few of the most important commands for managing files and work are these:
589
590
  browser to view it.
590
591
 
591
592
  - `workspace` shows or selects or creates a new workspace.
592
- Initially you work in the `global` workspace but for more real work you'll want to
593
- create a workspace, which is a directory to hold the files you are working with.
593
+ Initially you work in the default global workspace (typically at `~/Kash/workspace`)
594
+ but for more real work you'll want to create a workspace, which is a directory to hold
595
+ the files you are working with.
594
596
 
595
597
  - `select` shows or sets selections, which are the set of files the next command will
596
598
  run on, within the current workspace.
@@ -519,8 +519,9 @@ A few of the most important commands for managing files and work are these:
519
519
  browser to view it.
520
520
 
521
521
  - `workspace` shows or selects or creates a new workspace.
522
- Initially you work in the `global` workspace but for more real work you'll want to
523
- create a workspace, which is a directory to hold the files you are working with.
522
+ Initially you work in the default global workspace (typically at `~/Kash/workspace`)
523
+ but for more real work you'll want to create a workspace, which is a directory to hold
524
+ the files you are working with.
524
525
 
525
526
  - `select` shows or sets selections, which are the set of files the next command will
526
527
  run on, within the current workspace.
@@ -42,12 +42,13 @@ dependencies = [
42
42
  "pydantic>=2.10.6",
43
43
  "typing-extensions>=4.12.2",
44
44
  # My tools:
45
- "strif>=2.1.0",
45
+ "strif>=3.0.1",
46
46
  "funlog>=0.2.0",
47
- "prettyfmt>=0.3.0",
48
- "flowmark>=0.3.1",
47
+ "prettyfmt>=0.3.1",
48
+ "flowmark>=0.4.5",
49
49
  "frontmatter-format>=0.2.1",
50
- "chopdiff>=0.1.3",
50
+ "chopdiff>=0.2.1",
51
+ "clideps>=0.1.1",
51
52
  # Shell and file essentials:
52
53
  # python-magic is most current and works with libmagic on macOS and Linux.
53
54
  # on Windows, python-magic-bin seems like the best option.
@@ -82,7 +83,7 @@ dependencies = [
82
83
  "litellm>=1.63.11",
83
84
  # Basic text handling and web scraping:
84
85
  "readabilipy>=0.3.0",
85
- "markdownify>=0.14.1",
86
+ "markdownify>=0.13.1",
86
87
  "justext>=3.0.2",
87
88
  "cssselect>=1.2.0",
88
89
  # Minimal media handling:
@@ -115,6 +116,9 @@ dev = [
115
116
  kash = "kash.shell.shell_main:main"
116
117
  kash-mcp = "kash.mcp.mcp_cli:main"
117
118
 
119
+ [tool.uv.sources]
120
+ # For local development:
121
+ # clideps = { path = "../clideps", editable = true }
118
122
 
119
123
  # ---- Build system ----
120
124
 
@@ -1,16 +1,16 @@
1
1
  from dataclasses import dataclass
2
2
  from pathlib import Path
3
3
 
4
+ from strif import AtomicVar
5
+
4
6
  from kash.config.logger import get_logger
5
7
  from kash.config.settings import APP_NAME
6
- from kash.exec import import_action_subdirs
7
- from kash.utils.common.atomic_var import AtomicVar
8
+ from kash.exec import import_and_register
8
9
  from kash.utils.common.import_utils import import_namespace_modules
9
10
 
10
11
  log = get_logger(__name__)
11
12
 
12
- # This hook can be used for auto-registering actions from any module.
13
- import_action_subdirs(["core", "meta"], __package__, Path(__file__).parent)
13
+ import_and_register(__package__, Path(__file__).parent, ["core", "meta"])
14
14
 
15
15
 
16
16
  @dataclass(frozen=True)
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
  from kash.config.logger import get_logger
5
5
  from kash.exec import kash_action
6
6
  from kash.exec.preconditions import is_markdown
7
- from kash.model import ONE_OR_MORE_ARGS, ActionInput, ActionResult, ItemType, Param
7
+ from kash.model import ONE_OR_MORE_ARGS, ActionInput, ActionResult, Param
8
8
  from kash.utils.common.type_utils import not_none
9
9
  from kash.utils.errors import InvalidInput
10
10
 
@@ -84,9 +84,6 @@ def format_markdown_template(
84
84
  # Format the body using the mapped items.
85
85
  body = template.format(**item_map)
86
86
 
87
- result_item = items[0].derived_copy(
88
- type=ItemType.doc,
89
- body=body,
90
- )
87
+ result_item = items[0].derived_copy(body=body)
91
88
 
92
89
  return ActionResult([result_item])
@@ -1,7 +1,8 @@
1
1
  from kash.config.logger import get_logger
2
2
  from kash.exec import kash_action
3
3
  from kash.exec.preconditions import has_html_body, is_url_item
4
- from kash.model import Format, Item, ItemType
4
+ from kash.model import Format, Item
5
+ from kash.model.params_model import common_params
5
6
  from kash.web_content.file_cache_utils import get_url_html
6
7
  from kash.web_content.web_extract_readabilipy import extract_text_readabilipy
7
8
 
@@ -10,20 +11,20 @@ log = get_logger(__name__)
10
11
 
11
12
  @kash_action(
12
13
  precondition=is_url_item | has_html_body,
14
+ params=common_params("refetch"),
13
15
  mcp_tool=True,
14
16
  )
15
- def markdownify(item: Item) -> Item:
17
+ def markdownify(item: Item, refetch: bool = False) -> Item:
16
18
  """
17
19
  Converts a URL or raw HTML item to Markdown, fetching with the content
18
20
  cache if needed. Also uses readability to clean up the HTML.
19
21
  """
20
22
  from markdownify import markdownify as markdownify_convert
21
23
 
22
- url, html_content = get_url_html(item)
24
+ expiration_sec = 0 if refetch else None
25
+ url, html_content = get_url_html(item, expiration_sec=expiration_sec)
23
26
  page_data = extract_text_readabilipy(url, html_content)
24
27
  markdown_content = markdownify_convert(page_data.clean_html)
25
28
 
26
- output_item = item.derived_copy(
27
- type=ItemType.doc, format=Format.markdown, body=markdown_content
28
- )
29
+ output_item = item.derived_copy(format=Format.markdown, body=markdown_content)
29
30
  return output_item
@@ -1,7 +1,8 @@
1
1
  from kash.config.logger import get_logger
2
2
  from kash.exec import kash_action
3
3
  from kash.exec.preconditions import has_html_body, is_url_item
4
- from kash.model import Format, Item, ItemType
4
+ from kash.model import Format, Item
5
+ from kash.model.params_model import common_params
5
6
  from kash.web_content.file_cache_utils import get_url_html
6
7
  from kash.web_content.web_extract_readabilipy import extract_text_readabilipy
7
8
 
@@ -10,18 +11,18 @@ log = get_logger(__name__)
10
11
 
11
12
  @kash_action(
12
13
  precondition=is_url_item | has_html_body,
14
+ params=common_params("refetch"),
13
15
  mcp_tool=True,
14
16
  )
15
- def readability(item: Item) -> Item:
17
+ def readability(item: Item, refetch: bool = False) -> Item:
16
18
  """
17
19
  Extracts clean HTML from a raw HTML item.
18
20
  See `markdownify` to also convert to Markdown.
19
21
  """
20
- url, html_content = get_url_html(item)
22
+ expiration_sec = 0 if refetch else None
23
+ url, html_content = get_url_html(item, expiration_sec=expiration_sec)
21
24
  page_data = extract_text_readabilipy(url, html_content)
22
25
 
23
- output_item = item.derived_copy(
24
- type=ItemType.doc, format=Format.html, body=page_data.clean_html
25
- )
26
+ output_item = item.derived_copy(format=Format.html, body=page_data.clean_html)
26
27
 
27
28
  return output_item
@@ -0,0 +1,37 @@
1
+ from kash.actions.core.tabbed_webpage_config import tabbed_webpage_config
2
+ from kash.actions.core.tabbed_webpage_generate import tabbed_webpage_generate
3
+ from kash.exec import kash_action
4
+ from kash.exec.preconditions import has_full_html_page_body, has_text_body, is_html
5
+ from kash.exec_model.args_model import ONE_OR_MORE_ARGS
6
+ from kash.model import ActionInput, ActionResult, Param
7
+ from kash.model.items_model import ItemType
8
+ from kash.utils.file_utils.file_formats_model import Format
9
+ from kash.web_gen.simple_webpage import simple_webpage_render
10
+
11
+
12
+ @kash_action(
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),),
16
+ )
17
+ def render_as_html(input: ActionInput, add_title: bool = False) -> ActionResult:
18
+ """
19
+ Convert text, Markdown, or HTML to pretty, formatted HTML using a clean
20
+ and simple page template. Supports GFM-flavored Markdown tables and footnotes.
21
+
22
+ If it's a single input, the output is a simple HTML page.
23
+ If it's multiple inputs, the output is a tabbed HTML page.
24
+
25
+ This adds a header, footer, etc. so should be used on a plain document or HTML basic
26
+ page, not a full HTML page with header and body already present.
27
+ """
28
+ if len(input.items) == 1:
29
+ input_item = input.items[0]
30
+ html_body = simple_webpage_render(input_item, add_title_h1=add_title)
31
+ result_item = input_item.derived_copy(
32
+ type=ItemType.export, format=Format.html, body=html_body
33
+ )
34
+ return ActionResult([result_item])
35
+ else:
36
+ config_result = tabbed_webpage_config(input)
37
+ return tabbed_webpage_generate(ActionInput(items=config_result.items), add_title=add_title)
@@ -1,27 +1,22 @@
1
- from kash.actions.core.webpage_config import webpage_config
2
- from kash.actions.core.webpage_generate import webpage_generate
1
+ from kash.actions.core.render_as_html import render_as_html
3
2
  from kash.commands.base.show_command import show
4
- from kash.config.logger import get_logger
5
3
  from kash.exec import kash_action
6
- from kash.exec.preconditions import has_text_body, is_html
4
+ from kash.exec.preconditions import has_full_html_page_body, has_text_body, is_html
5
+ from kash.exec_model.args_model import ONE_OR_MORE_ARGS
7
6
  from kash.exec_model.commands_model import Command
8
7
  from kash.exec_model.shell_model import ShellResult
9
8
  from kash.model import ActionInput, ActionResult
10
9
 
11
- log = get_logger(__name__)
12
-
13
10
 
14
11
  @kash_action(
15
- precondition=is_html | has_text_body,
12
+ expected_args=ONE_OR_MORE_ARGS,
13
+ precondition=(is_html | has_text_body) & ~has_full_html_page_body,
16
14
  )
17
15
  def show_webpage(input: ActionInput) -> ActionResult:
18
16
  """
19
17
  Show text, Markdown, or HTML as a nicely formatted webpage.
20
18
  """
21
- config_result = webpage_config(input)
22
-
23
- log.message("Configured web page: %s", config_result)
24
- result = webpage_generate(ActionInput(items=config_result.items))
19
+ result = render_as_html(input)
25
20
 
26
21
  # Automatically show the result.
27
22
  result.shell_result = ShellResult(display_command=Command.assemble(show))
@@ -1,7 +1,7 @@
1
1
  from kash.config.logger import get_logger
2
2
  from kash.exec import kash_action
3
3
  from kash.exec.preconditions import has_html_body, has_text_body
4
- from kash.model import Format, Item, ItemType
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
7
7
 
@@ -19,10 +19,6 @@ def strip_html(item: Item) -> Item:
19
19
  raise InvalidInput("Item must have a body")
20
20
 
21
21
  clean_body = html_to_plaintext(item.body)
22
- output_item = item.derived_copy(
23
- type=ItemType.doc,
24
- format=Format.markdown,
25
- body=clean_body,
26
- )
22
+ output_item = item.derived_copy(format=Format.markdown, body=clean_body)
27
23
 
28
24
  return output_item
@@ -0,0 +1,31 @@
1
+ from kash.config.logger import get_logger
2
+ from kash.exec import kash_action
3
+ from kash.exec_model.args_model import ONE_OR_MORE_ARGS
4
+ from kash.model import ActionInput, ActionResult, Param
5
+ from kash.utils.errors import InvalidInput
6
+ from kash.web_gen import tabbed_webpage
7
+
8
+ log = get_logger(__name__)
9
+
10
+
11
+ @kash_action(
12
+ expected_args=ONE_OR_MORE_ARGS,
13
+ params=(
14
+ Param(
15
+ name="clean_headings",
16
+ type=bool,
17
+ description="Use an LLM to clean up headings.",
18
+ ),
19
+ ),
20
+ )
21
+ def tabbed_webpage_config(input: ActionInput, clean_headings: bool = False) -> ActionResult:
22
+ """
23
+ Set up a web page config with optional tabs for each page of content. Uses first item as the page title.
24
+ """
25
+ for item in input.items:
26
+ if not item.body:
27
+ raise InvalidInput(f"Item must have a body: {item}")
28
+
29
+ config_item = tabbed_webpage.tabbed_webpage_config(input.items, clean_headings)
30
+
31
+ return ActionResult([config_item])
@@ -1,7 +1,7 @@
1
1
  from kash.config.logger import get_logger
2
2
  from kash.exec import kash_action
3
3
  from kash.exec.preconditions import is_config
4
- from kash.model import ONE_ARG, ActionInput, ActionResult, FileExt, Format, Item, ItemType
4
+ from kash.model import ONE_ARG, ActionInput, ActionResult, FileExt, Format, Item, ItemType, Param
5
5
  from kash.web_gen import tabbed_webpage
6
6
 
7
7
  log = get_logger(__name__)
@@ -10,13 +10,14 @@ log = get_logger(__name__)
10
10
  @kash_action(
11
11
  expected_args=ONE_ARG,
12
12
  precondition=is_config,
13
+ params=(Param("add_title", "Add a title to the page body.", type=bool),),
13
14
  )
14
- def webpage_generate(input: ActionInput) -> ActionResult:
15
+ def tabbed_webpage_generate(input: ActionInput, add_title: bool = False) -> ActionResult:
15
16
  """
16
- Generate a web page from a configured web page item.
17
+ Generate a tabbed web page from a config item for the tabbed template.
17
18
  """
18
19
  config_item = input.items[0]
19
- html = tabbed_webpage.webpage_generate(config_item)
20
+ html = tabbed_webpage.tabbed_webpage_generate(config_item, add_title_h1=add_title)
20
21
 
21
22
  webpage_item = Item(
22
23
  title=config_item.title,
@@ -0,0 +1,9 @@
1
+ from pathlib import Path
2
+
3
+ from kash.exec.importing import import_and_register
4
+
5
+ import_and_register(
6
+ __package__,
7
+ Path(__file__).parent,
8
+ ["base", "extras", "help", "workspace"],
9
+ )
@@ -7,6 +7,7 @@ from strif import copyfile_atomic
7
7
  from kash.config.logger import get_logger
8
8
  from kash.config.text_styles import STYLE_EMPH
9
9
  from kash.exec import assemble_path_args, kash_command, resolve_path_arg
10
+ from kash.model.paths_model import StorePath
10
11
  from kash.shell.output.shell_output import (
11
12
  PadStyle,
12
13
  PrintHooks,
@@ -21,6 +22,7 @@ from kash.utils.common.format_utils import fmt_loc
21
22
  from kash.utils.errors import InvalidInput
22
23
  from kash.utils.file_utils.file_formats_model import detect_file_format
23
24
  from kash.workspaces.workspace_output import print_file_info
25
+ from kash.workspaces.workspaces import current_ws
24
26
 
25
27
  log = get_logger(__name__)
26
28
 
@@ -149,7 +151,20 @@ def trash(*paths: str) -> None:
149
151
  """
150
152
 
151
153
  resolved_paths = assemble_path_args(*paths)
154
+
155
+ ws = current_ws()
156
+ affected_store_paths = [
157
+ p for p in resolved_paths if isinstance(p, StorePath) and (ws.base_dir / p).exists()
158
+ ]
159
+
152
160
  native_trash(*resolved_paths)
161
+
162
+ if affected_store_paths:
163
+ log.info(
164
+ "Refreshing current selection due to deleted store paths: %s", affected_store_paths
165
+ )
166
+ ws.selections.refresh_current(ws.base_dir)
167
+
153
168
  print_status(f"Deleted (check trash or recycling bin to recover):\n{fmt_lines(resolved_paths)}")
154
169
 
155
170
 
@@ -213,3 +213,16 @@ def reload_commands_and_actions() -> None:
213
213
 
214
214
  reload_shell_commands_and_actions()
215
215
  log_command_action_info()
216
+
217
+
218
+ @kash_command
219
+ def debug_exception() -> None:
220
+ """
221
+ Useful to debug exception handling/printing in xonsh.
222
+ """
223
+
224
+ def raise_exception():
225
+ cprint("Raising an unexpected exception to test the exception handler.")
226
+ raise Exception("This is a test exception.")
227
+
228
+ raise_exception()
@@ -75,6 +75,9 @@ 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
79
+
80
+
78
81
  @kash_command
79
82
  def files(
80
83
  *paths: str,
@@ -108,9 +111,11 @@ def files(
108
111
  and grouping.
109
112
 
110
113
  :param overview: Recurse a couple levels and show files, but not too many.
111
- Same as `--groupby=parent --depth=2 --max_per_group=10 --omit_dirs`.
114
+ Same as `--groupby=parent --depth=2 --max_per_group=100 --omit_dirs`
115
+ except also scales down `max_per_group` to 25 or 50 if there are many files.
112
116
  :param recent: Only shows the most recently modified files in each directory.
113
- Same as `--sort=modified --reverse --groupby=parent --max_per_group=10`.
117
+ Same as `--sort=modified --reverse --groupby=parent --max_per_group=100`
118
+ except also scales down `max_per_group` to 25 or 50 if there are many files.
114
119
  :param recursive: List all files recursively. Same as `--depth=-1`.
115
120
  :param flat: Show files in a flat list, rather than grouped by parent directory.
116
121
  Same as `--groupby=flat`.
@@ -179,16 +184,17 @@ def files(
179
184
  # Within workspaces, we show more files by default since they are always in
180
185
  # subdirectories.
181
186
  overview = True # Handled next.
187
+ cap_per_group = False
182
188
  if overview:
183
- max_per_group = 10 if max_per_group <= 0 else max_per_group
184
189
  groupby = GroupByOption.parent if groupby is None else groupby
185
190
  depth = 2 if depth is None else depth
191
+ cap_per_group = True
186
192
  omit_dirs = True
187
193
  if recent:
188
- max_per_group = 10 if max_per_group <= 0 else max_per_group
189
194
  groupby = GroupByOption.parent if groupby is None else groupby
190
195
  depth = 2 if depth is None else depth
191
196
  sort = SortOption.modified if sort is None else sort
197
+ cap_per_group = True
192
198
  reverse = True
193
199
  if flat:
194
200
  groupby = GroupByOption.flat
@@ -291,6 +297,18 @@ def files(
291
297
 
292
298
  return ShellResult(show_selection=True)
293
299
 
300
+ # Unless max_per_group is explicit, use heuristics to limit per group if
301
+ # there are lots of groups and lots of files per group.
302
+ # Default is max 100 per group but if we have 4 * 100 items, cut to 25.
303
+ # 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
+ max_pg_explicit = max_per_group > 0
306
+ if not max_pg_explicit:
307
+ group_lens = [len(group_df) for group_df in grouped]
308
+ for ratio in [2, 4]:
309
+ if sum(group_lens) > ratio * DEFAULT_MAX_PG:
310
+ final_max_pg = int(DEFAULT_MAX_PG / ratio)
311
+
294
312
  total_displayed = 0
295
313
  total_displayed_size = 0
296
314
  now = datetime.now(UTC)
@@ -312,8 +330,8 @@ def files(
312
330
  text_wrap=Wrap.NONE,
313
331
  )
314
332
 
315
- if max_per_group > 0:
316
- display_df = group_df.head(max_per_group)
333
+ if final_max_pg > 0:
334
+ display_df = group_df.head(final_max_pg)
317
335
  else:
318
336
  display_df = group_df
319
337
 
@@ -378,9 +396,9 @@ def files(
378
396
  total_displayed_size += row.size
379
397
 
380
398
  # Indicate if items are omitted.
381
- if groupby and max_per_group > 0 and len(group_df) > max_per_group:
399
+ if groupby and final_max_pg > 0 and len(group_df) > final_max_pg:
382
400
  cprint(
383
- f"{indent}… and {len(group_df) - max_per_group} more files",
401
+ f"{indent}… and {len(group_df) - final_max_pg} more files",
384
402
  style=COLOR_EXTRA,
385
403
  text_wrap=Wrap.NONE,
386
404
  )
@@ -388,9 +406,9 @@ def files(
388
406
  if group_name:
389
407
  PrintHooks.spacer()
390
408
 
391
- if not groupby and max_per_group > 0 and items_matching > max_per_group:
409
+ if not groupby and final_max_pg > 0 and items_matching > final_max_pg:
392
410
  cprint(
393
- f"{indent}… and {items_matching - max_per_group} more files",
411
+ f"{indent}… and {items_matching - final_max_pg} more files",
394
412
  style=COLOR_EXTRA,
395
413
  text_wrap=Wrap.NONE,
396
414
  )
@@ -1,9 +1,15 @@
1
+ from clideps.env_vars.dotenv_setup import interactive_dotenv_setup
2
+ from clideps.env_vars.dotenv_utils import load_dotenv_paths
3
+ from clideps.env_vars.env_check import format_dotenv_check, format_env_var_check, print_env_check
4
+ from clideps.env_vars.env_names import get_all_common_env_names
5
+ from clideps.pkgs.pkg_check import pkg_check
6
+ from clideps.terminal.terminal_features import terminal_check
1
7
  from flowmark import Wrap
8
+ from rich.text import Text
2
9
 
3
10
  from kash.commands.base.model_commands import list_apis, list_models
4
- from kash.commands.workspace.workspace_commands import list_params
5
11
  from kash.config.logger import get_logger
6
- from kash.config.settings import RECOMMENDED_API_KEYS, get_system_config_dir
12
+ from kash.config.settings import RECOMMENDED_API_KEYS, global_settings
7
13
  from kash.docs.all_docs import all_docs
8
14
  from kash.exec import kash_command
9
15
  from kash.help.tldr_help import tldr_refresh_cache
@@ -14,14 +20,6 @@ from kash.model.params_model import (
14
20
  DEFAULT_STANDARD_LLM,
15
21
  DEFAULT_STRUCTURED_LLM,
16
22
  )
17
- from kash.shell.clideps.api_keys import (
18
- ApiEnvKey,
19
- load_dotenv_paths,
20
- print_api_key_setup,
21
- )
22
- from kash.shell.clideps.dotenv_setup import interactive_dotenv_setup
23
- from kash.shell.clideps.pkg_deps import pkg_check
24
- from kash.shell.clideps.terminal_features import terminal_check
25
23
  from kash.shell.input.input_prompts import input_choice
26
24
  from kash.shell.output.shell_formatting import format_name_and_value
27
25
  from kash.shell.output.shell_output import (
@@ -50,8 +48,13 @@ def self_check(brief: bool = False) -> None:
50
48
  Self-check kash setup, including termal settings, tools, and API keys.
51
49
  """
52
50
  if brief:
53
- terminal_check().print_term_info()
54
- print_api_key_setup(recommended_keys=RECOMMENDED_API_KEYS, once=False)
51
+ cprint(terminal_check().formatted())
52
+ cprint(Text.assemble("Dotenv files: ", format_dotenv_check()))
53
+ cprint(
54
+ Text.assemble(
55
+ "Env vars: ", format_env_var_check(env_vars=RECOMMENDED_API_KEYS, one_line=True)
56
+ )
57
+ )
55
58
  check_system_tools(brief=brief)
56
59
  tldr_refresh_cache()
57
60
  try:
@@ -63,7 +66,7 @@ def self_check(brief: bool = False) -> None:
63
66
  else:
64
67
  version()
65
68
  cprint()
66
- terminal_check().print_term_info()
69
+ cprint(terminal_check().formatted())
67
70
  cprint()
68
71
  list_apis()
69
72
  cprint()
@@ -88,9 +91,10 @@ def self_configure(all: bool = False, update: bool = False) -> None:
88
91
  """
89
92
  Interactively configure API keys and preferred models.
90
93
  """
94
+ from kash.commands.workspace.workspace_commands import params as list_params
91
95
 
92
96
  if all:
93
- api_keys = [key.value for key in ApiEnvKey]
97
+ api_keys = list(set(get_all_common_env_names() + RECOMMENDED_API_KEYS))
94
98
  else:
95
99
  api_keys = RECOMMENDED_API_KEYS
96
100
  # Show APIs before starting.
@@ -177,10 +181,11 @@ def reload_env() -> None:
177
181
  Reload the environment variables from the .env file.
178
182
  """
179
183
 
180
- env_paths = load_dotenv_paths(True, True, get_system_config_dir())
184
+ env_paths = load_dotenv_paths(True, True, global_settings().system_config_dir)
181
185
  if env_paths:
182
186
  cprint("Reloaded environment variables")
183
- print_api_key_setup(RECOMMENDED_API_KEYS)
187
+
188
+ print_env_check(RECOMMENDED_API_KEYS)
184
189
  else:
185
190
  raise InvalidState("No .env file found")
186
191
 
@@ -7,7 +7,7 @@ from kash.config.logger import get_log_settings, get_logger, reload_rich_logging
7
7
  from kash.config.settings import (
8
8
  LogLevel,
9
9
  atomic_global_settings,
10
- local_server_log_path,
10
+ global_settings,
11
11
  )
12
12
  from kash.exec import kash_command
13
13
  from kash.shell.output.shell_formatting import format_name_and_value
@@ -85,4 +85,6 @@ def log_settings() -> None:
85
85
  cprint(format_name_and_value("log_objects_dir", str(settings.log_objects_dir)))
86
86
  cprint(format_name_and_value("log_file_level", settings.log_file_level.name))
87
87
  cprint(format_name_and_value("log_console_level", settings.log_console_level.name))
88
- cprint(format_name_and_value("server_log_file_path", str(local_server_log_path())))
88
+ cprint(
89
+ format_name_and_value("server_log_file_path", str(global_settings().local_server_log_path))
90
+ )