klaude-code 1.2.16__py3-none-any.whl → 1.2.18__py3-none-any.whl

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 (70) hide show
  1. klaude_code/cli/config_cmd.py +1 -1
  2. klaude_code/cli/debug.py +1 -1
  3. klaude_code/cli/main.py +3 -9
  4. klaude_code/cli/runtime.py +20 -13
  5. klaude_code/command/__init__.py +7 -1
  6. klaude_code/command/clear_cmd.py +2 -7
  7. klaude_code/command/command_abc.py +33 -5
  8. klaude_code/command/debug_cmd.py +79 -0
  9. klaude_code/command/diff_cmd.py +2 -6
  10. klaude_code/command/export_cmd.py +7 -7
  11. klaude_code/command/export_online_cmd.py +145 -0
  12. klaude_code/command/help_cmd.py +4 -9
  13. klaude_code/command/model_cmd.py +10 -6
  14. klaude_code/command/prompt_command.py +2 -6
  15. klaude_code/command/refresh_cmd.py +2 -7
  16. klaude_code/command/registry.py +2 -4
  17. klaude_code/command/release_notes_cmd.py +2 -6
  18. klaude_code/command/status_cmd.py +2 -7
  19. klaude_code/command/terminal_setup_cmd.py +2 -6
  20. klaude_code/command/thinking_cmd.py +13 -8
  21. klaude_code/config/config.py +16 -17
  22. klaude_code/config/select_model.py +81 -5
  23. klaude_code/const/__init__.py +1 -1
  24. klaude_code/core/executor.py +236 -109
  25. klaude_code/core/manager/__init__.py +2 -4
  26. klaude_code/core/manager/sub_agent_manager.py +1 -1
  27. klaude_code/core/prompts/prompt-claude-code.md +1 -1
  28. klaude_code/core/prompts/prompt-sub-agent-oracle.md +0 -1
  29. klaude_code/core/prompts/prompt-sub-agent-web.md +51 -0
  30. klaude_code/core/reminders.py +9 -35
  31. klaude_code/core/task.py +8 -0
  32. klaude_code/core/tool/__init__.py +2 -0
  33. klaude_code/core/tool/file/read_tool.py +38 -10
  34. klaude_code/core/tool/report_back_tool.py +28 -2
  35. klaude_code/core/tool/shell/bash_tool.py +22 -2
  36. klaude_code/core/tool/tool_runner.py +26 -23
  37. klaude_code/core/tool/truncation.py +23 -9
  38. klaude_code/core/tool/web/web_fetch_tool.md +1 -1
  39. klaude_code/core/tool/web/web_fetch_tool.py +36 -1
  40. klaude_code/core/tool/web/web_search_tool.md +23 -0
  41. klaude_code/core/tool/web/web_search_tool.py +126 -0
  42. klaude_code/core/turn.py +28 -0
  43. klaude_code/protocol/commands.py +2 -0
  44. klaude_code/protocol/events.py +8 -0
  45. klaude_code/protocol/sub_agent/__init__.py +1 -1
  46. klaude_code/protocol/sub_agent/explore.py +1 -1
  47. klaude_code/protocol/sub_agent/web.py +79 -0
  48. klaude_code/protocol/tools.py +1 -0
  49. klaude_code/session/session.py +2 -2
  50. klaude_code/session/templates/export_session.html +123 -37
  51. klaude_code/trace/__init__.py +20 -2
  52. klaude_code/ui/modes/repl/completers.py +19 -2
  53. klaude_code/ui/modes/repl/event_handler.py +44 -15
  54. klaude_code/ui/modes/repl/renderer.py +3 -3
  55. klaude_code/ui/renderers/metadata.py +2 -4
  56. klaude_code/ui/renderers/sub_agent.py +14 -10
  57. klaude_code/ui/renderers/thinking.py +24 -8
  58. klaude_code/ui/renderers/tools.py +83 -20
  59. klaude_code/ui/rich/code_panel.py +112 -0
  60. klaude_code/ui/rich/markdown.py +3 -4
  61. klaude_code/ui/rich/status.py +30 -6
  62. klaude_code/ui/rich/theme.py +10 -1
  63. {klaude_code-1.2.16.dist-info → klaude_code-1.2.18.dist-info}/METADATA +126 -25
  64. {klaude_code-1.2.16.dist-info → klaude_code-1.2.18.dist-info}/RECORD +67 -63
  65. klaude_code/core/manager/agent_manager.py +0 -132
  66. klaude_code/core/prompts/prompt-sub-agent-webfetch.md +0 -46
  67. klaude_code/protocol/sub_agent/web_fetch.py +0 -74
  68. /klaude_code/{config → cli}/list_model.py +0 -0
  69. {klaude_code-1.2.16.dist-info → klaude_code-1.2.18.dist-info}/WHEEL +0 -0
  70. {klaude_code-1.2.16.dist-info → klaude_code-1.2.18.dist-info}/entry_points.txt +0 -0
