kon-coding-agent 0.3.10__tar.gz → 0.4.0__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 (189) hide show
  1. {kon_coding_agent-0.3.10/.kon → kon_coding_agent-0.4.0/.agents}/skills/kon-release-publish/SKILL.md +1 -1
  2. {kon_coding_agent-0.3.10/.kon → kon_coding_agent-0.4.0/.agents}/skills/kon-tmux-test/SKILL.md +1 -1
  3. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/CHANGELOG.md +55 -0
  4. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/PKG-INFO +49 -18
  5. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/README.md +48 -17
  6. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/pyproject.toml +2 -2
  7. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/scripts/show_themes.py +1 -1
  8. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/__init__.py +14 -0
  9. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/builtin_skills/init/SKILL.md +1 -1
  10. kon_coding_agent-0.4.0/src/kon/builtin_skills/review/SKILL.md +72 -0
  11. kon_coding_agent-0.4.0/src/kon/cli.py +98 -0
  12. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/config.py +132 -4
  13. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/context/agent_mds.py +6 -6
  14. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/context/skills.py +42 -12
  15. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/defaults/config.toml +12 -4
  16. kon_coding_agent-0.4.0/src/kon/diff_display.py +12 -0
  17. kon_coding_agent-0.4.0/src/kon/gh_cli.py +82 -0
  18. kon_coding_agent-0.4.0/src/kon/headless.py +127 -0
  19. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/__init__.py +2 -0
  20. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/base.py +20 -0
  21. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/models.py +11 -47
  22. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/oauth/__init__.py +2 -0
  23. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/oauth/copilot.py +3 -1
  24. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/oauth/openai.py +10 -5
  25. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/anthropic.py +65 -37
  26. kon_coding_agent-0.4.0/src/kon/llm/providers/anthropic_capabilities.py +121 -0
  27. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/azure_ai_foundry.py +4 -2
  28. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/copilot_anthropic.py +24 -20
  29. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/openai_codex_responses.py +366 -32
  30. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/openai_completions.py +9 -1
  31. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/openai_responses.py +2 -1
  32. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/runtime.py +20 -18
  33. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/session.py +2 -3
  34. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/themes.py +265 -5
  35. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/edit.py +81 -34
  36. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/write.py +7 -2
  37. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools_manager.py +5 -9
  38. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/turn.py +21 -0
  39. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/app.py +92 -105
  40. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/autocomplete.py +63 -0
  41. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/blocks.py +79 -7
  42. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/chat.py +42 -38
  43. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/commands.py +184 -60
  44. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/export.py +2 -2
  45. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/floating_list.py +21 -27
  46. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/formatting.py +82 -0
  47. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/input.py +17 -6
  48. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/prompt_history.py +2 -2
  49. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/selection_mode.py +2 -0
  50. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/styles.py +24 -15
  51. kon_coding_agent-0.4.0/src/kon/version.py +22 -0
  52. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/conftest.py +7 -0
  53. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/context/test_agents.py +12 -0
  54. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/context/test_skills.py +33 -9
  55. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/llm/test_anthropic_provider.py +75 -2
  56. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/llm/test_openai_codex_provider_errors.py +345 -14
  57. kon_coding_agent-0.4.0/tests/llm/test_openai_oauth.py +86 -0
  58. kon_coding_agent-0.4.0/tests/llm/test_tls_verify.py +44 -0
  59. kon_coding_agent-0.4.0/tests/test_cli.py +35 -0
  60. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_cli_auth_flags.py +9 -8
  61. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_cli_provider_resolution.py +1 -8
  62. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_compaction.py +10 -0
  63. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_config_binaries.py +3 -1
  64. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_config_error_fallback.py +6 -5
  65. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_config_migration.py +7 -9
  66. kon_coding_agent-0.4.0/tests/test_headless.py +207 -0
  67. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_llm_lazy_imports.py +7 -1
  68. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_local_auth_config.py +1 -1
  69. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_model_provider_resolution.py +6 -6
  70. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_notifications_config.py +1 -1
  71. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_openai_compat.py +3 -3
  72. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_runtime_switch_model.py +46 -3
  73. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_system_prompt.py +1 -1
  74. kon_coding_agent-0.4.0/tests/test_tools_manager.py +42 -0
  75. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_diff.py +35 -20
  76. kon_coding_agent-0.4.0/tests/tools/test_edit_display.py +45 -0
  77. kon_coding_agent-0.4.0/tests/ui/test_completion_chrome.py +497 -0
  78. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_floating_list.py +17 -0
  79. kon_coding_agent-0.4.0/tests/ui/test_login_command.py +189 -0
  80. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_permission_selection_status.py +3 -2
  81. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_permissions_command.py +18 -1
  82. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_styles.py +9 -0
  83. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_thinking_notifications_commands.py +18 -1
  84. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_tool_output_expansion.py +36 -0
  85. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/uv.lock +1 -1
  86. kon_coding_agent-0.3.10/tests/llm/test_openai_oauth.py +0 -14
  87. kon_coding_agent-0.3.10/tests/test_tools_manager.py +0 -18
  88. kon_coding_agent-0.3.10/tests/tools/test_edit_display.py +0 -38
  89. {kon_coding_agent-0.3.10/.kon → kon_coding_agent-0.4.0/.agents}/skills/kon-tmux-test/run-e2e-tests.sh +0 -0
  90. {kon_coding_agent-0.3.10/.kon → kon_coding_agent-0.4.0/.agents}/skills/kon-tmux-test/setup-test-project.sh +0 -0
  91. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/.github/workflows/test.yml +0 -0
  92. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/.gitignore +0 -0
  93. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/.python-version +0 -0
  94. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/AGENTS.md +0 -0
  95. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/LICENSE +0 -0
  96. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/docs/e2e-test-coverage-review.md +0 -0
  97. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/docs/images/kon-screenshot.png +0 -0
  98. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/docs/local-models.md +0 -0
  99. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/async_utils.py +0 -0
  100. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/context/__init__.py +0 -0
  101. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/context/_xml.py +0 -0
  102. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/context/git.py +0 -0
  103. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/context/loader.py +0 -0
  104. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/core/__init__.py +0 -0
  105. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/core/compaction.py +0 -0
  106. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/core/handoff.py +0 -0
  107. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/core/types.py +0 -0
  108. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/defaults/__init__.py +0 -0
  109. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/events.py +0 -0
  110. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/git_branch.py +0 -0
  111. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/__init__.py +0 -0
  112. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/copilot.py +0 -0
  113. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/github_copilot_headers.py +0 -0
  114. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/mock.py +0 -0
  115. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/openai_compat.py +0 -0
  116. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/llm/providers/sanitize.py +0 -0
  117. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/loop.py +0 -0
  118. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/notify.py +0 -0
  119. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/permissions.py +0 -0
  120. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/py.typed +0 -0
  121. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/sounds/completion.wav +0 -0
  122. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/sounds/error.wav +0 -0
  123. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/sounds/permission.wav +0 -0
  124. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/__init__.py +0 -0
  125. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/_read_image.py +0 -0
  126. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/_tool_utils.py +0 -0
  127. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/base.py +0 -0
  128. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/bash.py +0 -0
  129. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/find.py +0 -0
  130. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/grep.py +0 -0
  131. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/read.py +0 -0
  132. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/web_fetch.py +0 -0
  133. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/tools/web_search.py +0 -0
  134. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/__init__.py +0 -0
  135. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/app_protocol.py +0 -0
  136. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/clipboard.py +0 -0
  137. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/latex.py +0 -0
  138. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/path_complete.py +0 -0
  139. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/session_ui.py +0 -0
  140. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/tool_output.py +0 -0
  141. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/tree.py +0 -0
  142. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/welcome.py +0 -0
  143. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/ui/widgets.py +0 -0
  144. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/src/kon/update_check.py +0 -0
  145. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/llm/__init__.py +0 -0
  146. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/llm/test_azure_ai_foundry_provider.py +0 -0
  147. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/llm/test_mock_provider.py +0 -0
  148. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_agentic_loop.py +0 -0
  149. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_config_injection.py +0 -0
  150. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_git_branch.py +0 -0
  151. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_handoff.py +0 -0
  152. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_handoff_link_interrupt.py +0 -0
  153. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_launch_warnings.py +0 -0
  154. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_notify.py +0 -0
  155. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_permissions.py +0 -0
  156. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_session_persistence.py +0 -0
  157. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_session_queries.py +0 -0
  158. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_session_resume.py +0 -0
  159. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_session_tree.py +0 -0
  160. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_system_prompt_git_context.py +0 -0
  161. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_themes.py +0 -0
  162. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_ui_notifications.py +0 -0
  163. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_update_check.py +0 -0
  164. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/test_update_notice_behavior.py +0 -0
  165. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_bash_truncation.py +0 -0
  166. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_edit.py +0 -0
  167. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_read.py +0 -0
  168. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_read_image.py +0 -0
  169. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_read_image_integration.py +0 -0
  170. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_read_image_resize.py +0 -0
  171. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_subprocess_cancellation.py +0 -0
  172. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_web_fetch.py +0 -0
  173. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/tools/test_write.py +0 -0
  174. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_app_approval_keys.py +0 -0
  175. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_autocomplete.py +0 -0
  176. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_info_bar_clicks.py +0 -0
  177. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_info_bar_permissions.py +0 -0
  178. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_input_approval_submit.py +0 -0
  179. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_input_cursor_theme.py +0 -0
  180. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_input_handoff.py +0 -0
  181. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_input_paste.py +0 -0
  182. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_input_shell_style.py +0 -0
  183. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_keybindings.py +0 -0
  184. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_latex.py +0 -0
  185. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_prompt_history.py +0 -0
  186. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_queue_editing.py +0 -0
  187. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_shell_command_detection.py +0 -0
  188. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_status_line.py +0 -0
  189. {kon_coding_agent-0.3.10 → kon_coding_agent-0.4.0}/tests/ui/test_streaming_blocks.py +0 -0
@@ -24,7 +24,7 @@ Use this skill when the user asks to cut a new Kon version, tag it, publish to P
24
24
  ## Files to bump
25
25
 
26
26
  - `pyproject.toml` → `[project].version`
27
- - `src/kon/ui/app.py` → fallback `VERSION = "..."`
27
+ - `src/kon/version.py` → fallback `VERSION = "..."`
28
28
  - `uv.lock` → local package version block
29
29
 
30
30
  ## Release workflow
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: kon-tmux-test
3
- description: E2E testing of kon using tmux sessions; IMPORTANT: only trigger this skill when user asks for e2e testing of kon
3
+ description: "E2E testing of kon using tmux sessions; IMPORTANT: only trigger this skill when user asks for e2e testing of kon"
4
4
  ---
5
5
 
6
6
  # Kon Tmux E2E Testing
@@ -6,6 +6,61 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  - No changes yet.
8
8
 
9
+ ## 0.4.0 - 2026-05-31
10
+
11
+ ### Added
12
+
13
+ - Added non-interactive `-p`/`--prompt` headless mode - @Meltedd.
14
+ - Added pull request autocomplete.
15
+ - Added review slash skill and updated review rubric.
16
+ - Added thinking display settings.
17
+ - Added diff rendering improvements.
18
+ - Added git context toggle to settings UI and exported `set_git_context`.
19
+
20
+ ### Changed
21
+
22
+ - Extracted Textual-free CLI entry point.
23
+
24
+ ### Fixed
25
+
26
+ - Aligned agent context paths.
27
+ - Clipped diff output lines.
28
+ - Used warning symbol for chat notices.
29
+ - Replaced `math.fma` for Python 3.12 compatibility.
30
+ - Removed unsupported GLM-4.7 and GPT models below 5.5 from Copilot and Codex providers.
31
+
32
+ ## 0.3.11 - 2026-05-29
33
+
34
+ ### Added
35
+
36
+ - Added `insecure_skip_verify` for local providers using self-signed certificates - @s3rj1k.
37
+ - Added per-model Anthropic capability registry and thinking config improvements.
38
+ - Added Claude Opus 4.7 Azure model entry.
39
+ - Added migration of user data from `~/.kon` to `~/.config/kon` and `~/.agents`.
40
+ - Added bash command header highlighting.
41
+ - Added persisted UI settings toggles.
42
+
43
+ ### Changed
44
+
45
+ - Migrated context system paths for skills and `AGENTS.md` to `.agents`.
46
+ - Centralized internal path handling and removed legacy Kon path migration.
47
+ - Updated default Codex model and authentication guidance.
48
+ - Refined `/init`, `/resume`, thinking UI, and theme styling.
49
+
50
+ ### Fixed
51
+
52
+ - Honored `request_timeout_seconds` in insecure-skip-verify HTTP clients - @s3rj1k.
53
+ - Fixed loaded resource display before agent initialization.
54
+ - Fixed OpenAI Codex transport, websocket interrupt handling, and SSE fallback behavior.
55
+ - Fixed UI completion path handling.
56
+ - Fixed empty thinking block handling and empty-compaction error display.
57
+ - Fixed duplicate home skill loading and skill frontmatter parsing.
58
+ - Fixed stale OAuth login state and completion popup info bar behavior - @Meltedd.
59
+
60
+ ### Tests
61
+
62
+ - Updated config, login, migration, and compaction test coverage.
63
+
9
64
  ## 0.3.10 - 2026-05-21
