Resolve merge conflict in ToolCallDisplay.tsx
Merged changes from main while preserving clickable functionality: - Added ToolTruncateHistoryIcon import from main - Updated flex alignment to items-start from main - Kept clickable div with hover effects and click handler 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
61fa2b0e2b
20 changed files with 181 additions and 39 deletions
|
|
@ -4,6 +4,15 @@ import {
|
|||
} from "@continuedev/config-yaml";
|
||||
import { joinPathsToUri } from "../../util/uri";
|
||||
|
||||
function createRelativeRuleFilePathParts(ruleName: string): string[] {
|
||||
const safeRuleName = sanitizeRuleName(ruleName);
|
||||
return [".continue", "rules", `${safeRuleName}.${RULE_FILE_EXTENSION}`];
|
||||
}
|
||||
|
||||
export function createRelativeRuleFilePath(ruleName: string): string {
|
||||
return createRelativeRuleFilePathParts(ruleName).join("/");
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the file path for a rule in the workspace .continue/rules directory
|
||||
*/
|
||||
|
|
@ -11,11 +20,8 @@ export function createRuleFilePath(
|
|||
workspaceDir: string,
|
||||
ruleName: string,
|
||||
): string {
|
||||
const safeRuleName = sanitizeRuleName(ruleName);
|
||||
return joinPathsToUri(
|
||||
workspaceDir,
|
||||
".continue",
|
||||
"rules",
|
||||
`${safeRuleName}.${RULE_FILE_EXTENSION}`,
|
||||
...createRelativeRuleFilePathParts(ruleName),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
this.providerName === "continue-proxy"
|
||||
? this.model?.split("/").pop() || this.model
|
||||
: this.model;
|
||||
const llmInfo = findLlmInfo(modelSearchString);
|
||||
const llmInfo = findLlmInfo(modelSearchString, this.underlyingProviderName);
|
||||
|
||||
const templateType =
|
||||
options.template ?? autodetectTemplateType(options.model);
|
||||
|
|
|
|||
14
core/package-lock.json
generated
14
core/package-lock.json
generated
|
|
@ -202,7 +202,7 @@
|
|||
},
|
||||
"../packages/llm-info": {
|
||||
"name": "@continuedev/llm-info",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.10",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
|
|
@ -16364,9 +16364,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/prebuild-install/node_modules/tar-fs": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.3.tgz",
|
||||
"integrity": "sha512-090nwYJDmlhwFwEW3QQl+vaNnxsO2yVsd45eTKRBzSzu+hlb1w2K9inVq5b0ngXuLVqQ4ApvsUHHnu/zQNkWAg==",
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",
|
||||
"integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chownr": "^1.1.1",
|
||||
|
|
@ -18323,9 +18323,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/tar-fs": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.9.tgz",
|
||||
"integrity": "sha512-XF4w9Xp+ZQgifKakjZYmFdkLoSWd34VGKcsTCwlNWM7QG3ZbaxnTsaBwnjFZqHRf/rROxaR8rXnbtwdvaDI+lA==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz",
|
||||
"integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"pump": "^3.0.0",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import { type AssistantConfig } from "@continuedev/sdk";
|
||||
import { createRelativeRuleFilePath } from "core/config/markdown/utils.js";
|
||||
|
||||
import { SlashCommandResult } from "../ui/hooks/useChat.types.js";
|
||||
|
||||
function createInitPrompt(): string {
|
||||
return `Please analyze this repository and create a comprehensive AGENTS.md file. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup.
|
||||
const relativeRuleFilepath = createRelativeRuleFilePath("review");
|
||||
return `Please analyze this repository and create a comprehensive AGENTS.md file, along with a custom slash command. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup.
|
||||
|
||||
Create an AGENTS.md file with the following structure:
|
||||
|
||||
|
|
@ -30,7 +32,23 @@ Create an AGENTS.md file with the following structure:
|
|||
- Development environment setup
|
||||
- Lint and format commands
|
||||
|
||||
Please create the AGENTS.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the file concise but informational.`;
|
||||
Additionally, create a slash command file at ${relativeRuleFilepath} with the following structure:
|
||||
|
||||
\`\`\`md
|
||||
---
|
||||
invokable: true
|
||||
---
|
||||
|
||||
Review this code for potential issues, including:
|
||||
|
||||
<insert custom things to look for based on the repository details you find>
|
||||
|
||||
Provide specific, actionable feedback for improvements.
|
||||
\`\`\`
|
||||
|
||||
This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository.
|
||||
|
||||
Please create both the AGENTS.md file and the .continue/rules/review.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the files concise but informational.`;
|
||||
}
|
||||
|
||||
export async function handleInit(
|
||||
|
|
|
|||
63
extensions/cli/src/ui/components/ChecklistDisplay.test.tsx
Normal file
63
extensions/cli/src/ui/components/ChecklistDisplay.test.tsx
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
import { render } from "ink-testing-library";
|
||||
import React from "react";
|
||||
|
||||
import { ChecklistDisplay } from "./ChecklistDisplay.js";
|
||||
|
||||
describe("ChecklistDisplay", () => {
|
||||
it("should highlight the first incomplete item", () => {
|
||||
const content = `Task list status:
|
||||
- [x] Completed task
|
||||
- [ ] First incomplete task
|
||||
- [ ] Second incomplete task`;
|
||||
|
||||
const { lastFrame } = render(<ChecklistDisplay content={content} />);
|
||||
const output = lastFrame();
|
||||
|
||||
// The output should contain the checkbox symbols and text
|
||||
expect(output).toContain("✓");
|
||||
expect(output).toContain("○");
|
||||
expect(output).toContain("Completed task");
|
||||
expect(output).toContain("First incomplete task");
|
||||
expect(output).toContain("Second incomplete task");
|
||||
});
|
||||
|
||||
it("should handle empty checklist", () => {
|
||||
const content = "Task list status:";
|
||||
|
||||
const { lastFrame } = render(<ChecklistDisplay content={content} />);
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toBeDefined();
|
||||
});
|
||||
|
||||
it("should handle all completed tasks", () => {
|
||||
const content = `Task list status:
|
||||
- [x] Completed task 1
|
||||
- [x] Completed task 2`;
|
||||
|
||||
const { lastFrame } = render(<ChecklistDisplay content={content} />);
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toContain("✓");
|
||||
expect(output).toContain("Completed task 1");
|
||||
expect(output).toContain("Completed task 2");
|
||||
});
|
||||
|
||||
it("should handle mixed content with headers", () => {
|
||||
const content = `Task list status:
|
||||
## Important Tasks
|
||||
- [x] Done task
|
||||
- [ ] Todo task
|
||||
|
||||
## Other Tasks
|
||||
- [ ] Another todo`;
|
||||
|
||||
const { lastFrame } = render(<ChecklistDisplay content={content} />);
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toContain("Important Tasks");
|
||||
expect(output).toContain("Other Tasks");
|
||||
expect(output).toContain("✓");
|
||||
expect(output).toContain("○");
|
||||
});
|
||||
});
|
||||
|
|
@ -13,6 +13,17 @@ export const ChecklistDisplay: React.FC<ChecklistDisplayProps> = ({
|
|||
}) => {
|
||||
const lines = content.split("\n");
|
||||
|
||||
// Find the index of the first incomplete checkbox item
|
||||
let firstIncompleteIndex = -1;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
const checkboxMatch = line.match(/^(\s*)-\s*\[([ x])\]\s*(.*)$/);
|
||||
if (checkboxMatch && checkboxMatch[2] === " ") {
|
||||
firstIncompleteIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Box flexDirection="column" paddingLeft={2}>
|
||||
{lines.map((line, index) => {
|
||||
|
|
@ -25,6 +36,7 @@ export const ChecklistDisplay: React.FC<ChecklistDisplayProps> = ({
|
|||
if (checkboxMatch) {
|
||||
const [, indent, status, taskText] = checkboxMatch;
|
||||
const isCompleted = status === "x";
|
||||
const isFirstIncomplete = index === firstIncompleteIndex;
|
||||
|
||||
return (
|
||||
<Box key={index}>
|
||||
|
|
@ -34,8 +46,11 @@ export const ChecklistDisplay: React.FC<ChecklistDisplayProps> = ({
|
|||
</Text>
|
||||
<Text> </Text>
|
||||
<Text
|
||||
color={isCompleted ? "gray" : "white"}
|
||||
color={
|
||||
isCompleted ? "gray" : isFirstIncomplete ? "cyan" : "white"
|
||||
}
|
||||
strikethrough={isCompleted}
|
||||
bold={isFirstIncomplete}
|
||||
>
|
||||
{taskText}
|
||||
</Text>
|
||||
|
|
|
|||
|
|
@ -48,9 +48,7 @@ export function SelectedAssistantButton({
|
|||
) : (
|
||||
<>
|
||||
<AssistantIcon assistant={selectedProfile} size={iconSize} />
|
||||
<span
|
||||
className={`select-none truncate text-xs ${isSidebar && "hidden md:block"}`}
|
||||
>
|
||||
<span className={`xs:line-clamp-1 hidden select-none text-xs`}>
|
||||
{selectedProfile.title}
|
||||
</span>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ export function AssistantAndOrgListbox({
|
|||
/>
|
||||
<Transition>
|
||||
<ListboxOptions
|
||||
className="max-h-32 -translate-x-1.5 overflow-y-auto pb-0"
|
||||
className="max-h-32 scale-x-[97%] overflow-y-auto pb-0"
|
||||
style={{ zIndex: 200 }}
|
||||
>
|
||||
<div className="flex items-center justify-between px-1.5 py-1">
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ export default function MermaidDiagram({ code }: { code: string }) {
|
|||
{!!error ? (
|
||||
<div className="text-error whitespace-pre text-sm">{error}</div>
|
||||
) : (
|
||||
<div className="relative">
|
||||
<div className="mermaid relative">
|
||||
<div className="absolute right-0 z-10 m-2 flex items-center gap-x-1">
|
||||
<ToolTip content={"Zoom In"}>
|
||||
<MagnifyingGlassPlusIcon
|
||||
|
|
|
|||
|
|
@ -84,6 +84,26 @@ const StyledMarkdown = styled.div<{
|
|||
font-family: var(--vscode-editor-font-family);
|
||||
}
|
||||
|
||||
ul ul,
|
||||
ul ol,
|
||||
ol ul,
|
||||
ol ol {
|
||||
padding-left: 1.5em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
code:not(pre > code) {
|
||||
font-family: var(--vscode-editor-font-family);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1038,3 +1038,6 @@ body[data-color-mode*="light"] {
|
|||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
.mermaid foreignObject {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
const hasReasoningEnabled = useAppSelector(
|
||||
(store) => store.session.hasReasoningEnabled,
|
||||
);
|
||||
|
||||
const isEnterDisabled =
|
||||
props.disabled || (isInEdit && codeToEdit.length === 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export function BlockSettingsTopToolbar() {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-1 items-center justify-between gap-1.5">
|
||||
<div className="flex flex-1 items-center justify-between gap-3">
|
||||
<div className="flex items-center gap-1">
|
||||
{shouldShowError && (
|
||||
<ToolTip delayShow={700} content="View configuration errors">
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|||
className={cn(
|
||||
"cursor-pointer transition-all duration-200",
|
||||
"hover:enabled:cursor-pointer",
|
||||
"disabled:text-description-muted disabled:pointer-events-none disabled:opacity-50",
|
||||
"disabled:cursor-not-allowed disabled:opacity-50",
|
||||
buttonVariants[variant],
|
||||
isIcon
|
||||
? iconButtonSizes[size]
|
||||
|
|
|
|||
|
|
@ -290,10 +290,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => {
|
|||
<GhostButton
|
||||
className="flex flex-row items-center gap-2 rounded px-3 py-1.5"
|
||||
onClick={() => {
|
||||
ideMessenger.post("controlPlane/openUrl", {
|
||||
path: GITHUB_LINK,
|
||||
orgSlug: undefined,
|
||||
});
|
||||
ideMessenger.post("openUrl", GITHUB_LINK);
|
||||
}}
|
||||
>
|
||||
<GithubIcon className="h-5 w-5" />
|
||||
|
|
@ -302,10 +299,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => {
|
|||
<GhostButton
|
||||
className="flex flex-row items-center gap-2 rounded px-3 py-1.5"
|
||||
onClick={() => {
|
||||
ideMessenger.post("controlPlane/openUrl", {
|
||||
path: DISCORD_LINK,
|
||||
orgSlug: undefined,
|
||||
});
|
||||
ideMessenger.post("openUrl", DISCORD_LINK);
|
||||
}}
|
||||
>
|
||||
<DiscordIcon className="h-5 w-5" />
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { ToggleWithIcon } from "./ToggleWithIcon";
|
||||
import { ToolCallStatusMessage } from "./ToolCallStatusMessage";
|
||||
import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon";
|
||||
import { toolCallStateToContextItems } from "./utils";
|
||||
|
||||
interface SimpleToolCallUIProps {
|
||||
|
|
@ -61,6 +62,10 @@ export function SimpleToolCallUI({
|
|||
/>
|
||||
<ToolCallStatusMessage tool={tool} toolCallState={toolCallState} />
|
||||
</div>
|
||||
|
||||
{!!toolCallState.output?.length && (
|
||||
<ToolTruncateHistoryIcon historyIndex={historyIndex} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isToggleable && (
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { openContextItem } from "../../../components/mainInput/belowMainInput/Co
|
|||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { ToolCallStatusMessage } from "./ToolCallStatusMessage";
|
||||
import { toolCallStateToContextItems } from "./utils";
|
||||
import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon";
|
||||
|
||||
interface ToolCallDisplayProps {
|
||||
children: React.ReactNode;
|
||||
|
|
@ -36,7 +37,7 @@ export function ToolCallDisplay({
|
|||
return (
|
||||
<div className="flex flex-col justify-center px-4">
|
||||
<div className="mb-2 flex flex-col">
|
||||
<div className="flex flex-row items-center justify-between gap-1.5">
|
||||
<div className="flex flex-row items-start justify-between gap-1.5">
|
||||
<div
|
||||
className={`flex min-w-0 flex-row items-center gap-2 transition-colors duration-200 ease-in-out ${
|
||||
isClickable ? "cursor-pointer hover:brightness-125" : ""
|
||||
|
|
@ -51,6 +52,9 @@ export function ToolCallDisplay({
|
|||
)}
|
||||
<ToolCallStatusMessage tool={tool} toolCallState={toolCallState} />
|
||||
</div>
|
||||
{!!toolCallState.output?.length && (
|
||||
<ToolTruncateHistoryIcon historyIndex={historyIndex} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div>{children}</div>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export function ToolCallStatusMessage({
|
|||
|
||||
return (
|
||||
<div
|
||||
className="text-description line-clamp-4 min-w-0 break-all"
|
||||
className="text-description line-clamp-4 min-w-0 break-words"
|
||||
data-testid="tool-call-title"
|
||||
>
|
||||
{`Continue ${intro} ${message}`}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ export function ToolTruncateHistoryIcon({
|
|||
const { mainEditor } = useMainEditor();
|
||||
|
||||
if (historyIndex === lastMessageIndex) {
|
||||
return null;
|
||||
// filler so doesn't jump in
|
||||
return <div className="h-3 w-3" />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { OpenAi } from "./providers/openai.js";
|
|||
import { Vllm } from "./providers/vllm.js";
|
||||
import { Voyage } from "./providers/voyage.js";
|
||||
import { xAI } from "./providers/xAI.js";
|
||||
import { LlmInfo, ModelProvider, UseCase } from "./types.js";
|
||||
import { LlmInfoWithProvider, ModelProvider, UseCase } from "./types.js";
|
||||
|
||||
export const allModelProviders: ModelProvider[] = [
|
||||
OpenAi,
|
||||
|
|
@ -27,16 +27,32 @@ export const allModelProviders: ModelProvider[] = [
|
|||
xAI,
|
||||
];
|
||||
|
||||
export const allLlms: LlmInfo[] = allModelProviders.flatMap((provider) =>
|
||||
provider.models.map((model) => ({ ...model, provider: provider.id })),
|
||||
export const allLlms: LlmInfoWithProvider[] = allModelProviders.flatMap(
|
||||
(provider) =>
|
||||
provider.models.map((model) => ({ ...model, provider: provider.id })),
|
||||
);
|
||||
|
||||
export function findLlmInfo(model: string): LlmInfo | undefined {
|
||||
export function findLlmInfo(
|
||||
model: string,
|
||||
preferProviderId?: string,
|
||||
): LlmInfoWithProvider | undefined {
|
||||
if (preferProviderId) {
|
||||
const provider = allModelProviders.find((p) => p.id === preferProviderId);
|
||||
const info = provider?.models.find((llm) =>
|
||||
llm.regex ? llm.regex.test(model) : llm.model === model,
|
||||
);
|
||||
if (info) {
|
||||
return {
|
||||
...info,
|
||||
provider: preferProviderId,
|
||||
};
|
||||
}
|
||||
}
|
||||
return allLlms.find((llm) =>
|
||||
llm.regex ? llm.regex.test(model) : llm.model === model,
|
||||
);
|
||||
}
|
||||
|
||||
export function getAllRecommendedFor(useCase: UseCase): LlmInfo[] {
|
||||
export function getAllRecommendedFor(useCase: UseCase): LlmInfoWithProvider[] {
|
||||
return allLlms.filter((llm) => llm.recommendedFor?.includes(useCase));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue