klaude-code 1.2.15__py3-none-any.whl → 1.2.16__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 (53) hide show
  1. klaude_code/cli/main.py +66 -42
  2. klaude_code/cli/runtime.py +24 -13
  3. klaude_code/command/export_cmd.py +2 -2
  4. klaude_code/command/prompt-handoff.md +33 -0
  5. klaude_code/command/thinking_cmd.py +5 -1
  6. klaude_code/config/config.py +5 -5
  7. klaude_code/config/list_model.py +1 -1
  8. klaude_code/const/__init__.py +3 -0
  9. klaude_code/core/executor.py +2 -2
  10. klaude_code/core/manager/llm_clients_builder.py +1 -1
  11. klaude_code/core/manager/sub_agent_manager.py +30 -6
  12. klaude_code/core/prompt.py +15 -13
  13. klaude_code/core/prompts/{prompt-subagent-explore.md → prompt-sub-agent-explore.md} +0 -1
  14. klaude_code/core/prompts/{prompt-subagent-oracle.md → prompt-sub-agent-oracle.md} +1 -1
  15. klaude_code/core/reminders.py +75 -32
  16. klaude_code/core/task.py +10 -22
  17. klaude_code/core/tool/__init__.py +2 -0
  18. klaude_code/core/tool/report_back_tool.py +58 -0
  19. klaude_code/core/tool/sub_agent_tool.py +6 -0
  20. klaude_code/core/tool/tool_runner.py +9 -1
  21. klaude_code/core/turn.py +45 -4
  22. klaude_code/llm/anthropic/input.py +14 -5
  23. klaude_code/llm/openrouter/input.py +14 -3
  24. klaude_code/llm/responses/input.py +19 -0
  25. klaude_code/protocol/events.py +1 -0
  26. klaude_code/protocol/model.py +24 -14
  27. klaude_code/protocol/sub_agent/__init__.py +117 -0
  28. klaude_code/protocol/sub_agent/explore.py +63 -0
  29. klaude_code/protocol/sub_agent/oracle.py +91 -0
  30. klaude_code/protocol/sub_agent/task.py +61 -0
  31. klaude_code/protocol/sub_agent/web_fetch.py +74 -0
  32. klaude_code/protocol/tools.py +1 -0
  33. klaude_code/session/export.py +12 -6
  34. klaude_code/session/session.py +12 -2
  35. klaude_code/session/templates/export_session.html +12 -12
  36. klaude_code/ui/modes/repl/completers.py +1 -1
  37. klaude_code/ui/modes/repl/event_handler.py +32 -2
  38. klaude_code/ui/modes/repl/renderer.py +8 -6
  39. klaude_code/ui/renderers/developer.py +18 -7
  40. klaude_code/ui/renderers/metadata.py +24 -12
  41. klaude_code/ui/renderers/sub_agent.py +59 -3
  42. klaude_code/ui/renderers/thinking.py +1 -1
  43. klaude_code/ui/renderers/tools.py +22 -29
  44. klaude_code/ui/rich/markdown.py +20 -48
  45. klaude_code/ui/rich/status.py +32 -14
  46. klaude_code/ui/rich/theme.py +8 -7
  47. {klaude_code-1.2.15.dist-info → klaude_code-1.2.16.dist-info}/METADATA +3 -2
  48. {klaude_code-1.2.15.dist-info → klaude_code-1.2.16.dist-info}/RECORD +52 -46
  49. klaude_code/protocol/sub_agent.py +0 -354
  50. /klaude_code/core/prompts/{prompt-subagent-webfetch.md → prompt-sub-agent-webfetch.md} +0 -0
  51. /klaude_code/core/prompts/{prompt-subagent.md → prompt-sub-agent.md} +0 -0
  52. {klaude_code-1.2.15.dist-info → klaude_code-1.2.16.dist-info}/WHEEL +0 -0
  53. {klaude_code-1.2.15.dist-info → klaude_code-1.2.16.dist-info}/entry_points.txt +0 -0
@@ -9,19 +9,20 @@ klaude_code/cli/__init__.py,sha256=YzlAoWAr5rx5oe6B_4zPxRFS4QaZauuy1AFwampP5fg,4
9
9
  klaude_code/cli/auth_cmd.py,sha256=UWMHjn9xZp2o8OZc-x8y9MnkZgRWOkFXk05iKJYcySE,2561
10
10
  klaude_code/cli/config_cmd.py,sha256=zlqQV2DCU1NqCQ1th9v-bduw84sGM4739-iyJBoiNSA,2897
11
11
  klaude_code/cli/debug.py,sha256=kIgdmlMhAKg7S42uYvwwK8q_5EdKsEHSd1fiHUW176Q,2417
12
- klaude_code/cli/main.py,sha256=rulQhW9D5LZtmUFM7EUgJ-0osMJT33BWT2ulb8usPtg,8003
13
- klaude_code/cli/runtime.py,sha256=vDkSngZJd69QhCzqc8--P5OKdT8_6OzuoOQeIBqTI_A,11461
12
+ klaude_code/cli/main.py,sha256=kviR4yqAaLU_KiMT50px-fTLFWfVBWr4ZzhraH6b5qQ,8679
13
+ klaude_code/cli/runtime.py,sha256=IrgHueV-vw1UhOSg8BHka5yRbr34HHHggyf60e-ORU8,11641
14
14
  klaude_code/cli/session_cmd.py,sha256=jAopkqq_DGgoDIcGxT-RSzn9R4yqBC8NCaNgK1GLqnQ,2634
15
15
  klaude_code/command/__init__.py,sha256=FsJtajofM-VJru-2XHRDbho565O0O7xJGI1MGC3HOFo,3041
16
16
  klaude_code/command/clear_cmd.py,sha256=diIe1pscX1ko7bRN4FGylsTvDSAF6HHPwnsbXqTtHP0,657
17
17
  klaude_code/command/command_abc.py,sha256=1Wwp94Q3W08GNCraYYEGcjjNC7JLIei6E953zSZ2lZ4,2605
18
18
  klaude_code/command/diff_cmd.py,sha256=mQu-FedUsZabE3-KwZV2JmOfm67-A41C2gz7rr6N9W8,5251
19
- klaude_code/command/export_cmd.py,sha256=_EAWh1BTCfuzqkEHcLGn_SYuiXh6VE8YBdDfuJgyy-U,3478
19
+ klaude_code/command/export_cmd.py,sha256=BPY3zYzUUuVDetakmRQpHkx1IOMw-jEQAu0LOUZn88I,3478
20
20
  klaude_code/command/help_cmd.py,sha256=N9X9q2hw7AXrmvBszmzL6tYz3GNZR768wMQqmC0Vp1Q,1692
21
21
  klaude_code/command/model_cmd.py,sha256=dIjAlh2PAsjKFzEQ9JrQDslPnfdl16k9whiLd7gevcc,1505
22
22
  klaude_code/command/prompt-deslop.md,sha256=YGaAXqem39zd0UWCFjWUj83Cf7cvUJq1768aJExFqeg,1346
23
23
  klaude_code/command/prompt-dev-docs-update.md,sha256=g1IWIWIa-3qlNOw5mBA4N9H1_nvYcw8AKo7XoQw_AZQ,1855
24
24
  klaude_code/command/prompt-dev-docs.md,sha256=PU9iT6XdUEH6grfSjHVma7xKOQcA__ZTKlEDkbbO0hA,1783
25
+ klaude_code/command/prompt-handoff.md,sha256=RXIeXNwOpSpkwAyNFSvQFoo077TVkbj11fqQ2r8aCh4,1638
25
26
  klaude_code/command/prompt-init.md,sha256=a4_FQ3gKizqs2vl9oEY5jtG6HNhv3f-1b5RSCFq0A18,1873
26
27
  klaude_code/command/prompt_command.py,sha256=8jBUcfSmC9tXAYkLAB-u81KFqSKtCAHfHMnTQDzpgcg,2607
27
28
  klaude_code/command/refresh_cmd.py,sha256=8TB1ibGn7w0xFemYTzIuoB0VXWU9Klem3wu-HfFfGlk,1271
@@ -29,33 +30,33 @@ klaude_code/command/registry.py,sha256=Vy2WL1M35LL3aLkidXa2QGgGBFBKHQe_S93TZcH55
29
30
  klaude_code/command/release_notes_cmd.py,sha256=lDeAjuMDOSUISM0yYKZKbkjrYvFmvA5_fylkalTPaBU,2707
30
31
  klaude_code/command/status_cmd.py,sha256=F7XgfivBm80kJEsCgRHGXWOALAT_Y2QyLQ38ooc_ZSE,5393
31
32
  klaude_code/command/terminal_setup_cmd.py,sha256=iSYGZlflj_i-7i-9FhfhtbyyIe3UNkhPeehZezi-ULM,10944
32
- klaude_code/command/thinking_cmd.py,sha256=pvCxyfDuF1aWJuYaRkVkDmuc0JkJUGBHJR2gNHt8PMQ,7997
33
+ klaude_code/command/thinking_cmd.py,sha256=Q2lW-RLiEFLRztGio7M0EXsZx0NS3TjrZwfLtlTTTrY,8151
33
34
  klaude_code/config/__init__.py,sha256=Qrqvi8nizkj6N77h2vDj0r4rbgCiqxvz2HLBPFuWulA,120
34
- klaude_code/config/config.py,sha256=2tSf6x88vuPfMMWcKlckXPoEjnxzFCtw2g_gbDjzK90,7268
35
- klaude_code/config/list_model.py,sha256=Uthp0nHaENBgD6l_a6wG0RFkRHQhLvIyjHPsP55Kazw,8010
35
+ klaude_code/config/config.py,sha256=uhF2x6C4Y7n6Iux4bF-v5ZRhQZX8ZIZy_lHJAG3jJbk,7273
36
+ klaude_code/config/list_model.py,sha256=9YOxhWE0J59NaY-SrgPA9_jA1A8rlOGwWmzK0TRuos4,8011
36
37
  klaude_code/config/select_model.py,sha256=aOizajRXcc_IOy0bSzK_KOZhbMQSx4g6IeNkgLsyV1c,2168
37
- klaude_code/const/__init__.py,sha256=5sbJ0NMLRTesavJmgK6wu30pNSs9tpigM0F86BF_W08,4168
38
+ klaude_code/const/__init__.py,sha256=uNLYBV7avW00NQDJ_ZB6n0xEeF-CYlyswKOBAHk2MmI,4256
38
39
  klaude_code/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
40
  klaude_code/core/agent.py,sha256=bWm-UFX_0-KAy5j_YHH8X8o3MJT4-40Ni2EaDP2SL5k,5819
40
- klaude_code/core/executor.py,sha256=WBwE6RLeCfw6b1j6EKEb_y36Qyg9pAPprlkKbbDGx2M,18685
41
+ klaude_code/core/executor.py,sha256=9hqu7ySPCpKmuge-j1kcBGlB6FAVKbC1KYMonuSvR0c,18688
41
42
  klaude_code/core/manager/__init__.py,sha256=6CswltCHXBUcezlW7xui2S1swDp8JTkS1YiEHmq4-no,658
42
43
  klaude_code/core/manager/agent_manager.py,sha256=Z_LEV9WP-4h6tLAy4_WJnnJElY8MfH1OTRHk_LRw0VI,5202
43
44
  klaude_code/core/manager/llm_clients.py,sha256=X2oMFWgJcP0tK8GEtMMDYR3HyR6_H8FuyCqpzWF5x2k,871
44
- klaude_code/core/manager/llm_clients_builder.py,sha256=Kx4QyJmTr6BlN-yCqYglrhMxsCe2woe6yzLtHIQuV04,1520
45
- klaude_code/core/manager/sub_agent_manager.py,sha256=YC_T-pA6P0295XqNzQDE7Ds0PnJ8XdH0YS2iRe9C0UQ,3748
46
- klaude_code/core/prompt.py,sha256=arzgHc6l076ZvKUhLbdD8JD3sPPwgv459vox7j6EX3A,3508
45
+ klaude_code/core/manager/llm_clients_builder.py,sha256=pPZ_xBh-_ipV66L-9a1fnwNos4iik82Zkq0E0y3WrfI,1521
46
+ klaude_code/core/manager/sub_agent_manager.py,sha256=PMdHc1WUHc3elV6YVDR4zN1YgE3CzIT3LK57NV57u8k,4710
47
+ klaude_code/core/prompt.py,sha256=o0BHYPdr8Jcv7xGWGgNRKvWsrw9D51MJGNWq8JYH4o0,3552
47
48
  klaude_code/core/prompts/prompt-claude-code.md,sha256=c7kNgwjJqnbwQuKWGJoMx-AMbf1gxAFC3ZFDhngBe74,8293
48
49
  klaude_code/core/prompts/prompt-codex-gpt-5-1-codex-max.md,sha256=SW-y8AmR99JL_9j26k9YVAOQuZ18vR12aT5CWHkZDc4,11741