10
65
 
11
66
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kon-coding-agent
3
- Version: 0.3.10
3
+ Version: 0.4.0
4
4
  Summary: Minimal coding agent
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -89,34 +89,48 @@ kon
89
89
  ```text
90
90
  usage: kon [-h] [--model MODEL]
91
91
  [--provider {azure-ai-foundry,deepseek,github-copilot,openai,openai-codex,openai-responses,zhipu}]
92
- [--api-key API_KEY] [--base-url BASE_URL] [--continue]
93
- [--resume RESUME_SESSION] [--version]
94
- [--extra-tools EXTRA_TOOLS]
92
+ [--prompt [PROMPT]] [--api-key API_KEY] [--base-url BASE_URL]
93
+ [--openai-compat-auth {auto,required,none}]
94
+ [--anthropic-compat-auth {auto,required,none}]
95
+ [--insecure-skip-verify] [--continue] [--resume RESUME_SESSION]
96
+ [--version] [--extra-tools EXTRA_TOOLS]
95
97
 
96
- Kon TUI
98
+ Kon
97
99
 
98
100
  options:
99
101
  -h, --help show this help message and exit
100
102
  --model, -m MODEL Model to use
101
- --provider, -p {azure-ai-foundry,deepseek,github-copilot,openai,openai-codex,openai-responses,zhipu}
103
+ --provider {azure-ai-foundry,deepseek,github-copilot,openai,openai-codex,openai-responses,zhipu}
102
104
  Provider to use
105
+ --prompt, -p [PROMPT]
106
+ Run a single prompt non-interactively, then exit (omit
107
+ the value or pipe stdin to read the prompt from stdin)
103
108
  --api-key, -k API_KEY
104
109
  API key
105
110
  --base-url, -u BASE_URL
106
111
  Base URL for API
112
+ --openai-compat-auth {auto,required,none}
113
+ Auth mode for OpenAI-compatible endpoints
114
+ --anthropic-compat-auth {auto,required,none}
115
+ Auth mode for Anthropic-compatible endpoints
116
+ --insecure-skip-verify
117
+ Skip TLS verification (e.g. self-signed certs on local
118
+ providers)
107
119
  --continue, -c Resume the most recent session
108
120
  --resume, -r RESUME_SESSION
109
- Resume a specific session by ID (full or unique prefix)
121
+ Resume a specific session by ID (full or unique
122
+ prefix)
110
123
  --version show program's version number and exit
111
124
  --extra-tools EXTRA_TOOLS
112
- Comma-separated extra tools to enable (e.g. web_search,web_fetch)
125
+ Comma-separated extra tools to enable (e.g.
126
+ web_search,web_fetch)
113
127
  ```
