klaude-code 1.2.15__py3-none-any.whl → 1.2.17__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.
- klaude_code/cli/main.py +66 -42
- klaude_code/cli/runtime.py +34 -13
- klaude_code/command/__init__.py +3 -0
- klaude_code/command/export_cmd.py +2 -2
- klaude_code/command/export_online_cmd.py +149 -0
- klaude_code/command/prompt-handoff.md +33 -0
- klaude_code/command/thinking_cmd.py +5 -1
- klaude_code/config/config.py +20 -21
- klaude_code/config/list_model.py +1 -1
- klaude_code/const/__init__.py +3 -0
- klaude_code/core/executor.py +2 -2
- klaude_code/core/manager/llm_clients_builder.py +1 -1
- klaude_code/core/manager/sub_agent_manager.py +30 -6
- klaude_code/core/prompt.py +15 -13
- klaude_code/core/prompts/{prompt-subagent-explore.md → prompt-sub-agent-explore.md} +0 -1
- klaude_code/core/prompts/{prompt-subagent-oracle.md → prompt-sub-agent-oracle.md} +1 -2
- klaude_code/core/prompts/prompt-sub-agent-web.md +48 -0
- klaude_code/core/reminders.py +75 -32
- klaude_code/core/task.py +18 -22
- klaude_code/core/tool/__init__.py +4 -0
- klaude_code/core/tool/report_back_tool.py +84 -0
- klaude_code/core/tool/sub_agent_tool.py +6 -0
- klaude_code/core/tool/tool_runner.py +9 -1
- klaude_code/core/tool/web/web_search_tool.md +23 -0
- klaude_code/core/tool/web/web_search_tool.py +126 -0
- klaude_code/core/turn.py +45 -4
- klaude_code/llm/anthropic/input.py +14 -5
- klaude_code/llm/openrouter/input.py +14 -3
- klaude_code/llm/responses/input.py +19 -0
- klaude_code/protocol/commands.py +1 -0
- klaude_code/protocol/events.py +9 -0
- klaude_code/protocol/model.py +24 -14
- klaude_code/protocol/sub_agent/__init__.py +117 -0
- klaude_code/protocol/sub_agent/explore.py +63 -0
- klaude_code/protocol/sub_agent/oracle.py +91 -0
- klaude_code/protocol/sub_agent/task.py +61 -0
- klaude_code/protocol/sub_agent/web.py +78 -0
- klaude_code/protocol/tools.py +2 -0
- klaude_code/session/export.py +12 -6
- klaude_code/session/session.py +12 -2
- klaude_code/session/templates/export_session.html +111 -36
- klaude_code/ui/modes/repl/completers.py +1 -1
- klaude_code/ui/modes/repl/event_handler.py +65 -8
- klaude_code/ui/modes/repl/renderer.py +11 -9
- klaude_code/ui/renderers/developer.py +18 -7
- klaude_code/ui/renderers/metadata.py +24 -12
- klaude_code/ui/renderers/sub_agent.py +63 -3
- klaude_code/ui/renderers/thinking.py +1 -1
- klaude_code/ui/renderers/tools.py +24 -37
- klaude_code/ui/rich/markdown.py +20 -48
- klaude_code/ui/rich/status.py +61 -17
- klaude_code/ui/rich/theme.py +8 -7
- {klaude_code-1.2.15.dist-info → klaude_code-1.2.17.dist-info}/METADATA +114 -22
- {klaude_code-1.2.15.dist-info → klaude_code-1.2.17.dist-info}/RECORD +57 -48
- klaude_code/core/prompts/prompt-subagent-webfetch.md +0 -46
- klaude_code/protocol/sub_agent.py +0 -354
- /klaude_code/core/prompts/{prompt-subagent.md → prompt-sub-agent.md} +0 -0
- {klaude_code-1.2.15.dist-info → klaude_code-1.2.17.dist-info}/WHEEL +0 -0
- {klaude_code-1.2.15.dist-info → klaude_code-1.2.17.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
ORACLE_DESCRIPTION = """\
|
|
9
|
+
Consult the Oracle - an AI advisor powered by OpenAI's premium reasoning model that can plan, review, and provide expert guidance.
|
|
10
|
+
|
|
11
|
+
The Oracle has access to the following tools: Read, Bash.
|
|
12
|
+
|
|
13
|
+
The Oracle acts as your senior engineering advisor and can help with:
|
|
14
|
+
|
|
15
|
+
WHEN TO USE THE ORACLE:
|
|
16
|
+
- Code reviews and architecture feedback
|
|
17
|
+
- Finding a bug in multiple files
|
|
18
|
+
- Planning complex implementations or refactoring
|
|
19
|
+
- Analyzing code quality and suggesting improvements
|
|
20
|
+
- Answering complex technical questions that require deep reasoning
|
|
21
|
+
|
|
22
|
+
WHEN NOT TO USE THE ORACLE:
|
|
23
|
+
- Simple file reading or searching tasks (use Read or Grep directly)
|
|
24
|
+
- Codebase searches (use Task)
|
|
25
|
+
- Basic code modifications and when you need to execute code changes (do it yourself or use Task)
|
|
26
|
+
|
|
27
|
+
USAGE GUIDELINES:
|
|
28
|
+
1. Be specific about what you want the Oracle to review, plan, or debug
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
EXAMPLES:
|
|
33
|
+
- "Review the authentication system architecture and suggest improvements"
|
|
34
|
+
- "Plan the implementation of real-time collaboration features"
|
|
35
|
+
- "Analyze the performance bottlenecks in the data processing pipeline"
|
|
36
|
+
- "Review this API design and suggest better patterns"\
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
ORACLE_PARAMETERS = {
|
|
40
|
+
"properties": {
|
|
41
|
+
"context": {
|
|
42
|
+
"description": "Optional context about the current situation, what you've tried, or background information that would help the Oracle provide better guidance.",
|
|
43
|
+
"type": "string",
|
|
44
|
+
},
|
|
45
|
+
"files": {
|
|
46
|
+
"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.",
|
|
47
|
+
"items": {"type": "string"},
|
|
48
|
+
"type": "array",
|
|
49
|
+
},
|
|
50
|
+
"task": {
|
|
51
|
+
"description": "The task or question you want the Oracle to help with. Be specific about what kind of guidance, review, or planning you need.",
|
|
52
|
+
"type": "string",
|
|
53
|
+
},
|
|
54
|
+
"description": {
|
|
55
|
+
"description": "A short (3-5 word) description of the task",
|
|
56
|
+
"type": "string",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
"required": ["task", "description"],
|
|
60
|
+
"type": "object",
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _oracle_prompt_builder(args: dict[str, Any]) -> str:
|
|
65
|
+
"""Build the Oracle prompt from tool arguments."""
|
|
66
|
+
context = args.get("context", "")
|
|
67
|
+
task = args.get("task", "")
|
|
68
|
+
files = args.get("files", [])
|
|
69
|
+
|
|
70
|
+
prompt = f"""\
|
|
71
|
+
Context: {context}
|
|
72
|
+
Task: {task}\
|
|
73
|
+
"""
|
|
74
|
+
if files:
|
|
75
|
+
files_str = "\n".join(f"@{file}" for file in files)
|
|
76
|
+
prompt += f"\nRelated files to review:\n{files_str}"
|
|
77
|
+
return prompt
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
register_sub_agent(
|
|
81
|
+
SubAgentProfile(
|
|
82
|
+
name="Oracle",
|
|
83
|
+
description=ORACLE_DESCRIPTION,
|
|
84
|
+
parameters=ORACLE_PARAMETERS,
|
|
85
|
+
prompt_file="prompts/prompt-sub-agent-oracle.md",
|
|
86
|
+
tool_set=(tools.READ, tools.BASH),
|
|
87
|
+
prompt_builder=_oracle_prompt_builder,
|
|
88
|
+
active_form="Consulting Oracle",
|
|
89
|
+
target_model_filter=lambda model: ("gpt-5" not in model) and ("gemini-3" not in model),
|
|
90
|
+
)
|
|
91
|
+
)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from klaude_code.protocol import tools
|
|
4
|
+
from klaude_code.protocol.sub_agent import SubAgentProfile, register_sub_agent
|
|
5
|
+
|
|
6
|
+
TASK_DESCRIPTION = """\
|
|
7
|
+
Launch a new agent to handle complex, multi-step tasks autonomously. \
|
|
8
|
+
|
|
9
|
+
When NOT to use the Task tool:
|
|
10
|
+
- 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
|
|
11
|
+
- 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
|
|
12
|
+
- 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
|
|
13
|
+
- Other tasks that are not related to the agent descriptions above
|
|
14
|
+
|
|
15
|
+
Usage notes:
|
|
16
|
+
- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
|
|
17
|
+
- 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.
|
|
18
|
+
- 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.
|
|
19
|
+
- The agent's outputs should generally be trusted
|
|
20
|
+
- 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
|
|
21
|
+
- 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.
|
|
22
|
+
- 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.
|
|
23
|
+
|
|
24
|
+
Structured output:
|
|
25
|
+
- Provide an `output_format` (JSON Schema) parameter for structured data back from the agent
|
|
26
|
+
- Example: `output_format={"type": "object", "properties": {"files": {"type": "array", "items": {"type": "string"}, "description": "List of file paths that match the search criteria, e.g. ['src/main.py', 'src/utils/helper.py']"}}, "required": ["files"]}`\
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
TASK_PARAMETERS = {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"description": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "A short (3-5 word) description of the task",
|
|
35
|
+
},
|
|
36
|
+
"prompt": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The task for the agent to perform",
|
|
39
|
+
},
|
|
40
|
+
"output_format": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"description": (
|
|
43
|
+
"Optional JSON Schema for structured output, better with examples in argument descriptions."
|
|
44
|
+
),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"required": ["description", "prompt"],
|
|
48
|
+
"additionalProperties": False,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
register_sub_agent(
|
|
52
|
+
SubAgentProfile(
|
|
53
|
+
name="Task",
|
|
54
|
+
description=TASK_DESCRIPTION,
|
|
55
|
+
parameters=TASK_PARAMETERS,
|
|
56
|
+
prompt_file="prompts/prompt-sub-agent.md",
|
|
57
|
+
tool_set=(tools.BASH, tools.READ, tools.EDIT, tools.WRITE),
|
|
58
|
+
active_form="Tasking",
|
|
59
|
+
output_schema_arg="output_format",
|
|
60
|
+
)
|
|
61
|
+
)
|
|
@@ -0,0 +1,78 @@
|
|
|
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_AGENT_DESCRIPTION = """\
|
|
9
|
+
Launch a sub-agent to search the web, fetch pages, and analyze content. Use this for:
|
|
10
|
+
- Accessing up-to-date information beyond your knowledge cutoff (current events, recent releases, latest docs)
|
|
11
|
+
- Researching topics, news, APIs, or technical references
|
|
12
|
+
- Fetching and analyzing specific URLs
|
|
13
|
+
- Gathering comprehensive information from multiple web sources
|
|
14
|
+
|
|
15
|
+
Capabilities:
|
|
16
|
+
- Search the web to find relevant pages (no URL required)
|
|
17
|
+
- Fetch and parse web pages (HTML-to-Markdown conversion)
|
|
18
|
+
- Follow links across multiple pages autonomously
|
|
19
|
+
- Aggregate findings from multiple sources
|
|
20
|
+
|
|
21
|
+
How to use:
|
|
22
|
+
- Write a clear prompt describing what information you need - the agent will search and fetch as needed
|
|
23
|
+
- Optionally provide a `url` if you already know the target page
|
|
24
|
+
- Use `output_format` (JSON Schema) to get structured data back from the agent
|
|
25
|
+
- Account for "Today's date" in <env>. For example, if <env> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.
|
|
26
|
+
|
|
27
|
+
What you receive:
|
|
28
|
+
- The agent returns a text response summarizing its findings
|
|
29
|
+
- With `output_format`, you receive structured JSON matching your schema
|
|
30
|
+
- The response is the agent's analysis, not raw web content\
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
WEB_AGENT_PARAMETERS = {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"description": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "A short (3-5 word) description of the task",
|
|
39
|
+
},
|
|
40
|
+
"url": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "The URL to fetch and analyze. If not provided, the agent will search the web first",
|
|
43
|
+
},
|
|
44
|
+
"prompt": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Instructions for searching, analyzing, or extracting content from the web page",
|
|
47
|
+
},
|
|
48
|
+
"output_format": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"description": "Optional JSON Schema for sub-agent structured output",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
"required": ["description", "prompt"],
|
|
54
|
+
"additionalProperties": False,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _web_agent_prompt_builder(args: dict[str, Any]) -> str:
|
|
59
|
+
"""Build the WebAgent prompt from tool arguments."""
|
|
60
|
+
url = args.get("url", "")
|
|
61
|
+
prompt = args.get("prompt", "")
|
|
62
|
+
if url:
|
|
63
|
+
return f"URL to fetch: {url}\nTask: {prompt}"
|
|
64
|
+
return prompt
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
register_sub_agent(
|
|
68
|
+
SubAgentProfile(
|
|
69
|
+
name="WebAgent",
|
|
70
|
+
description=WEB_AGENT_DESCRIPTION,
|
|
71
|
+
parameters=WEB_AGENT_PARAMETERS,
|
|
72
|
+
prompt_file="prompts/prompt-sub-agent-web.md",
|
|
73
|
+
tool_set=(tools.BASH, tools.READ, tools.WEB_FETCH, tools.WEB_SEARCH),
|
|
74
|
+
prompt_builder=_web_agent_prompt_builder,
|
|
75
|
+
active_form="Surfing",
|
|
76
|
+
output_schema_arg="output_format",
|
|
77
|
+
)
|
|
78
|
+
)
|
klaude_code/protocol/tools.py
CHANGED
klaude_code/session/export.py
CHANGED
|
@@ -299,18 +299,24 @@ def _try_render_todo_args(arguments: str) -> str | None:
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
def _render_sub_agent_result(content: str) -> str:
|
|
302
|
-
|
|
302
|
+
# Try to format as JSON for better readability
|
|
303
|
+
try:
|
|
304
|
+
parsed = json.loads(content)
|
|
305
|
+
formatted = "```json\n" + json.dumps(parsed, ensure_ascii=False, indent=2) + "\n```"
|
|
306
|
+
except (json.JSONDecodeError, TypeError):
|
|
307
|
+
formatted = content
|
|
308
|
+
encoded = _escape_html(formatted)
|
|
303
309
|
return (
|
|
304
|
-
f'<div class="
|
|
305
|
-
f'<div class="
|
|
310
|
+
f'<div class="sub-agent-result-container">'
|
|
311
|
+
f'<div class="sub-agent-toolbar">'
|
|
306
312
|
f'<button type="button" class="raw-toggle" aria-pressed="false" title="Toggle raw text view">Raw</button>'
|
|
307
313
|
f'<button type="button" class="copy-raw-btn" title="Copy raw content">Copy</button>'
|
|
308
314
|
f"</div>"
|
|
309
|
-
f'<div class="
|
|
310
|
-
f'<div class="
|
|
315
|
+
f'<div class="sub-agent-content">'
|
|
316
|
+
f'<div class="sub-agent-rendered markdown-content markdown-body" data-raw="{encoded}">'
|
|
311
317
|
f'<noscript><pre style="white-space: pre-wrap;">{encoded}</pre></noscript>'
|
|
312
318
|
f"</div>"
|
|
313
|
-
f'<pre class="
|
|
319
|
+
f'<pre class="sub-agent-raw">{encoded}</pre>'
|
|
314
320
|
f"</div>"
|
|
315
321
|
f"</div>"
|
|
316
322
|
)
|
klaude_code/session/session.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing import ClassVar
|
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel, Field, PrivateAttr
|
|
9
9
|
|
|
10
|
-
from klaude_code.protocol import events, model
|
|
10
|
+
from klaude_code.protocol import events, model, tools
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Session(BaseModel):
|
|
@@ -270,6 +270,7 @@ class Session(BaseModel):
|
|
|
270
270
|
seen_sub_agent_sessions: set[str] = set()
|
|
271
271
|
prev_item: model.ConversationItem | None = None
|
|
272
272
|
last_assistant_content: str = ""
|
|
273
|
+
report_back_result: str | None = None
|
|
273
274
|
yield events.TaskStartEvent(session_id=self.id, sub_agent_state=self.sub_agent_state)
|
|
274
275
|
for it in self.conversation_history:
|
|
275
276
|
if self.need_turn_start(prev_item, it):
|
|
@@ -286,6 +287,8 @@ class Session(BaseModel):
|
|
|
286
287
|
session_id=self.id,
|
|
287
288
|
)
|
|
288
289
|
case model.ToolCallItem() as tc:
|
|
290
|
+
if tc.name == tools.REPORT_BACK:
|
|
291
|
+
report_back_result = tc.arguments
|
|
289
292
|
yield events.ToolCallEvent(
|
|
290
293
|
tool_call_id=tc.call_id,
|
|
291
294
|
tool_name=tc.name,
|
|
@@ -336,7 +339,14 @@ class Session(BaseModel):
|
|
|
336
339
|
case _:
|
|
337
340
|
continue
|
|
338
341
|
prev_item = it
|
|
339
|
-
|
|
342
|
+
|
|
343
|
+
has_structured_output = report_back_result is not None
|
|
344
|
+
task_result = report_back_result if has_structured_output else last_assistant_content
|
|
345
|
+
yield events.TaskFinishEvent(
|
|
346
|
+
session_id=self.id,
|
|
347
|
+
task_result=task_result,
|
|
348
|
+
has_structured_output=has_structured_output,
|
|
349
|
+
)
|
|
340
350
|
|
|
341
351
|
def _iter_sub_agent_history(
|
|
342
352
|
self, tool_result: model.ToolResultItem, seen_sub_agent_sessions: set[str]
|
|
@@ -632,26 +632,26 @@
|
|
|
632
632
|
color: var(--text-dim);
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
-
/* Sub
|
|
636
|
-
.
|
|
635
|
+
/* Sub-Agent Result */
|
|
636
|
+
.sub-agent-result-container {
|
|
637
637
|
display: flex;
|
|
638
638
|
flex-direction: column;
|
|
639
639
|
gap: 8px;
|
|
640
640
|
margin-top: 8px;
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
-
.
|
|
643
|
+
.sub-agent-toolbar {
|
|
644
644
|
display: flex;
|
|
645
645
|
justify-content: flex-end;
|
|
646
646
|
align-items: center;
|
|
647
647
|
margin-bottom: 4px;
|
|
648
648
|
}
|
|
649
649
|
|
|
650
|
-
.
|
|
650
|
+
.sub-agent-content {
|
|
651
651
|
width: 100%;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
.
|
|
654
|
+
.sub-agent-raw {
|
|
655
655
|
display: none;
|
|
656
656
|
font-family: var(--font-mono);
|
|
657
657
|
font-size: var(--font-size-base);
|
|
@@ -662,18 +662,112 @@
|
|
|
662
662
|
padding: 20px;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
-
.
|
|
665
|
+
.sub-agent-content.show-raw .sub-agent-rendered {
|
|
666
666
|
display: none;
|
|
667
667
|
}
|
|
668
|
-
.
|
|
668
|
+
.sub-agent-content.show-raw .sub-agent-raw {
|
|
669
669
|
display: block;
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
/* Markdown Elements */
|
|
673
673
|
.markdown-body {
|
|
674
674
|
font-family: var(--font-markdown);
|
|
675
|
-
line-height: 1.
|
|
675
|
+
line-height: 1.6;
|
|
676
|
+
font-size: var(--font-size-base);
|
|
677
|
+
}
|
|
678
|
+
.markdown-body > *:first-child {
|
|
679
|
+
margin-top: 0 !important;
|
|
680
|
+
}
|
|
681
|
+
.markdown-body > *:last-child {
|
|
682
|
+
margin-bottom: 0 !important;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.markdown-body h1,
|
|
686
|
+
.markdown-body h2,
|
|
687
|
+
.markdown-body h3,
|
|
688
|
+
.markdown-body h4,
|
|
689
|
+
.markdown-body h5,
|
|
690
|
+
.markdown-body h6 {
|
|
691
|
+
margin-top: 24px;
|
|
692
|
+
margin-bottom: 16px;
|
|
693
|
+
font-weight: var(--font-weight-bold);
|
|
694
|
+
line-height: 1.25;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.markdown-body a {
|
|
698
|
+
color: var(--accent);
|
|
699
|
+
text-decoration: none;
|
|
700
|
+
border-bottom: 1px solid rgba(8, 81, 178, 0.2);
|
|
701
|
+
transition: border-color 0.2s, background-color 0.2s;
|
|
702
|
+
}
|
|
703
|
+
.markdown-body a:hover {
|
|
704
|
+
border-bottom-color: var(--accent);
|
|
705
|
+
background-color: rgba(8, 81, 178, 0.05);
|
|
706
|
+
border-radius: 2px;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.markdown-body p {
|
|
710
|
+
margin-bottom: 8px; /* Tighter spacing */
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.markdown-body ul,
|
|
714
|
+
.markdown-body ol {
|
|
715
|
+
margin-bottom: 8px; /* Tighter spacing */
|
|
716
|
+
padding-left: 1.5rem;
|
|
717
|
+
list-style-position: outside;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.markdown-body ul ul,
|
|
721
|
+
.markdown-body ol ul,
|
|
722
|
+
.markdown-body ul ol,
|
|
723
|
+
.markdown-body ol ol {
|
|
724
|
+
margin-top: 0;
|
|
725
|
+
margin-bottom: 0;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.markdown-body li > p {
|
|
729
|
+
margin-bottom: 0;
|
|
730
|
+
}
|
|
731
|
+
.markdown-body li + li {
|
|
732
|
+
margin-top: 0.25em;
|
|
676
733
|
}
|
|
734
|
+
|
|
735
|
+
.markdown-body blockquote {
|
|
736
|
+
margin: 0 0 16px;
|
|
737
|
+
padding: 0 1em;
|
|
738
|
+
color: var(--text-dim);
|
|
739
|
+
border-left: 0.25em solid var(--border);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.markdown-body table {
|
|
743
|
+
border-collapse: collapse;
|
|
744
|
+
width: 100%;
|
|
745
|
+
margin-top: 8px;
|
|
746
|
+
margin-bottom: 16px;
|
|
747
|
+
display: block;
|
|
748
|
+
overflow-x: auto;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.markdown-body table tr {
|
|
752
|
+
background-color: var(--bg-card);
|
|
753
|
+
border-top: 1px solid var(--border);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.markdown-body table tr:nth-child(2n) {
|
|
757
|
+
background-color: rgba(0, 0, 0, 0.02);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.markdown-body table th,
|
|
761
|
+
.markdown-body table td {
|
|
762
|
+
padding: 6px 13px;
|
|
763
|
+
border: 1px solid var(--border);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.markdown-body table th {
|
|
767
|
+
font-weight: var(--font-weight-bold);
|
|
768
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
769
|
+
}
|
|
770
|
+
|
|
677
771
|
.markdown-body hr {
|
|
678
772
|
height: 0;
|
|
679
773
|
margin: 24px 0;
|
|
@@ -682,10 +776,10 @@
|
|
|
682
776
|
}
|
|
683
777
|
.markdown-body pre {
|
|
684
778
|
background: var(--bg-code);
|
|
685
|
-
padding:
|
|
779
|
+
padding: 12px;
|
|
686
780
|
border-radius: var(--radius-md);
|
|
687
781
|
overflow-x: auto;
|
|
688
|
-
margin:
|
|
782
|
+
margin: 8px 0 16px 0;
|
|
689
783
|
border: 1px solid var(--border);
|
|
690
784
|
}
|
|
691
785
|
.markdown-body code {
|
|
@@ -694,36 +788,17 @@
|
|
|
694
788
|
font-size: var(--font-size-sm);
|
|
695
789
|
padding: 2px 4px;
|
|
696
790
|
border-radius: var(--radius-sm);
|
|
791
|
+
background-color: rgba(0, 0, 0, 0.05); /* Slight bg for inline code */
|
|
697
792
|
}
|
|
698
793
|
.markdown-body pre code {
|
|
699
794
|
background: transparent;
|
|
700
795
|
padding: 0;
|
|
701
796
|
border-radius: 0;
|
|
797
|
+
color: inherit;
|
|
702
798
|
}
|
|
703
799
|
.markdown-body pre code.hljs {
|
|
704
800
|
background: transparent;
|
|
705
801
|
}
|
|
706
|
-
.markdown-body p {
|
|
707
|
-
margin-bottom: 12px;
|
|
708
|
-
}
|
|
709
|
-
.markdown-body > *:first-child {
|
|
710
|
-
margin-top: 0;
|
|
711
|
-
}
|
|
712
|
-
.markdown-body > *:last-child {
|
|
713
|
-
margin-bottom: 0;
|
|
714
|
-
}
|
|
715
|
-
.markdown-body ul,
|
|
716
|
-
.markdown-body ol {
|
|
717
|
-
margin-bottom: 12px;
|
|
718
|
-
padding-left: 1.5rem;
|
|
719
|
-
list-style-position: outside;
|
|
720
|
-
}
|
|
721
|
-
.markdown-body ul ul,
|
|
722
|
-
.markdown-body ol ul,
|
|
723
|
-
.markdown-body ul ol,
|
|
724
|
-
.markdown-body ol ol {
|
|
725
|
-
margin-left: 1rem;
|
|
726
|
-
}
|
|
727
802
|
|
|
728
803
|
/* Diff View */
|
|
729
804
|
.diff-view {
|
|
@@ -1297,17 +1372,17 @@
|
|
|
1297
1372
|
});
|
|
1298
1373
|
});
|
|
1299
1374
|
|
|
1300
|
-
//
|
|
1375
|
+
// Sub-agent raw toggle
|
|
1301
1376
|
document
|
|
1302
|
-
.querySelectorAll(".
|
|
1377
|
+
.querySelectorAll(".sub-agent-result-container")
|
|
1303
1378
|
.forEach((group) => {
|
|
1304
1379
|
const toggle = group.querySelector(".raw-toggle");
|
|
1305
1380
|
const copyBtn = group.querySelector(".copy-raw-btn");
|
|
1306
|
-
const block = group.querySelector(".
|
|
1381
|
+
const block = group.querySelector(".sub-agent-content");
|
|
1307
1382
|
const rendered = block
|
|
1308
|
-
? block.querySelector(".
|
|
1383
|
+
? block.querySelector(".sub-agent-rendered")
|
|
1309
1384
|
: null;
|
|
1310
|
-
const raw = block ? block.querySelector(".
|
|
1385
|
+
const raw = block ? block.querySelector(".sub-agent-raw") : null;
|
|
1311
1386
|
|
|
1312
1387
|
// Copy button logic
|
|
1313
1388
|
if (copyBtn && rendered) {
|
|
@@ -85,7 +85,7 @@ class _SlashCommandCompleter(Completer):
|
|
|
85
85
|
matched: list[tuple[str, object, str]] = []
|
|
86
86
|
for cmd_name, cmd_obj in commands.items():
|
|
87
87
|
if cmd_name.startswith(frag):
|
|
88
|
-
hint = " [
|
|
88
|
+
hint = " [instructions]" if cmd_obj.support_addition_params else ""
|
|
89
89
|
matched.append((cmd_name, cmd_obj, hint))
|
|
90
90
|
|
|
91
91
|
if not matched:
|