|
@@ -12,10 +12,12 @@ import { useCopyToClipboard } from "@src/utils/clipboard"
|
|
|
import { useExtensionState } from "@src/context/ExtensionStateContext"
|
|
import { useExtensionState } from "@src/context/ExtensionStateContext"
|
|
|
import { findMatchingResourceOrTemplate } from "@src/utils/mcp"
|
|
import { findMatchingResourceOrTemplate } from "@src/utils/mcp"
|
|
|
import { vscode } from "@src/utils/vscode"
|
|
import { vscode } from "@src/utils/vscode"
|
|
|
|
|
+import { removeLeadingNonAlphanumeric } from "@src/utils/removeLeadingNonAlphanumeric"
|
|
|
import { Button } from "@src/components/ui"
|
|
import { Button } from "@src/components/ui"
|
|
|
|
|
|
|
|
-import CodeAccordian, { removeLeadingNonAlphanumeric } from "../common/CodeAccordian"
|
|
|
|
|
-import CodeBlock, { CODE_BLOCK_BG_COLOR } from "../common/CodeBlock"
|
|
|
|
|
|
|
+import { ToolUseBlock, ToolUseBlockHeader } from "../common/ToolUseBlock"
|
|
|
|
|
+import CodeAccordian from "../common/CodeAccordian"
|
|
|
|
|
+import CodeBlock from "../common/CodeBlock"
|
|
|
import MarkdownBlock from "../common/MarkdownBlock"
|
|
import MarkdownBlock from "../common/MarkdownBlock"
|
|
|
import { ReasoningBlock } from "./ReasoningBlock"
|
|
import { ReasoningBlock } from "./ReasoningBlock"
|
|
|
import Thumbnails from "../common/Thumbnails"
|
|
import Thumbnails from "../common/Thumbnails"
|
|
@@ -287,10 +289,11 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.content ?? tool.diff}
|
|
|
|
|
+ language={tool.tool === "appliedDiff" ? "diff" : undefined}
|
|
|
progressStatus={message.progressStatus}
|
|
progressStatus={message.progressStatus}
|
|
|
isLoading={message.partial}
|
|
isLoading={message.partial}
|
|
|
- diff={tool.diff!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
|
/>
|
|
/>
|
|
@@ -312,10 +315,11 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.diff}
|
|
|
|
|
+ language="diff"
|
|
|
progressStatus={message.progressStatus}
|
|
progressStatus={message.progressStatus}
|
|
|
isLoading={message.partial}
|
|
isLoading={message.partial}
|
|
|
- diff={tool.diff!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
|
/>
|
|
/>
|
|
@@ -333,10 +337,10 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.diff}
|
|
|
progressStatus={message.progressStatus}
|
|
progressStatus={message.progressStatus}
|
|
|
isLoading={message.partial}
|
|
isLoading={message.partial}
|
|
|
- diff={tool.diff!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
|
/>
|
|
/>
|
|
@@ -350,9 +354,9 @@ export const ChatRowContent = ({
|
|
|
<span style={{ fontWeight: "bold" }}>{t("chat:fileOperations.wantsToCreate")}</span>
|
|
<span style={{ fontWeight: "bold" }}>{t("chat:fileOperations.wantsToCreate")}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.content}
|
|
|
isLoading={message.partial}
|
|
isLoading={message.partial}
|
|
|
- code={tool.content!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
|
/>
|
|
/>
|
|
@@ -371,47 +375,21 @@ export const ChatRowContent = ({
|
|
|
: t("chat:fileOperations.didRead")}
|
|
: t("chat:fileOperations.didRead")}
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div
|
|
|
|
|
- style={{
|
|
|
|
|
- borderRadius: 3,
|
|
|
|
|
- backgroundColor: CODE_BLOCK_BG_COLOR,
|
|
|
|
|
- overflow: "hidden",
|
|
|
|
|
- border: "1px solid var(--vscode-editorGroup-border)",
|
|
|
|
|
- }}>
|
|
|
|
|
- <div
|
|
|
|
|
- style={{
|
|
|
|
|
- color: "var(--vscode-descriptionForeground)",
|
|
|
|
|
- display: "flex",
|
|
|
|
|
- alignItems: "center",
|
|
|
|
|
- padding: "9px 10px",
|
|
|
|
|
- cursor: "pointer",
|
|
|
|
|
- userSelect: "none",
|
|
|
|
|
- WebkitUserSelect: "none",
|
|
|
|
|
- MozUserSelect: "none",
|
|
|
|
|
- msUserSelect: "none",
|
|
|
|
|
- }}
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- vscode.postMessage({ type: "openFile", text: tool.content })
|
|
|
|
|
- }}>
|
|
|
|
|
|
|
+ <ToolUseBlock>
|
|
|
|
|
+ <ToolUseBlockHeader
|
|
|
|
|
+ onClick={() => vscode.postMessage({ type: "openFile", text: tool.content })}>
|
|
|
{tool.path?.startsWith(".") && <span>.</span>}
|
|
{tool.path?.startsWith(".") && <span>.</span>}
|
|
|
- <span
|
|
|
|
|
- style={{
|
|
|
|
|
- whiteSpace: "nowrap",
|
|
|
|
|
- overflow: "hidden",
|
|
|
|
|
- textOverflow: "ellipsis",
|
|
|
|
|
- marginRight: "8px",
|
|
|
|
|
- direction: "rtl",
|
|
|
|
|
- textAlign: "left",
|
|
|
|
|
- }}>
|
|
|
|
|
|
|
+ <span className="whitespace-nowrap overflow-hidden text-ellipsis text-left mr-2 rtl">
|
|
|
{removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"}
|
|
{removeLeadingNonAlphanumeric(tool.path ?? "") + "\u200E"}
|
|
|
{tool.reason}
|
|
{tool.reason}
|
|
|
</span>
|
|
</span>
|
|
|
<div style={{ flexGrow: 1 }}></div>
|
|
<div style={{ flexGrow: 1 }}></div>
|
|
|
<span
|
|
<span
|
|
|
className={`codicon codicon-link-external`}
|
|
className={`codicon codicon-link-external`}
|
|
|
- style={{ fontSize: 13.5, margin: "1px 0" }}></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ style={{ fontSize: 13.5, margin: "1px 0" }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </ToolUseBlockHeader>
|
|
|
|
|
+ </ToolUseBlock>
|
|
|
</>
|
|
</>
|
|
|
)
|
|
)
|
|
|
case "fetchInstructions":
|
|
case "fetchInstructions":
|
|
@@ -422,8 +400,8 @@ export const ChatRowContent = ({
|
|
|
<span style={{ fontWeight: "bold" }}>{t("chat:instructions.wantsToFetch")}</span>
|
|
<span style={{ fontWeight: "bold" }}>{t("chat:instructions.wantsToFetch")}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
|
|
+ code={tool.content}
|
|
|
isLoading={message.partial}
|
|
isLoading={message.partial}
|
|
|
- code={tool.content!}
|
|
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
|
/>
|
|
/>
|
|
@@ -441,8 +419,8 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
- code={tool.content!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.content}
|
|
|
language="shell-session"
|
|
language="shell-session"
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
@@ -461,8 +439,8 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
- code={tool.content!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.content}
|
|
|
language="shell-session"
|
|
language="shell-session"
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
@@ -481,8 +459,8 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
- code={tool.content!}
|
|
|
|
|
- path={tool.path!}
|
|
|
|
|
|
|
+ path={tool.path}
|
|
|
|
|
+ code={tool.content}
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
|
/>
|
|
/>
|
|
@@ -510,8 +488,8 @@ export const ChatRowContent = ({
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
- code={tool.content!}
|
|
|
|
|
path={tool.path! + (tool.filePattern ? `/(${tool.filePattern})` : "")}
|
|
path={tool.path! + (tool.filePattern ? `/(${tool.filePattern})` : "")}
|
|
|
|
|
+ code={tool.content}
|
|
|
language="log"
|
|
language="log"
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|
|
@@ -881,13 +859,10 @@ export const ChatRowContent = ({
|
|
|
case "user_feedback_diff":
|
|
case "user_feedback_diff":
|
|
|
const tool = safeJsonParse<ClineSayTool>(message.text)
|
|
const tool = safeJsonParse<ClineSayTool>(message.text)
|
|
|
return (
|
|
return (
|
|
|
- <div
|
|
|
|
|
- style={{
|
|
|
|
|
- marginTop: -10,
|
|
|
|
|
- width: "100%",
|
|
|
|
|
- }}>
|
|
|
|
|
|
|
+ <div style={{ marginTop: -10, width: "100%" }}>
|
|
|
<CodeAccordian
|
|
<CodeAccordian
|
|
|
- diff={tool?.diff!}
|
|
|
|
|
|
|
+ code={tool?.diff}
|
|
|
|
|
+ language="diff"
|
|
|
isFeedback={true}
|
|
isFeedback={true}
|
|
|
isExpanded={isExpanded}
|
|
isExpanded={isExpanded}
|
|
|
onToggleExpand={onToggleExpand}
|
|
onToggleExpand={onToggleExpand}
|