114
128
 
115
129
  ### Common examples
116
130
 
117
131
  ```bash
118
- # choose a model explicitly
119
- kon -p openai-codex -m gpt-5.4
132
+ # choose a provider and model explicitly
133
+ kon --provider openai-codex -m gpt-5.4
120
134
 
121
135
  # continue your latest session
122
136
  kon -c
@@ -140,6 +154,23 @@ kon --extra-tools web_search,web_fetch
140
154
  !!find . -name "*.py" | head -20
141
155
  ```
142
156
 
157
+ ### Non-interactive
158
+
159
+ Run a single prompt headlessly with `-p`/`--prompt`, then exit:
160
+
161
+ ```bash
162
+ # pass the prompt inline
163
+ kon -p "fix the failing test"
164
+
165
+ # read the prompt from stdin
166
+ cat task.md | kon -p
167
+
168
+ # capture the final response
169
+ kon -p "summarize this module" > out.txt
170
+ ```
171
+
172
+ In this mode tools run **auto-approved** (no confirmation prompts). The final assistant response is printed to stdout on a clean finish; errors go to stderr. Exit codes: `0` completed, `1` error, `2` startup error (empty prompt or provider/init failure), `3` hit the max-turn limit. Session flags (`-c`/`--continue`, `-r`/`--resume`) aren't supported in this mode.
173
+
143
174
  ### Install from source
144
175
 
145
176
  ```bash
@@ -175,7 +206,7 @@ If you want a coding agent you can read, understand, fork, and adapt without inh
175
206
  Kon stores config at:
176
207
 
177
208
  ```text
178
- ~/.kon/config.toml
209
+ ~/.config/kon/config.toml
179
210
  ```
180
211
 
181
212
  It is created automatically on first run, and old schemas are migrated forward automatically when needed.
@@ -256,7 +287,7 @@ Enable them from the CLI:
256
287
  kon --extra-tools web_search,web_fetch
257
288
  ```
258
289
 
259
- Or in `~/.kon/config.toml`:
290
+ Or in `~/.config/kon/config.toml`:
260
291
 
261
292
  ```toml
262
293
  [tools]
@@ -369,7 +400,7 @@ Kon supports direct shell command execution from the input box using two prefixe
369
400
  Kon stores sessions as append-only **JSONL** files in:
370
401
 
371
402
  ```text