49
50
  klaude_code/core/prompts/prompt-codex-gpt-5-1.md,sha256=jNi593_4L3EoMvjS0TwltF2b684gtDBsYHa9npxO34A,24239
50
51
  klaude_code/core/prompts/prompt-gemini.md,sha256=JjE1tHSByGKJzjn4Gpj1zekT7ry1Yqbwx5qx3fZy2gE,3901
51
52
  klaude_code/core/prompts/prompt-minimal.md,sha256=6-ZmQQkE3f92W_3V2wS7ocB13wLog1_UojCjZG0K4v8,1559
52
- klaude_code/core/prompts/prompt-subagent-explore.md,sha256=m7eQMTWWibaZIMPNbMYUhPbNRn5KrTq5tIoXw1HJuLY,2124
53
- klaude_code/core/prompts/prompt-subagent-oracle.md,sha256=hGtyDm_6UhJZUJwfXt5A-170is1KMHls85fEEo45z-w,1376
54
- klaude_code/core/prompts/prompt-subagent-webfetch.md,sha256=kHtJINbCRiRDrip_q6idHHU3CwbDfrVlpgtSZvugOWI,2304
55
- klaude_code/core/prompts/prompt-subagent.md,sha256=dmmdsOenbAOfqG6FmdR88spOLZkXmntDBs-cmZ9DN_g,897
56
- klaude_code/core/reminders.py,sha256=CVnJ1rKuJ0bSTXiGz7fO8gPCoP93rTDBELfHAIwQsBU,18132
57
- klaude_code/core/task.py,sha256=M_wl695oC-20rMTlsnsf2_-75GFbqDFg-Gz54Myhgr8,10549
58
- klaude_code/core/tool/__init__.py,sha256=7D3XQ23yvw2MQB_PH2JlPO2m1JLc9CE7NE6AcKAe7ks,2023
53
+ klaude_code/core/prompts/prompt-sub-agent-explore.md,sha256=i0I9LFB3X8VZIQtxK87CXwcRKowSO_HJxSIKopkFy_Q,2123
54
+ klaude_code/core/prompts/prompt-sub-agent-oracle.md,sha256=-beyTFQtQ2rRCfI0-ckGwTCJ88vbTxxKEYwKHf3SA44,1377
55
+ klaude_code/core/prompts/prompt-sub-agent-webfetch.md,sha256=kHtJINbCRiRDrip_q6idHHU3CwbDfrVlpgtSZvugOWI,2304
56
+ klaude_code/core/prompts/prompt-sub-agent.md,sha256=dmmdsOenbAOfqG6FmdR88spOLZkXmntDBs-cmZ9DN_g,897
57
+ klaude_code/core/reminders.py,sha256=b4w6HRMY1SAZaBUXbEkil1nTbQXruYDpPuJurwMczkI,19518
58
+ klaude_code/core/task.py,sha256=1JPG08pHhdZAOOO-yNMurYxEDZcAGQDC73G07h5h2wc,9820
59
+ klaude_code/core/tool/__init__.py,sha256=t8cmDdWxL3KkowR3FDlhd5OpRaNN3YIYN4Y8wmXUEKI,2090
59
60
  klaude_code/core/tool/file/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
61
  klaude_code/core/tool/file/_utils.py,sha256=LLmdEOJnC7MgdiAlWtBPZR0h23oM9wD_UsKqU1Nfkbs,774
61
62
  klaude_code/core/tool/file/apply_patch.py,sha256=LZd3pYQ9ow_TxiFnqYuzD216HmvkLX6lW6BoMd9iQRs,17080
@@ -75,11 +76,12 @@ klaude_code/core/tool/memory/memory_tool.py,sha256=xasFf1IQp1LFaL4ctDIQt5jfrd_z6
75
76
  klaude_code/core/tool/memory/skill_loader.py,sha256=DOlfALn4GwSPHDubNhYtzxM5di29uE7_tOdRi3yxfDc,8726
76
77
  klaude_code/core/tool/memory/skill_tool.md,sha256=UfjJK5EGAd3mf7ym5rIrRdPyV3kBTxNnwzOjNnHOBrE,973
77
78
  klaude_code/core/tool/memory/skill_tool.py,sha256=8SC4asNZSKfExuhzbyGz4f2cr78PgCpNkut_31IHePw,3602
79
+ klaude_code/core/tool/report_back_tool.py,sha256=PfV2ikSUeXYHwTVooe1Zy2D8euX5SAevJr5Jhrmp7SA,2161
78
80
  klaude_code/core/tool/shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
81
  klaude_code/core/tool/shell/bash_tool.md,sha256=ILKpnRCBTkU2uSDEdZQjNYo1l6hsM4TO-3RD5zWC61c,3935
80
82
  klaude_code/core/tool/shell/bash_tool.py,sha256=qPB7W51LmFsRxWJoqKih1vNTGIOaXE4wfxnKPzBXs6g,4490
81
83
  klaude_code/core/tool/shell/command_safety.py,sha256=bGsooLovuzq8WmLcZ2v24AVBDj3bZv2p4GSL0IlixvM,13192
82
- klaude_code/core/tool/sub_agent_tool.py,sha256=Ohroht4z-W_kuBo0AvKoL40XQM0QGzScIDAuqYKXSVk,2765
84
+ klaude_code/core/tool/sub_agent_tool.py,sha256=vFRmULiOERqK0V9OoHww80e3yA_Q5Wxu3iv8Dpxi8d0,2992
83
85
  klaude_code/core/tool/todo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
86
  klaude_code/core/tool/todo/todo_write_tool.md,sha256=BFP9qIkzkakzskHwIOPVtDhehkh0F90A5oosyDuC_BE,1682
85
87
  klaude_code/core/tool/todo/todo_write_tool.py,sha256=XgSo8F1aJn_0fkh9Gx-5DHNFNlbZys1bUjwhe6NwyLU,4506
@@ -89,18 +91,18 @@ klaude_code/core/tool/todo/update_plan_tool.py,sha256=5MmmApG0wObBgc-mLETjIMupxI
89
91
  klaude_code/core/tool/tool_abc.py,sha256=3FlVZ8a6hC-_Ci23_cpLaap9nHinHgxSB1TsZL5ylUQ,731
90
92
  klaude_code/core/tool/tool_context.py,sha256=M6KpU2xtgKeQmvAZwqeLnzbzWvjxTt_M0p2ohC1tsb4,4157
91
93
  klaude_code/core/tool/tool_registry.py,sha256=vp7xmXvPW-vpX0fXi41RiQMZtQFwgyA0GP7K_wHRR9I,2630