@@ -1,74 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
-
5
- from klaude_code.protocol import tools
6
- from klaude_code.protocol.sub_agent import SubAgentProfile, register_sub_agent
7
-
8
- WEB_FETCH_AGENT_DESCRIPTION = """\
9
- Launch a sub-agent to fetch and analyze web content. Use this when you need to:
10
- - Retrieve and extract information from a webpage
11
- - Analyze web page content based on specific instructions
12
- - Get structured data from URLs
13
-
14
- This is an autonomous agent with its own reasoning capabilities. It can:
15
- - Follow links and navigate across multiple pages to gather comprehensive information
16
- - Decide which related pages to visit based on the initial content
17
- - Aggregate information from multiple sources into a coherent response
18
-
19
- The agent will fetch the URL content, handle HTML-to-Markdown conversion automatically, \
20
- and can use tools like rg to search through large responses that were truncated and saved to files.
21
-
22
- Usage notes:
23
- - Provide a clear prompt describing what information to extract or analyze
24
- - Provide an `output_format` (JSON Schema) parameter for structured data back from the sub-agent
25
- - Example: `output_format={"type": "object", "properties": {"main_content": {"type": "string", "description": "The main content extracted from the page, e.g. 'This article discusses...'"}, "key_insights": {"type": "array", "items": {"type": "string"}, "description": "Key takeaways from the content, e.g. ['Insight 1', 'Insight 2']"}}, "required": ["main_content", "key_insights"]}`
26
- - The agent will return a summary of the findings
27
- - For large web pages, the content may be truncated and saved to a file; the agent can search through it
28
- - The agent can autonomously follow links to related pages if needed to complete the task\
29
- """
30
-
31
- WEB_FETCH_AGENT_PARAMETERS = {
32
- "type": "object",
33
- "properties": {
34
- "description": {
35
- "type": "string",
36
- "description": "A short (3-5 word) description of the task",
37
- },
38
- "url": {
39
- "type": "string",
40
- "description": "The URL to fetch and analyze",
41
- },
42
- "prompt": {
43
- "type": "string",
44
- "description": "Instructions for analyzing or extracting content from the web page",
45
- },
46
- "output_format": {
47
- "type": "object",
48
- "description": "Optional JSON Schema for sub-agent structured output",
49
- },
50
- },
51
- "required": ["description", "url", "prompt", "output_format"],
52
- "additionalProperties": False,
53
- }
54
-
55
-
56
- def _web_fetch_prompt_builder(args: dict[str, Any]) -> str:
57
- """Build the WebFetchAgent prompt from tool arguments."""
58
- url = args.get("url", "")
59
- prompt = args.get("prompt", "")
60
- return f"URL to fetch: {url}\nTask: {prompt}"
61
-
62
-
63
- register_sub_agent(
64
- SubAgentProfile(
65
- name="WebFetchAgent",
66
- description=WEB_FETCH_AGENT_DESCRIPTION,
67
- parameters=WEB_FETCH_AGENT_PARAMETERS,
68
- prompt_file="prompts/prompt-sub-agent-webfetch.md",
69
- tool_set=(tools.BASH, tools.READ, tools.WEB_FETCH),
70
- prompt_builder=_web_fetch_prompt_builder,
71
- active_form="Fetching Web",
72
- output_schema_arg="output_format",
73
- )
74
- )
File without changes