372
- ~/.kon/sessions/
403
+ ~/.config/kon/sessions/
373
404
  ```
374
405
 
375
406
  That keeps sessions easy to inspect, archive, and move around.
@@ -429,8 +460,8 @@ Kon loads project guidance from `AGENTS.md` or `CLAUDE.md` files into the system
429
460
 
430
461
  Load order:
431
462
 
432
- 1. `~/.kon/AGENTS.md`
433
- 2. matching ancestor directories from git root (or home) down to the current working directory
463
+ 1. `~/.config/kon/AGENTS.md`
464
+ 2. matching `AGENTS.md` or `CLAUDE.md` files in ancestor directories from git root (or home) down to the current working directory
434
465
 
435
466
  Use these files for repo conventions, test commands, code style notes, deployment steps, or anything else you want loaded automatically.
436
467
 
@@ -438,8 +469,8 @@ Use these files for repo conventions, test commands, code style notes, deploymen
438
469
 
439
470
  Skills are reusable instruction packs discovered from:
440
471
 
441
- - project: `.kon/skills/`
442
- - global: `~/.kon/skills/`
472
+ - project: `.agents/skills/`
473
+ - global: `~/.agents/skills/`
443
474
 
444
475
  Each skill lives in its own directory with a `SKILL.md` file.
445
476
 
@@ -512,7 +543,7 @@ kon --provider deepseek --model deepseek-v4-flash
512
543
 
513
544
  ### Local models
514
545
 
515
- Kon works well with local models served through an OpenAI-compatible endpoint. For one-off launches, you can force unauthenticated local behavior with `--openai-compat-auth none` or `--anthropic-compat-auth none`. To make that persistent across sessions, set `[llm.auth] openai_compat = "auto"|"none"` and/or `anthropic_compat = "auto"|"none"` in `~/.kon/config.toml`.
546
+ Kon works well with local models served through an OpenAI-compatible endpoint. For one-off launches, you can force unauthenticated local behavior with `--openai-compat-auth none` or `--anthropic-compat-auth none`. To make that persistent across sessions, set `[llm.auth] openai_compat = "auto"|"none"` and/or `anthropic_compat = "auto"|"none"` in `~/.config/kon/config.toml`.
516
547
 
517
548
  More notes, tested models, and examples live in [docs/local-models.md](docs/local-models.md).
518
549
 
@@ -69,34 +69,48 @@ kon
69
69
  ```text
70
70
  usage: kon [-h] [--model MODEL]
71
71
  [--provider {azure-ai-foundry,deepseek,github-copilot,openai,openai-codex,openai-responses,zhipu}]
72
- [--api-key API_KEY] [--base-url BASE_URL] [--continue]
73
- [--resume RESUME_SESSION] [--version]
74
- [--extra-tools EXTRA_TOOLS]
72
+ [--prompt [PROMPT]] [--api-key API_KEY] [--base-url BASE_URL]
73
+ [--openai-compat-auth {auto,required,none}]
74
+ [--anthropic-compat-auth {auto,required,none}]
75
+ [--insecure-skip-verify] [--continue] [--resume RESUME_SESSION]
76
+ [--version] [--extra-tools EXTRA_TOOLS]
75
77
 
76
- Kon TUI
78
+ Kon
77
79
 
78
80
  options:
79
81
  -h, --help show this help message and exit
80
82
  --model, -m MODEL Model to use
81
- --provider, -p {azure-ai-foundry,deepseek,github-copilot,openai,openai-codex,openai-responses,zhipu}
83
+ --provider {azure-ai-foundry,deepseek,github-copilot,openai,openai-codex,openai-responses,zhipu}
82
84
  Provider to use
85
+ --prompt, -p [PROMPT]
86
+ Run a single prompt non-interactively, then exit (omit
87
+ the value or pipe stdin to read the prompt from stdin)
83
88
  --api-key, -k API_KEY
84
89
  API key
85
90
  --base-url, -u BASE_URL
86
91
  Base URL for API
92
+ --openai-compat-auth {auto,required,none}
93
+ Auth mode for OpenAI-compatible endpoints
94
+ --anthropic-compat-auth {auto,required,none}
95
+ Auth mode for Anthropic-compatible endpoints
96
+ --insecure-skip-verify
97
+ Skip TLS verification (e.g. self-signed certs on local
98
+ providers)
87
99
  --continue, -c Resume the most recent session
88
100
  --resume, -r RESUME_SESSION
89
- Resume a specific session by ID (full or unique prefix)
101
+ Resume a specific session by ID (full or unique
102
+ prefix)
90
103
  --version show program's version number and exit
91
104
  --extra-tools EXTRA_TOOLS
92
- Comma-separated extra tools to enable (e.g. web_search,web_fetch)
105
+ Comma-separated extra tools to enable (e.g.
106
+ web_search,web_fetch)
93
107
  ```
94
108
 
95
109
  ### Common examples
96
110
 
97
111
  ```bash
98
- # choose a model explicitly
99
- kon -p openai-codex -m gpt-5.4
112
+ # choose a provider and model explicitly
113
+ kon --provider openai-codex -m gpt-5.4
100
114
 
101
115
  # continue your latest session
102
116
  kon -c
@@ -120,6 +134,23 @@ kon --extra-tools web_search,web_fetch
120
134
  !!find . -name "*.py" | head -20