92
- klaude_code/core/tool/tool_runner.py,sha256=3e1G591UYrIjvUP0g0h7DreXiPivj5SXN2uSg-9nzE0,10073
94
+ klaude_code/core/tool/tool_runner.py,sha256=yBHN3EAVokxgu95oW6fgI_feH4iB5qIusl_tBs3wj2U,10462
93
95
  klaude_code/core/tool/truncation.py,sha256=guC5PZVFvl4ZLPa3nwM2L0q37vMaTkuxrOzXzx89qmQ,6604
94
96
  klaude_code/core/tool/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
97
  klaude_code/core/tool/web/mermaid_tool.md,sha256=Ketpxpr7lz8238p5Q7ZzcyWchWd4dU68u708-dxaZds,978
96
98
  klaude_code/core/tool/web/mermaid_tool.py,sha256=Ok0A27oHLnV1c__74bheUuy3wpqDJ1zaXUSxuuqsNPI,2630
97
99
  klaude_code/core/tool/web/web_fetch_tool.md,sha256=_5U-LSoI86rD26nPb0D5BQCr6hj8eyF0UELSiyLznCA,347
98
100
  klaude_code/core/tool/web/web_fetch_tool.py,sha256=iu6kM_-90K8mqHbK9Loui96vICV7d8rmtss68rcFqw0,4958
99
- klaude_code/core/turn.py,sha256=Vh2hAbB6l5ohkMbRMONaOAJQ0MYzKZnz4ZRrECt27VM,9761
101
+ klaude_code/core/turn.py,sha256=4v6cWUUMXA1VLSmkc6bwJzE0kdbOPv0IiqnwzKfyKOw,11472
100
102
  klaude_code/llm/__init__.py,sha256=b4AsqnrMIs0a5qR_ti6rZcHwFzAReTwOW96EqozEoSo,287
101
103
  klaude_code/llm/anthropic/__init__.py,sha256=PWETvaeNAAX3ue0ww1uRUIxTJG0RpWiutkn7MlwKxBs,67
102
104
  klaude_code/llm/anthropic/client.py,sha256=J0uv_tGHq2V5A_LuaJOVHXW6vARdZxsWOvzO6PdW4JQ,9742
103
- klaude_code/llm/anthropic/input.py,sha256=qPo4nmhnhSfLqef4UUVoIz8EjoXTxvlsrfsc_6qqM_s,8039
105
+ klaude_code/llm/anthropic/input.py,sha256=nyDX3uFK0GVduSiLlBEgBjAl70e0pgIZSF3PbbbuW78,8585
104
106
  klaude_code/llm/client.py,sha256=FbFnzLUAKM61goiYNdKi8-D4rBfu_ksaxjJtmJn0w_4,960
105
107
  klaude_code/llm/codex/__init__.py,sha256=8vN2j2ezWB_UVpfqQ8ooStsBeLL5SY4SUMXOXdWiMaI,132
106
108
  klaude_code/llm/codex/client.py,sha256=0BAOiLAdk2PxBEYuC_TGOs4_h6yfNZr1YWuf1lzkBxM,5329
@@ -112,27 +114,31 @@ klaude_code/llm/openai_compatible/stream_processor.py,sha256=EOJeoWlQGHrDj6chMcl
112
114
  klaude_code/llm/openai_compatible/tool_call_accumulator.py,sha256=kuw3ceDgenQz2Ccc9KYqBkDo6F1sDb5Aga6m41AIECA,4071
113
115
  klaude_code/llm/openrouter/__init__.py,sha256=_As8lHjwj6vapQhLorZttTpukk5ZiCdhFdGT38_ASPo,69
114
116
  klaude_code/llm/openrouter/client.py,sha256=5grbpu5ft4QclxwzFQaePitSKmQKg82RoVV124ajNh8,8855
115
- klaude_code/llm/openrouter/input.py,sha256=2GuDVHd_74ZtHQyFyTGhZqtWjM7m5GYqFtKf--AvmlI,5059
117
+ klaude_code/llm/openrouter/input.py,sha256=aHVJCejkwzWaTM_EBbgmzKWyZfttAws2Y7QDW_NCnZk,5671
116
118
  klaude_code/llm/openrouter/reasoning_handler.py,sha256=r8I2F-oFTCkqJpINv74SCQZXwAuQZym7wJi5ScSe6hs,3378
117
119
  klaude_code/llm/registry.py,sha256=grgHetTd-lSxTXiY689QW_Zd6voaid7qBqSnulpg_fE,1734
118
120
  klaude_code/llm/responses/__init__.py,sha256=WsiyvnNiIytaYcaAqNiB8GI-5zcpjjeODPbMlteeFjA,67
119
121
  klaude_code/llm/responses/client.py,sha256=OdvnFeEOUp5aYX5hEVVZzJ8aSB5t2sfBCVNOElSMSIY,9908
120
- klaude_code/llm/responses/input.py,sha256=noNmalXvxw6UXo6ngkhFBroECxK6igmgEQ49YVhY0xg,6049
122
+ klaude_code/llm/responses/input.py,sha256=qr61LmQJdcb_f-ofrAz06WpK_k4PEcI36XsyuZAXbKk,6805
121
123
  klaude_code/llm/usage.py,sha256=cq6yZNSKBhRVVjFqBYJQrK3mw9ZSLXaTpbDeal-BjBQ,4205
122
124
  klaude_code/protocol/__init__.py,sha256=aGUgzhYqvhuT3Mk2vj7lrHGriH4h9TSbqV1RsRFAZjQ,194
123
125
  klaude_code/protocol/commands.py,sha256=WX7EW3DbZs7oV7zhnKXHQhDZdIZTN35MTBJ4hWMAHjM,606
124
- klaude_code/protocol/events.py,sha256=UX7j14DNlZrZ4dyim6MRmLWiHpqvx_uuQZlc6vp8nx8,3685
126
+ klaude_code/protocol/events.py,sha256=QXYgoZ3pRLDeYUAWdI62cDci1pEgfkkocCIamll81f4,3725
125
127
  klaude_code/protocol/llm_param.py,sha256=cb4ubLq21PIsMOC8WJb0aid12z_sT1b7FsbNJMr-jLg,4255
126
- klaude_code/protocol/model.py,sha256=Gd2nUhJC4mj5l2x6oDH9Sho8iY32hHgWLa_q8wDlquk,12312
128
+ klaude_code/protocol/model.py,sha256=JDWjN_GiUwJQxVA2HFXo2cryR_UOEjDBeVB3SwmrbE8,12584
127
129
  klaude_code/protocol/op.py,sha256=hdQTzD6zAsRMJJFaLOPvDX9gokhtIBSYNQuZ20TusI4,2824
128
130
  klaude_code/protocol/op_handler.py,sha256=_lnv3-RxKkrTfGTNBlQ23gbHJBEtMLC8O48SYWDtPjE,843
129
- klaude_code/protocol/sub_agent.py,sha256=ZCEeflbUcMLKrajgxYuWHY2y0TmMIQBJ2-VdQcPiiLw,13575
130
- klaude_code/protocol/tools.py,sha256=hkjVirnQqGTJS46IWvVKXWR4usPPUgDZDnm34LzAVSc,348
131
+ klaude_code/protocol/sub_agent/__init__.py,sha256=Kh2rfTNNAC4jQA3qD3-MCfuYtvhSvwj-vFsk_FH-YuI,3976
132
+ klaude_code/protocol/sub_agent/explore.py,sha256=maAcBlv4EefZjKa-SwIBe1aBsi_8Lj9CBYBESFeCtlQ,2596
133
+ klaude_code/protocol/sub_agent/oracle.py,sha256=0cbuutKQcvwaM--Q15mbkCdbpZMF4YjxDN1jkuGVKp4,3344
134
+ klaude_code/protocol/sub_agent/task.py,sha256=fvj4i1vfWXivStQ-9urDS40wTWkmNRvl6D-A0exExJg,3608
135
+ klaude_code/protocol/sub_agent/web_fetch.py,sha256=fi7oVutJNhYF9_LaDHWPrvyg3RQhw7othFOAYtv67r0,3160
136
+ klaude_code/protocol/tools.py,sha256=wji1M0K6uAC3D-ZtB56q12-4noABpMjYcoLRHadOZZw,376
131
137
  klaude_code/session/__init__.py,sha256=oXcDA5w-gJCbzmlF8yuWy3ezIW9DgFBNUs-gJHUJ-Rc,121
132
- klaude_code/session/export.py,sha256=yoRvIfEehjwHL9qNNd6kJWhXLdXTsQlpf8KCoR_tjkI,26512
138
+ klaude_code/session/export.py,sha256=bgljE-3vGH2fKl6d8UptGmG4sPoy8gdVgSstMBsMy9M,26783
133
139
  klaude_code/session/selector.py,sha256=gijwWQkSV20XYP3Fxr27mFXuqP4ChY2DQm_YuBOTQKw,2888
134
- klaude_code/session/session.py,sha256=w9ei9kkgT7-C4hlToQm0Cd35HTTOSPYkIGnrtaoJg6Q,21386
135
- klaude_code/session/templates/export_session.html,sha256=BKFn1_EHg0vsF0g2J0sWoe0efF6eNk9loaPYEG8p3GQ,47705
140
+ klaude_code/session/session.py,sha256=NY5fbMe0E3WtZCN1U6MP_Xx6cKXZ93LO6GVX5KFEzUk,21789
141
+ klaude_code/session/templates/export_session.html,sha256=Ph_Ud6iVOcGHpyWlwEEXOj96EvaqOjhsY7U58eHULZo,47718
136
142
  klaude_code/trace/__init__.py,sha256=cETWJZZJaJ8_kA5Uki0om5n-ZpBxO9ph6YGYsJDXOEk,234
137
143
  klaude_code/trace/log.py,sha256=0H_RqkytSpt6AAIFDg-MV_8vA9zsR9BB1UqT6moTTTg,9134
138
144
  klaude_code/ui/__init__.py,sha256=XuEQsFUkJet8HI04cRmNLwnHOUqaPCRy4hF7PJnIfCY,2737
@@ -147,30 +153,30 @@ klaude_code/ui/modes/exec/__init__.py,sha256=RsYa-DmDJj6g7iXb4H9mm2_Cu-KDQOD10RJ
147
153
  klaude_code/ui/modes/exec/display.py,sha256=m2kkgaUoGD9rEVUmcm7Vs_PyAI2iruKCJYRhANjSsKo,1965
148
154
  klaude_code/ui/modes/repl/__init__.py,sha256=35a6SUiL1SDi2i43X2VjHQw97rR7yhbLBzkGI5aC6Bc,1526
149
155
  klaude_code/ui/modes/repl/clipboard.py,sha256=ZCpk7kRSXGhh0Q_BWtUUuSYT7ZOqRjAoRcg9T9n48Wo,5137
150
- klaude_code/ui/modes/repl/completers.py,sha256=RyxvbOwVXTa4PTl1thVz6YbBhXhCZa7ZX87eiGRHGp4,18224
156
+ klaude_code/ui/modes/repl/completers.py,sha256=1SZdliYseQk6JNpCZC5I3B-j7mTe4ooVyrrNqpZ77oU,18232
151
157
  klaude_code/ui/modes/repl/display.py,sha256=0u4ISeOoYjynF7InYyV-PMOZqP44QBbjYOLOL18V0c0,2245
152
- klaude_code/ui/modes/repl/event_handler.py,sha256=j24Q-ygfI2RHuYj2Atg_1vrzW7fT6lx-jww11Uzs25g,21220
158
+ klaude_code/ui/modes/repl/event_handler.py,sha256=zaTqiLhjr2LT4_TaQSG36hcRB3C4toA_xToR8UGvLVM,22400
153
159
  klaude_code/ui/modes/repl/input_prompt_toolkit.py,sha256=EAIAtcL9EHVPmVK6oOHg0xCeZ0IOnG5S5KsaL85OHOk,6368
154
160
  klaude_code/ui/modes/repl/key_bindings.py,sha256=Fxz9Ey2SnOHvfleMeSYVduxuofY0Yo-97hMRs-OMe-o,7800
155
- klaude_code/ui/modes/repl/renderer.py,sha256=M0Fhj_mQXyjHnKDzrmZ0mnPk7L6IFIU4wCgHSsffmAQ,11406
161
+ klaude_code/ui/modes/repl/renderer.py,sha256=c4NeqaK0TMuSZfzjurb5X81fQ15vErSDMnIm3O-JKP0,11583
156
162
  klaude_code/ui/renderers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
163
  klaude_code/ui/renderers/assistant.py,sha256=Dxy6v4pX28RyWhnrjBteY8_NvDIi_jQa-j0mWt-eqWY,569
158
164
  klaude_code/ui/renderers/common.py,sha256=TPH7LCbeJGqB8ArTsVitqJHEyOxHU6nwnRtvF04nLJ4,184