121
135
  ```
122
136
 
137
+ ### Non-interactive
138
+
139
+ Run a single prompt headlessly with `-p`/`--prompt`, then exit:
140
+
141
+ ```bash
142
+ # pass the prompt inline
143
+ kon -p "fix the failing test"
144
+
145
+ # read the prompt from stdin
146
+ cat task.md | kon -p
147
+
148
+ # capture the final response
149
+ kon -p "summarize this module" > out.txt
150
+ ```
151
+
152
+ In this mode tools run **auto-approved** (no confirmation prompts). The final assistant response is printed to stdout on a clean finish; errors go to stderr. Exit codes: `0` completed, `1` error, `2` startup error (empty prompt or provider/init failure), `3` hit the max-turn limit. Session flags (`-c`/`--continue`, `-r`/`--resume`) aren't supported in this mode.
153
+
123
154
  ### Install from source
124
155
 
125
156
  ```bash
@@ -155,7 +186,7 @@ If you want a coding agent you can read, understand, fork, and adapt without inh
155
186
  Kon stores config at:
156
187
 
157
188
  ```text
158
- ~/.kon/config.toml
189
+ ~/.config/kon/config.toml
159
190
  ```
160
191
 
161
192
  It is created automatically on first run, and old schemas are migrated forward automatically when needed.
@@ -236,7 +267,7 @@ Enable them from the CLI:
236
267
  kon --extra-tools web_search,web_fetch
237
268
  ```
238
269
 
239
- Or in `~/.kon/config.toml`:
270
+ Or in `~/.config/kon/config.toml`:
240
271
 
241
272
  ```toml
242
273
  [tools]
@@ -349,7 +380,7 @@ Kon supports direct shell command execution from the input box using two prefixe
349
380
  Kon stores sessions as append-only **JSONL** files in:
350
381
 
351
382
  ```text
352
- ~/.kon/sessions/
383
+ ~/.config/kon/sessions/
353
384
  ```
354
385
 
355
386
  That keeps sessions easy to inspect, archive, and move around.
@@ -409,8 +440,8 @@ Kon loads project guidance from `AGENTS.md` or `CLAUDE.md` files into the system
409
440
 
410
441
  Load order:
411
442
 
412
- 1. `~/.kon/AGENTS.md`
413
- 2. matching ancestor directories from git root (or home) down to the current working directory
443
+ 1. `~/.config/kon/AGENTS.md`
444
+ 2. matching `AGENTS.md` or `CLAUDE.md` files in ancestor directories from git root (or home) down to the current working directory
414
445
 
415
446
  Use these files for repo conventions, test commands, code style notes, deployment steps, or anything else you want loaded automatically.
416
447
 
@@ -418,8 +449,8 @@ Use these files for repo conventions, test commands, code style notes, deploymen
418
449
 
419
450
  Skills are reusable instruction packs discovered from:
420
451
 
421
- - project: `.kon/skills/`
422
- - global: `~/.kon/skills/`
452
+ - project: `.agents/skills/`
453
+ - global: `~/.agents/skills/`
423
454
 
424
455
  Each skill lives in its own directory with a `SKILL.md` file.
425
456
 
@@ -492,7 +523,7 @@ kon --provider deepseek --model deepseek-v4-flash
492
523
 
493
524
  ### Local models
494
525
 
495
- Kon works well with local models served through an OpenAI-compatible endpoint. For one-off launches, you can force unauthenticated local behavior with `--openai-compat-auth none` or `--anthropic-compat-auth none`. To make that persistent across sessions, set `[llm.auth] openai_compat = "auto"|"none"` and/or `anthropic_compat = "auto"|"none"` in `~/.kon/config.toml`.
526
+ Kon works well with local models served through an OpenAI-compatible endpoint. For one-off launches, you can force unauthenticated local behavior with `--openai-compat-auth none` or `--anthropic-compat-auth none`. To make that persistent across sessions, set `[llm.auth] openai_compat = "auto"|"none"` and/or `anthropic_compat = "auto"|"none"` in `~/.config/kon/config.toml`.
496
527
 
497
528
  More notes, tested models, and examples live in [docs/local-models.md](docs/local-models.md).
498
529
 
@@ -14,7 +14,7 @@ default = true
14
14
 
15
15
  [project]
16
16
  name = "kon-coding-agent"
17
- version = "0.3.10"
17
+ version = "0.4.0"
18
18
  description = "Minimal coding agent"
19
19
  readme = "README.md"
20
20
  requires-python = ">=3.12"
@@ -43,7 +43,7 @@ dev = [
43
43
  ]
44
44
 
45
45
  [project.scripts]
46
- kon = "kon.ui.app:main"
46
+ kon = "kon.cli:main"
47
47
 
48
48
  [tool.ruff]
49
49
  target-version = "py312"
@@ -51,7 +51,7 @@ def parse_args() -> argparse.Namespace:
51
51
  parser.add_argument(
52
52
  "--kon-config",
53
53
  type=Path,
54
- default=Path.home() / ".kon/config.toml",
54
+ default=Path.home() / ".config" / "kon" / "config.toml",
55
55
  help="Kon config file to rewrite during previews.",
56
56
  )
57
57
  parser.add_argument(
@@ -3,12 +3,19 @@ from kon.config import (
3
3
  CONFIG_DIR_NAME,
4
4
  Config,
5
5
  consume_config_warnings,
6
+ get_agents_dir,
6
7
  get_config,
7
8
  get_config_dir,
8
9
  reload_config,
9
10
  reset_config,
11
+ set_colored_tool_badge,
10
12
  set_config,
13
+ set_git_context,
14
+ set_notifications_enabled,
15
+ set_permissions_mode,
16
+ set_show_welcome_shortcuts,
11
17
  set_theme,
18
+ set_thinking_lines,
12
19
  update_available_binaries,
13
20
  )
14
21
  from kon.context._xml import escape_xml
@@ -30,11 +37,18 @@ __all__ = [
30
37
  "config",
31
38
  "consume_config_warnings",
32
39
  "escape_xml",
40
+ "get_agents_dir",
33
41
  "get_config",
34
42
  "get_config_dir",
35
43
  "reload_config",
36
44
  "reset_config",
45
+ "set_colored_tool_badge",
37
46
  "set_config",
47
+ "set_git_context",
48
+ "set_notifications_enabled",
49
+ "set_permissions_mode",
50
+ "set_show_welcome_shortcuts",
38
51
  "set_theme",
52
+ "set_thinking_lines",
39
53
  "update_available_binaries",
40
54
  ]
@@ -2,7 +2,7 @@
2
2
  name: init
3
3
  description: Create or update AGENTS.md for this repository
4
4
  register_cmd: true
5
- cmd_info: Guided AGENTS.md setup
5
+ cmd_info: guided AGENTS.md setup
6
6
  ---
7
7
 
8
8
  Create or update `AGENTS.md` for this repository.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: review
3
+ description: Review code changes and return prioritized, actionable findings
4
+ register_cmd: true
5
+ cmd_info: review code changes
6
+ ---
7
+
8
+ Review the requested code changes as if you are reviewing another engineer's PR.
9
+
10
+ User-provided target or constraints (honor these):
11
+ $ARGUMENTS
12
+
13
+ ## Target selection
14
+
15
+ - If no target is provided, review the current code changes: staged, unstaged, and untracked files.
16
+ - If the user provides a base branch, review the changes that would merge into that branch. Find the merge base and inspect the diff from that commit.
17
+ - If the user provides a commit SHA, review only the changes introduced by that commit.
18
+ - If the user provides a PR number, PR URL, or text like `PR#68 feat/headless-mode "feat: add non-interactive prompt mode"`, assume the GitHub CLI is available. Use `gh pr view` to inspect PR metadata, resolve the base/head branches, fetch as needed, compute the merge base, and review the PR diff. Do not checkout a different branch unless the user explicitly asks or confirms.
19
+ - For PRs, do not assume the head branch exists on `origin`; it may live on a contributor fork. Prefer `gh pr checkout --detach <number>` only if checkout is acceptable, or fetch the head repository/ref reported by `gh pr view --json headRepository,headRefName` into a temporary remote/ref before diffing.
20
+ - For a PR scenario such as `/review PR#68 feat/headless-mode "feat: add non-interactive prompt mode"`, use the PR number/title/branch as hints, verify them with `gh pr view 68`, then review the code changes relative to the PR base branch.
21
+
22
+ ## Review rubric
23
+
24
+ Only report issues the original author would likely fix if they knew about them.
25
+
26
+ Flag a finding only when:
27
+ - it meaningfully affects correctness, security, performance, reliability, or maintainability;
28
+ - it is discrete and actionable;
29
+ - it appears introduced by the reviewed change;
30
+ - you can identify the affected code path or user scenario;
31
+ - it is not merely a style preference, nit, or intentional behavior change.
32
+
33
+ Do not stop at the first issue. Return all qualifying findings. If there are no findings worth fixing, say so clearly.
34
+
35
+ ## Investigation guidance
36
+
37
+ Use repository tools to inspect the actual diff and surrounding code. Prefer precise commands such as:
38
+ - `git status --short`
39
+ - `git diff --staged`
40
+ - `git diff`
41
+ - `git diff <merge-base>...HEAD`
42
+ - `git show <sha>`
43
+ - `gh pr view <number> --json number,title,body,baseRefName,headRefName,url,author`
44
+
45
+ Read nearby implementation and tests when needed to prove whether a suspected issue is real. Avoid speculative findings.
46
+
47
+ ## Priority rubric
48
+
49
+ Use these severity levels for finding titles:
50
+ - `[P0]` — Drop everything to fix. Blocking release, operations, or major usage. Only use for universal issues that do not depend on assumptions about inputs.
51
+ - `[P1]` — Urgent. Should be addressed in the next cycle.
52
+ - `[P2]` — Normal. Should be fixed eventually.
53
+ - `[P3]` — Low. Nice to have.
54
+
55
+ ## Finding format
56
+
57
+ For each finding, include:
58
+ - priority tag in the title: `[P0]`, `[P1]`, `[P2]`, or `[P3]`;
59
+ - concise title;
60
+ - file path and line range;
61
+ - one short paragraph explaining why this is a bug and when it matters;
62
+ - confidence score if useful.
63
+
64
+ Keep line ranges as short as possible and make sure they overlap the reviewed diff when possible.
65
+
66
+ End with an overall verdict:
67
+ - `patch is correct` if existing code/tests should not break and no blocking issues were found;
68
+ - `patch is incorrect` if the patch has blocking correctness, security, reliability, or maintainability issues that should prevent merging.
69
+
70
+ Do not mark a patch incorrect for non-blocking issues such as style, formatting, typos, documentation nits, or ordinary `[P2]`/`[P3]` follow-ups unless they still indicate the patch should not merge.
71
+
72
+ Do not fix the code unless the user asks after the review.
@@ -0,0 +1,98 @@
1
+ import argparse
2
+ import asyncio
3
+
4
+ from kon import config
5
+
6
+ from .llm import PROVIDER_API_BY_NAME
7
+ from .version import VERSION
8
+
9
+
10
+ def build_parser() -> argparse.ArgumentParser:
11
+ parser = argparse.ArgumentParser(description="Kon")
12
+ parser.add_argument("--model", "-m", help="Model to use")
13
+ parser.add_argument("--provider", choices=sorted(PROVIDER_API_BY_NAME), help="Provider to use")
14
+ parser.add_argument(
15
+ "--prompt",
16
+ "-p",
17
+ nargs="?",
18
+ const="-",
19
+ default=None,
20
+ help="Run a single prompt non-interactively, then exit "
21
+ "(omit the value or pipe stdin to read the prompt from stdin)",
22
+ )
23
+ parser.add_argument("--api-key", "-k", help="API key")
24
+ parser.add_argument("--base-url", "-u", help="Base URL for API")
25
+ parser.add_argument(
26
+ "--openai-compat-auth",
27
+ choices=("auto", "required", "none"),
28
+ help="Auth mode for OpenAI-compatible endpoints",
29
+ )
30
+ parser.add_argument(
31
+ "--anthropic-compat-auth",
32
+ choices=("auto", "required", "none"),
33
+ help="Auth mode for Anthropic-compatible endpoints",
34
+ )
35
+ parser.add_argument(
36
+ "--insecure-skip-verify",
37
+ action="store_true",
38
+ help="Skip TLS verification (e.g. self-signed certs on local providers)",
39
+ )
40
+ parser.add_argument(
41
+ "--continue",
42
+ "-c",
43
+ action="store_true",
44
+ dest="continue_recent",
45
+ help="Resume the most recent session",
46
+ )
47
+ parser.add_argument(
48
+ "--resume",
49
+ "-r",
50
+ dest="resume_session",
51
+ help="Resume a specific session by ID (full or unique prefix)",
52
+ )
53
+ parser.add_argument("--version", action="version", version=f"kon {VERSION}")
54
+ parser.add_argument(
55
+ "--extra-tools", help="Comma-separated extra tools to enable (e.g. web_search,web_fetch)"
56
+ )
57
+ return parser
58
+
59
+
60
+ def main() -> None:
61
+ parser = build_parser()
62
+ args = parser.parse_args()
63
+
64
+ if args.prompt is not None and (args.continue_recent or args.resume_session):
65
+ parser.error("-c/--continue and -r/--resume are not supported with -p/--prompt")
66
+
67
+ if args.insecure_skip_verify:
68
+ config.llm.tls.insecure_skip_verify = True
69
+
70
+ extra_tools = (
71
+ [t.strip() for t in args.extra_tools.split(",") if t.strip()] if args.extra_tools else None
72
+ )
73
+
74
+ if args.prompt is not None:
75
+ from .headless import run_headless
76
+
77
+ raise SystemExit(
78
+ asyncio.run(
79
+ run_headless(
80
+ prompt_arg=args.prompt,
81
+ model=args.model,
82
+ provider=args.provider,
83
+ api_key=args.api_key,
84
+ base_url=args.base_url,
85
+ openai_compat_auth_mode=args.openai_compat_auth,
86
+ anthropic_compat_auth_mode=args.anthropic_compat_auth,
87
+ extra_tools=extra_tools,
88
+ )
89
+ )
90
+ )
91
+
92
+ from .ui.app import run_tui
93
+
94
+ run_tui(args, extra_tools=extra_tools)
95
+
96
+
97
+ if __name__ == "__main__":
98
+ main()