159
- klaude_code/ui/renderers/developer.py,sha256=fE-9LRzVLiKnK3ctFcuDDP_eehohhsgPCH_tYaOp-xs,6378
165
+ klaude_code/ui/renderers/developer.py,sha256=dlap4Cdcx4cCtbixUEQLd4UoLDaT8VXGOQtbvCIbweo,6916
160
166
  klaude_code/ui/renderers/diffs.py,sha256=iPQxxZW1JGPwtTdCKMEkDlNb5trLm9tdWjfMRmtj6yQ,7616
161
167
  klaude_code/ui/renderers/errors.py,sha256=c_fbnoNOnvuI3Bb24IujwV8Mpes-qWS_xCWfAcBvg6A,517
162
- klaude_code/ui/renderers/metadata.py,sha256=gnnIEs7iFiWNCADKa7N9FtDxvVZKtVo-6JuT2I9sIhA,7760
163
- klaude_code/ui/renderers/sub_agent.py,sha256=3cyn95pu4IniOJyWW4vfQ-X72iLufQ3LT9CkAQMuF4k,2686
164
- klaude_code/ui/renderers/thinking.py,sha256=rYc7KttyEW7r3133dFLofpiQCYH-NiZolexYo-N8Vfs,1181
165
- klaude_code/ui/renderers/tools.py,sha256=d-8udsM-81P6rwQhJgmN_J93Kj8KVvrUBbcH86PmTRc,21619
168
+ klaude_code/ui/renderers/metadata.py,sha256=eo5vtAyo3IILtGMOvFluDLPiFjNTBjnGny_Vo1FJ564,7988
169
+ klaude_code/ui/renderers/sub_agent.py,sha256=lR-NgUOHNvt9z4FBVCNGzLSqye76q3sgghIEWHkIveQ,4792
170
+ klaude_code/ui/renderers/thinking.py,sha256=OaM41EXbqSg8d7MBbkoZPW6878HCMxF-Fuq1a4eScDI,1181
171
+ klaude_code/ui/renderers/tools.py,sha256=NHqJspMxzXafBHa3yChJ-ESGaXrFHeB3feZXrwE1gcM,21660
166
172
  klaude_code/ui/renderers/user_input.py,sha256=rDdOYvbgJ6oePQAtyTCK-KhARfLKytpTZboZ-cFIuJQ,2603
167
173
  klaude_code/ui/rich/__init__.py,sha256=olvMm2SteyKioOqUJbEoav2TsDr_mtKqkSaifNumjwc,27
168
174
  klaude_code/ui/rich/live.py,sha256=Uid0QAZG7mHb4KrCF8p9c9n1nHLHzW75xSqcLZ4bLWY,2098
169
- klaude_code/ui/rich/markdown.py,sha256=k5Kx5SSoSMnVW-35dZw6Yp26ahPErDYVpKPI6wpXP8c,12347
175
+ klaude_code/ui/rich/markdown.py,sha256=5gZXSnQHPZ-Gvan2XOabOcYy3imWbcoYGh4aTf7ETcM,10773
170
176
  klaude_code/ui/rich/quote.py,sha256=tZcxN73SfDBHF_qk0Jkh9gWBqPBn8VLp9RF36YRdKEM,1123
171
177
  klaude_code/ui/rich/searchable_text.py,sha256=DCVZgEFv7_ergAvT2v7XrfQAUXUzhmAwuVAchlIx8RY,2448
172
- klaude_code/ui/rich/status.py,sha256=r5KmymTKo-FsOVBJxp8orhqFT8GP8Mf1DHkw1icnuOA,8522
173
- klaude_code/ui/rich/theme.py,sha256=yMGWoVzG9leHB3eR4ufFzW2nAhXOtiYEwwn0kvCtr4E,10140
178
+ klaude_code/ui/rich/status.py,sha256=K17T2loZdiE2mdboIhPQPp4_-DnISwLsFNrkYfnytuk,9061
179
+ klaude_code/ui/rich/theme.py,sha256=SXnV4NBmAXVPCWyLBOLapB0W_0qJ9msgw_qelpjhUzI,10151
174
180
  klaude_code/ui/terminal/__init__.py,sha256=GIMnsEcIAGT_vBHvTlWEdyNmAEpruyscUA6M_j3GQZU,1412
175
181
  klaude_code/ui/terminal/color.py,sha256=M-i09DVlLAhAyhQjfeAi7OipoGi1p_OVkaZxeRfykY0,7135
176
182
  klaude_code/ui/terminal/control.py,sha256=6SGNwxorP3jMW9xqnZy2BC0OsJd4DSrS13O3t6YlZzs,4916
@@ -180,7 +186,7 @@ klaude_code/ui/utils/__init__.py,sha256=YEsCLjbCPaPza-UXTPUMTJTrc9BmNBUP5CbFWlsh
180
186
  klaude_code/ui/utils/common.py,sha256=UCQMun23l-EREr3xkl-Bjx67yfi9ctRTw2gcGPsOM2c,2881
181
187
  klaude_code/ui/utils/debouncer.py,sha256=x8AYxf48Xd6tabBvH8cVl1bIV8FzyeDo3HswDjtNfwU,1266
182
188
  klaude_code/version.py,sha256=x2OeiACPdzS87EWtaSi_UP13htm81Uq7mlV3kFy5jko,4815
183
- klaude_code-1.2.15.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
184
- klaude_code-1.2.15.dist-info/entry_points.txt,sha256=7CWKjolvs6dZiYHpelhA_FRJ-sVDh43eu3iWuOhKc_w,53
185
- klaude_code-1.2.15.dist-info/METADATA,sha256=r1bX2TVm7kMRX4v3YEHPbhn7P954cykmgxHvQFZG2o4,5067
186
- klaude_code-1.2.15.dist-info/RECORD,,
189
+ klaude_code-1.2.16.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
190
+ klaude_code-1.2.16.dist-info/entry_points.txt,sha256=7CWKjolvs6dZiYHpelhA_FRJ-sVDh43eu3iWuOhKc_w,53
191
+ klaude_code-1.2.16.dist-info/METADATA,sha256=xIgscd6HWet__0Leukm235mUi9LLBELupz-WUb5H5X4,5261
192
+ klaude_code-1.2.16.dist-info/RECORD,,
@@ -1,354 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from collections.abc import Callable
4
- from dataclasses import dataclass, field
5
- from typing import TYPE_CHECKING, Any
6
-
7
- from klaude_code.protocol import tools
8
-
9
- if TYPE_CHECKING:
10
- from klaude_code.protocol import model
11
-
12
- AvailabilityPredicate = Callable[[str], bool]
13
- PromptBuilder = Callable[[dict[str, Any]], str]
14
-
15
-
16
- @dataclass
17
- class SubAgentResult:
18
- task_result: str
19
- session_id: str
20
- error: bool = False
21
- task_metadata: model.TaskMetadata | None = None
22
-
23
-
24
- def _default_prompt_builder(args: dict[str, Any]) -> str:
25
- """Default prompt builder that just returns the 'prompt' field."""
26
- return args.get("prompt", "")
27
-
28
-
29
- @dataclass(frozen=True)
30
- class SubAgentProfile:
31
- """Metadata describing a sub agent and how it integrates with the system.
32
-
33
- This dataclass contains all the information needed to:
34
- 1. Register the sub agent with the system
35
- 2. Generate the tool schema for the main agent
36
- 3. Build the prompt for the sub agent
37
- """
38
-
39
- # Identity - single name used for type, tool_name, config_key, and prompt_key
40
- name: str # e.g., "Task", "Oracle", "Explore"
41
-
42
- # Tool schema
43
- description: str # Tool description shown to the main agent
44
- parameters: dict[str, Any] = field(
45
- default_factory=lambda: dict[str, Any](), hash=False
46
- ) # JSON Schema for tool parameters
47
-
48
- # Sub agent configuration
49
- tool_set: tuple[str, ...] = () # Tools available to this sub agent
50
- prompt_builder: PromptBuilder = _default_prompt_builder # Builds the sub agent prompt from tool arguments
51
-
52
- # UI display
53
- active_form: str = "" # Active form for spinner status (e.g., "Tasking", "Exploring")
54
-
55
- # Availability
56
- enabled_by_default: bool = True
57
- show_in_main_agent: bool = True
58
- target_model_filter: AvailabilityPredicate | None = None
59
-
60
- def enabled_for_model(self, model_name: str | None) -> bool:
61
- if not self.enabled_by_default:
62
- return False
63
- if model_name is None or self.target_model_filter is None:
64
- return True
65
- return self.target_model_filter(model_name)
66
-
67
-
68
- _PROFILES: dict[str, SubAgentProfile] = {}
69
-
70
-
71
- def register_sub_agent(profile: SubAgentProfile) -> None:
72
- if profile.name in _PROFILES:
73
- raise ValueError(f"Duplicate sub agent profile: {profile.name}")
74
- _PROFILES[profile.name] = profile
75
-
76
-
77
- def get_sub_agent_profile(sub_agent_type: tools.SubAgentType) -> SubAgentProfile:
78
- try:
79
- return _PROFILES[sub_agent_type]
80
- except KeyError as exc:
81
- raise KeyError(f"Unknown sub agent type: {sub_agent_type}") from exc
82
-
83
-
84
- def iter_sub_agent_profiles(enabled_only: bool = False, model_name: str | None = None) -> list[SubAgentProfile]:
85
- profiles = list(_PROFILES.values())
86
- if not enabled_only:
87
- return profiles
88
- return [p for p in profiles if p.enabled_for_model(model_name)]
89
-
90
-
91
- def get_sub_agent_profile_by_tool(tool_name: str) -> SubAgentProfile | None:
92
- return _PROFILES.get(tool_name)
93
-
94
-
95
- def is_sub_agent_tool(tool_name: str) -> bool:
96
- return tool_name in _PROFILES
97
-
98
-
99
- def sub_agent_tool_names(enabled_only: bool = False, model_name: str | None = None) -> list[str]:
100
- return [
101
- profile.name
102
- for profile in iter_sub_agent_profiles(enabled_only=enabled_only, model_name=model_name)
103
- if profile.show_in_main_agent
104
- ]
105
-
106
-
107
- # -----------------------------------------------------------------------------
108
- # Sub Agent Definitions
109
- # -----------------------------------------------------------------------------
110
-
111
- TASK_DESCRIPTION = """\
112
- Launch a new agent to handle complex, multi-step tasks autonomously. \
113
-
114
- When NOT to use the Task tool:
115
- - If you want to read a specific file path, use the Read or Bash tool for `rg` instead of the Task tool, to find the match more quickly
116
- - If you are searching for a specific class definition like "class Foo", use the Bash tool for `rg` instead, to find the match more quickly
117
- - If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly
118
- - Other tasks that are not related to the agent descriptions above
119
-
120
- Usage notes:
121
- - Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
122
- - When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
123
- - Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
124
- - The agent's outputs should generally be trusted
125
- - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, etc.), since it is not aware of the user's intent
126
- - If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.
127
- - If the user specifies that they want you to run agents "in parallel", you MUST send a single message with multiple Task tool use content blocks. For example, if you need to launch both a code-reviewer agent and a test-runner agent in parallel, send a single message with both tool calls.\
128
- """
129
-
130
- TASK_PARAMETERS = {
131
- "type": "object",
132
- "properties": {
133
- "description": {
134
- "type": "string",
135
- "description": "A short (3-5 word) description of the task",
136
- },
137
- "prompt": {
138
- "type": "string",
139
- "description": "The task for the agent to perform",
140
- },
141
- },
142
- "required": ["description", "prompt"],
143
- "additionalProperties": False,
144
- }
145
-
146
- register_sub_agent(
147
- SubAgentProfile(
148
- name="Task",
149
- description=TASK_DESCRIPTION,
150
- parameters=TASK_PARAMETERS,
151
- tool_set=(tools.BASH, tools.READ, tools.EDIT, tools.WRITE),
152
- active_form="Tasking",
153
- )
154
- )
155
-
156
-
157
- # -----------------------------------------------------------------------------
158
- # Oracle Sub Agent
159
- # -----------------------------------------------------------------------------
160
-
161
- ORACLE_DESCRIPTION = """\
162
- Consult the Oracle - an AI advisor powered by OpenAI's premium reasoning model that can plan, review, and provide expert guidance.
163
-
164
- The Oracle has access to the following tools: Read, Bash.
165
-
166
- The Oracle acts as your senior engineering advisor and can help with:
167
-
168
- WHEN TO USE THE ORACLE:
169
- - Code reviews and architecture feedback
170
- - Finding a bug in multiple files
171
- - Planning complex implementations or refactoring
172
- - Analyzing code quality and suggesting improvements
173
- - Answering complex technical questions that require deep reasoning
174
-
175
- WHEN NOT TO USE THE ORACLE:
176
- - Simple file reading or searching tasks (use Read or Grep directly)
177
- - Codebase searches (use Task)
178
- - Basic code modifications and when you need to execute code changes (do it yourself or use Task)
179
-
180
- USAGE GUIDELINES:
181
- 1. Be specific about what you want the Oracle to review, plan, or debug
182
- 2. Provide relevant context about what you're trying to achieve. If you know that any files are involved, list them and they will be attached.
183
-
184
-
185
- EXAMPLES:
186
- - "Review the authentication system architecture and suggest improvements"
187
- - "Plan the implementation of real-time collaboration features"
188
- - "Analyze the performance bottlenecks in the data processing pipeline"
189
- - "Review this API design and suggest better patterns"\
190
- """
191
-
192
- ORACLE_PARAMETERS = {
193
- "properties": {
194
- "context": {
195
- "description": "Optional context about the current situation, what you've tried, or background information that would help the Oracle provide better guidance.",
196
- "type": "string",
197
- },
198
- "files": {
199
- "description": "Optional list of specific file paths (text files, images) that the Oracle should examine as part of its analysis. These files will be attached to the Oracle input.",
200
- "items": {"type": "string"},
201
- "type": "array",
202
- },
203
- "task": {
204
- "description": "The task or question you want the Oracle to help with. Be specific about what kind of guidance, review, or planning you need.",
205
- "type": "string",
206
- },
207
- "description": {
208
- "description": "A short (3-5 word) description of the task",
209
- "type": "string",
210
- },
211
- },
212
- "required": ["task", "description"],
213
- "type": "object",
214
- }
215
-
216
-
217
- def _oracle_prompt_builder(args: dict[str, Any]) -> str:
218
- """Build the Oracle prompt from tool arguments."""
219
- context = args.get("context", "")
220
- task = args.get("task", "")
221
- files = args.get("files", [])
222
-
223
- prompt = f"""Context: {context}
224
-
225
- Task: {task}
226
- """
227
- if files:
228
- files_str = "\n".join(f"@{file}" for file in files)
229
- prompt += f"\nRelated files to review:\n{files_str}"
230
- return prompt
231
-
232
-
233
- register_sub_agent(
234
- SubAgentProfile(
235
- name="Oracle",
236
- description=ORACLE_DESCRIPTION,
237
- parameters=ORACLE_PARAMETERS,
238
- tool_set=(tools.READ, tools.BASH),
239
- prompt_builder=_oracle_prompt_builder,
240
- active_form="Consulting Oracle",
241
- target_model_filter=lambda model: ("gpt-5" not in model) and ("gemini-3" not in model),
242
- )
243
- )
244
-
245
-
246
- # -----------------------------------------------------------------------------
247
- # Explore Sub Agent
248
- # -----------------------------------------------------------------------------
249
-
250
- EXPLORE_DESCRIPTION = """\
251
- Spin up a fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), \
252
- search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?")\
253
- When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.
254
- Always spawn multiple search agents in parallel to maximise speed.\
255
- """
256
-
257
- EXPLORE_PARAMETERS = {
258
- "type": "object",
259
- "properties": {
260
- "description": {
261
- "type": "string",
262
- "description": "Short (3-5 words) label for the exploration goal",
263
- },
264
- "prompt": {
265
- "type": "string",
266
- "description": "The task for the agent to perform",
267
- },
268
- "thoroughness": {
269
- "type": "string",
270
- "enum": ["quick", "medium", "very thorough"],
271
- "description": "Controls how deep the sub-agent should search the repo",
272
- },
273
- },
274
- "required": ["description", "prompt"],
275
- "additionalProperties": False,
276
- }
277
-
278
-
279
- def _explore_prompt_builder(args: dict[str, Any]) -> str:
280
- """Build the Explore prompt from tool arguments."""
281
- prompt = args.get("prompt", "").strip()
282
- thoroughness = args.get("thoroughness", "medium")
283
- return f"{prompt}\nthoroughness: {thoroughness}"
284
-
285
-
286
- register_sub_agent(
287
- SubAgentProfile(
288
- name="Explore",
289
- description=EXPLORE_DESCRIPTION,
290
- parameters=EXPLORE_PARAMETERS,
291
- tool_set=(tools.BASH, tools.READ),
292
- prompt_builder=_explore_prompt_builder,
293
- active_form="Exploring",
294
- )
295
- )
296
-
297
-
298
- # -----------------------------------------------------------------------------
299
- # WebFetchAgent Sub Agent
300
- # -----------------------------------------------------------------------------
301
-
302
- WEB_FETCH_AGENT_DESCRIPTION = """\
303
- Launch a sub-agent to fetch and analyze web content. Use this when you need to:
304
- - Retrieve and extract information from a webpage
305
- - Analyze web page content based on specific instructions
306
- - Get structured data from URLs
307
-
308
- The agent will fetch the URL content, handle HTML-to-Markdown conversion automatically, \
309
- and can use tools like rg to search through large responses that were truncated and saved to files.
310
-
311
- Usage notes:
312
- - Provide a clear prompt describing what information to extract or analyze
313
- - The agent will return a summary of the findings
314
- - For large web pages, the content may be truncated and saved to a file; the agent can search through it\
315
- """
316
-
317
- WEB_FETCH_AGENT_PARAMETERS = {
318
- "type": "object",
319
- "properties": {
320
- "description": {
321
- "type": "string",
322
- "description": "A short (3-5 word) description of the task",
323
- },
324
- "url": {
325
- "type": "string",
326
- "description": "The URL to fetch and analyze",
327
- },
328
- "prompt": {
329
- "type": "string",
330
- "description": "Instructions for analyzing or extracting content from the web page",
331
- },
332
- },
333
- "required": ["description", "url", "prompt"],
334
- "additionalProperties": False,
335
- }
336
-
337
-
338
- def _web_fetch_prompt_builder(args: dict[str, Any]) -> str:
339
- """Build the WebFetchAgent prompt from tool arguments."""
340
- url = args.get("url", "")
341
- prompt = args.get("prompt", "")
342
- return f"URL to fetch: {url}\nTask: {prompt}"
343
-
344
-
345
- register_sub_agent(
346
- SubAgentProfile(
347
- name="WebFetchAgent",
348
- description=WEB_FETCH_AGENT_DESCRIPTION,
349
- parameters=WEB_FETCH_AGENT_PARAMETERS,
350
- tool_set=(tools.BASH, tools.READ, tools.WEB_FETCH),
351
- prompt_builder=_web_fetch_prompt_builder,
352
- active_form="Fetching Web",
353
- )
354
- )