Changesets · Branches · Tags · Compare
| Changeset | c977fe2591e2b98b7c5691cdae3f6cf86a9aa368a3daa8db598d63bce5b4a430 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-25 15:48 -07:00 |
| Committer | Dallin Romney <dallinromney@gmail.com> · 2025-09-25 15:48 -07:00 |
| Parents | dfa6694c3770, f636b4841cdd |
18 files changed
modified core/config/markdown/utils.ts +10 −4
| @@ -4,6 +4,15 @@ | ||
| 4 | 4 | } from "@continuedev/config-yaml"; |
| 5 | 5 | import { joinPathsToUri } from "../../util/uri"; |
| 6 | 6 | |
| 7 | +function createRelativeRuleFilePathParts(ruleName: string): string[] { | |
| 8 | + const safeRuleName = sanitizeRuleName(ruleName); | |
| 9 | + return [".continue", "rules", `${safeRuleName}.${RULE_FILE_EXTENSION}`]; | |
| 10 | +} | |
| 11 | + | |
| 12 | +export function createRelativeRuleFilePath(ruleName: string): string { | |
| 13 | + return createRelativeRuleFilePathParts(ruleName).join("/"); | |
| 14 | +} | |
| 15 | + | |
| 7 | 16 | /** |
| 8 | 17 | * Creates the file path for a rule in the workspace .continue/rules directory |
| 9 | 18 | */ |
| @@ -11,11 +20,8 @@ | ||
| 11 | 20 | workspaceDir: string, |
| 12 | 21 | ruleName: string, |
| 13 | 22 | ): string { |
| 14 | - const safeRuleName = sanitizeRuleName(ruleName); | |
| 15 | 23 | return joinPathsToUri( |
| 16 | 24 | workspaceDir, |
| 17 | - ".continue", | |
| 18 | - "rules", | |
| 19 | - `${safeRuleName}.${RULE_FILE_EXTENSION}`, | |
| 25 | + ...createRelativeRuleFilePathParts(ruleName), | |
| 20 | 26 | ); |
| 21 | 27 | } |
modified core/llm/index.ts +1 −1
| @@ -213,7 +213,7 @@ | ||
| 213 | 213 | this.providerName === "continue-proxy" |
| 214 | 214 | ? this.model?.split("/").pop() || this.model |
| 215 | 215 | : this.model; |
| 216 | - const llmInfo = findLlmInfo(modelSearchString); | |
| 216 | + const llmInfo = findLlmInfo(modelSearchString, this.underlyingProviderName); | |
| 217 | 217 | |
| 218 | 218 | const templateType = |
| 219 | 219 | options.template ?? autodetectTemplateType(options.model); |
modified core/package-lock.json +0 −0
Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.
modified extensions/cli/src/commands/init.ts +20 −2
| @@ -1,9 +1,11 @@ | ||
| 1 | 1 | import { type AssistantConfig } from "@continuedev/sdk"; |
| 2 | +import { createRelativeRuleFilePath } from "core/config/markdown/utils.js"; | |
| 2 | 3 | |
| 3 | 4 | import { SlashCommandResult } from "../ui/hooks/useChat.types.js"; |
| 4 | 5 | |
| 5 | 6 | function createInitPrompt(): string { |
| 6 | - 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. | |
| 7 | + const relativeRuleFilepath = createRelativeRuleFilePath("review"); | |
| 8 | + 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. | |
| 7 | 9 | |
| 8 | 10 | Create an AGENTS.md file with the following structure: |
| 9 | 11 | |
| @@ -30,7 +32,23 @@ | ||
| 30 | 32 | - Development environment setup |
| 31 | 33 | - Lint and format commands |
| 32 | 34 | |
| 33 | -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.`; | |
| 35 | +Additionally, create a slash command file at ${relativeRuleFilepath} with the following structure: | |
| 36 | + | |
| 37 | +\`\`\`md | |
| 38 | +--- | |
| 39 | +invokable: true | |
| 40 | +--- | |
| 41 | + | |
| 42 | +Review this code for potential issues, including: | |
| 43 | + | |
| 44 | +<insert custom things to look for based on the repository details you find> | |
| 45 | + | |
| 46 | +Provide specific, actionable feedback for improvements. | |
| 47 | +\`\`\` | |
| 48 | + | |
| 49 | +This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository. | |
| 50 | + | |
| 51 | +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.`; | |
| 34 | 52 | } |
| 35 | 53 | |
| 36 | 54 | export async function handleInit( |
added extensions/cli/src/ui/components/ChecklistDisplay.test.tsx +63 −0
| @@ -0,0 +1,63 @@ | ||
| 1 | +import { render } from "ink-testing-library"; | |
| 2 | +import React from "react"; | |
| 3 | + | |
| 4 | +import { ChecklistDisplay } from "./ChecklistDisplay.js"; | |
| 5 | + | |
| 6 | +describe("ChecklistDisplay", () => { | |
| 7 | + it("should highlight the first incomplete item", () => { | |
| 8 | + const content = `Task list status: | |
| 9 | +- [x] Completed task | |
| 10 | +- [ ] First incomplete task | |
| 11 | +- [ ] Second incomplete task`; | |
| 12 | + | |
| 13 | + const { lastFrame } = render(<ChecklistDisplay content={content} />); | |
| 14 | + const output = lastFrame(); | |
| 15 | + | |
| 16 | + // The output should contain the checkbox symbols and text | |
| 17 | + expect(output).toContain("✓"); | |
| 18 | + expect(output).toContain("○"); | |
| 19 | + expect(output).toContain("Completed task"); | |
| 20 | + expect(output).toContain("First incomplete task"); | |
| 21 | + expect(output).toContain("Second incomplete task"); | |
| 22 | + }); | |
| 23 | + | |
| 24 | + it("should handle empty checklist", () => { | |
| 25 | + const content = "Task list status:"; | |
| 26 | + | |
| 27 | + const { lastFrame } = render(<ChecklistDisplay content={content} />); | |
| 28 | + const output = lastFrame(); | |
| 29 | + | |
| 30 | + expect(output).toBeDefined(); | |
| 31 | + }); | |
| 32 | + | |
| 33 | + it("should handle all completed tasks", () => { | |
| 34 | + const content = `Task list status: | |
| 35 | +- [x] Completed task 1 | |
| 36 | +- [x] Completed task 2`; | |
| 37 | + | |
| 38 | + const { lastFrame } = render(<ChecklistDisplay content={content} />); | |
| 39 | + const output = lastFrame(); | |
| 40 | + | |
| 41 | + expect(output).toContain("✓"); | |
| 42 | + expect(output).toContain("Completed task 1"); | |
| 43 | + expect(output).toContain("Completed task 2"); | |
| 44 | + }); | |
| 45 | + | |
| 46 | + it("should handle mixed content with headers", () => { | |
| 47 | + const content = `Task list status: | |
| 48 | +## Important Tasks | |
| 49 | +- [x] Done task | |
| 50 | +- [ ] Todo task | |
| 51 | + | |
| 52 | +## Other Tasks | |
| 53 | +- [ ] Another todo`; | |
| 54 | + | |
| 55 | + const { lastFrame } = render(<ChecklistDisplay content={content} />); | |
| 56 | + const output = lastFrame(); | |
| 57 | + | |
| 58 | + expect(output).toContain("Important Tasks"); | |
| 59 | + expect(output).toContain("Other Tasks"); | |
| 60 | + expect(output).toContain("✓"); | |
| 61 | + expect(output).toContain("○"); | |
| 62 | + }); | |
| 63 | +}); |
modified extensions/cli/src/ui/components/ChecklistDisplay.tsx +16 −1
| @@ -13,6 +13,17 @@ | ||
| 13 | 13 | }) => { |
| 14 | 14 | const lines = content.split("\n"); |
| 15 | 15 | |
| 16 | + // Find the index of the first incomplete checkbox item | |
| 17 | + let firstIncompleteIndex = -1; | |
| 18 | + for (let i = 0; i < lines.length; i++) { | |
| 19 | + const line = lines[i]; | |
| 20 | + const checkboxMatch = line.match(/^(\s*)-\s*\[([ x])\]\s*(.*)$/); | |
| 21 | + if (checkboxMatch && checkboxMatch[2] === " ") { | |
| 22 | + firstIncompleteIndex = i; | |
| 23 | + break; | |
| 24 | + } | |
| 25 | + } | |
| 26 | + | |
| 16 | 27 | return ( |
| 17 | 28 | <Box flexDirection="column" paddingLeft={2}> |
| 18 | 29 | {lines.map((line, index) => { |
| @@ -25,6 +36,7 @@ | ||
| 25 | 36 | if (checkboxMatch) { |
| 26 | 37 | const [, indent, status, taskText] = checkboxMatch; |
| 27 | 38 | const isCompleted = status === "x"; |
| 39 | + const isFirstIncomplete = index === firstIncompleteIndex; | |
| 28 | 40 | |
| 29 | 41 | return ( |
| 30 | 42 | <Box key={index}> |
| @@ -34,8 +46,11 @@ | ||
| 34 | 46 | </Text> |
| 35 | 47 | <Text> </Text> |
| 36 | 48 | <Text |
| 37 | - color={isCompleted ? "gray" : "white"} | |
| 49 | + color={ | |
| 50 | + isCompleted ? "gray" : isFirstIncomplete ? "cyan" : "white" | |
| 51 | + } | |
| 38 | 52 | strikethrough={isCompleted} |
| 53 | + bold={isFirstIncomplete} | |
| 39 | 54 | > |
| 40 | 55 | {taskText} |
| 41 | 56 | </Text> |
modified gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx +1 −3
| @@ -48,9 +48,7 @@ | ||
| 48 | 48 | ) : ( |
| 49 | 49 | <> |
| 50 | 50 | <AssistantIcon assistant={selectedProfile} size={iconSize} /> |
| 51 | - <span | |
| 52 | - className={`select-none truncate text-xs ${isSidebar && "hidden md:block"}`} | |
| 53 | - > | |
| 51 | + <span className={`xs:line-clamp-1 hidden select-none text-xs`}> | |
| 54 | 52 | {selectedProfile.title} |
| 55 | 53 | </span> |
| 56 | 54 | </> |
modified gui/src/components/AssistantAndOrgListbox/index.tsx +1 −1
| @@ -150,7 +150,7 @@ | ||
| 150 | 150 | /> |
| 151 | 151 | <Transition> |
| 152 | 152 | <ListboxOptions |
| 153 | - className="max-h-32 -translate-x-1.5 overflow-y-auto pb-0" | |
| 153 | + className="max-h-32 scale-x-[97%] overflow-y-auto pb-0" | |
| 154 | 154 | style={{ zIndex: 200 }} |
| 155 | 155 | > |
| 156 | 156 | <div className="flex items-center justify-between px-1.5 py-1"> |
modified gui/src/components/StyledMarkdownPreview/index.tsx +20 −0
| @@ -84,6 +84,26 @@ | ||
| 84 | 84 | font-family: var(--vscode-editor-font-family); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + ul ul, | |
| 88 | + ul ol, | |
| 89 | + ol ul, | |
| 90 | + ol ol { | |
| 91 | + padding-left: 1.5em; | |
| 92 | + margin-top: 1em; | |
| 93 | + } | |
| 94 | + | |
| 95 | + li { | |
| 96 | + margin-bottom: 0.8em; | |
| 97 | + } | |
| 98 | + li:last-child { | |
| 99 | + margin-bottom: 0; | |
| 100 | + } | |
| 101 | + | |
| 102 | + ul, | |
| 103 | + ol { | |
| 104 | + padding-left: 2em; | |
| 105 | + } | |
| 106 | + | |
| 87 | 107 | code:not(pre > code) { |
| 88 | 108 | font-family: var(--vscode-editor-font-family); |
| 89 | 109 | } |
modified gui/src/components/mainInput/InputToolbar.tsx +0 −1
| @@ -56,7 +56,6 @@ | ||
| 56 | 56 | const hasReasoningEnabled = useAppSelector( |
| 57 | 57 | (store) => store.session.hasReasoningEnabled, |
| 58 | 58 | ); |
| 59 | - | |
| 60 | 59 | const isEnterDisabled = |
| 61 | 60 | props.disabled || (isInEdit && codeToEdit.length === 0); |
| 62 | 61 |
modified gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx +1 −1
| @@ -105,7 +105,7 @@ | ||
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | 107 | return ( |
| 108 | - <div className="flex flex-1 items-center justify-between gap-1.5"> | |
| 108 | + <div className="flex flex-1 items-center justify-between gap-3"> | |
| 109 | 109 | <div className="flex items-center gap-1"> |
| 110 | 110 | {shouldShowError && ( |
| 111 | 111 | <ToolTip delayShow={700} content="View configuration errors"> |
modified gui/src/components/ui/Button.tsx +1 −1
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | className={cn( |
| 41 | 41 | "cursor-pointer transition-all duration-200", |
| 42 | 42 | "hover:enabled:cursor-pointer", |
| 43 | - "disabled:text-description-muted disabled:pointer-events-none disabled:opacity-50", | |
| 43 | + "disabled:cursor-not-allowed disabled:opacity-50", | |
| 44 | 44 | buttonVariants[variant], |
| 45 | 45 | isIcon |
| 46 | 46 | ? iconButtonSizes[size] |
modified gui/src/pages/gui/StreamError.tsx +2 −8
| @@ -290,10 +290,7 @@ | ||
| 290 | 290 | <GhostButton |
| 291 | 291 | className="flex flex-row items-center gap-2 rounded px-3 py-1.5" |
| 292 | 292 | onClick={() => { |
| 293 | - ideMessenger.post("controlPlane/openUrl", { | |
| 294 | - path: GITHUB_LINK, | |
| 295 | - orgSlug: undefined, | |
| 296 | - }); | |
| 293 | + ideMessenger.post("openUrl", GITHUB_LINK); | |
| 297 | 294 | }} |
| 298 | 295 | > |
| 299 | 296 | <GithubIcon className="h-5 w-5" /> |
| @@ -302,10 +299,7 @@ | ||
| 302 | 299 | <GhostButton |
| 303 | 300 | className="flex flex-row items-center gap-2 rounded px-3 py-1.5" |
| 304 | 301 | onClick={() => { |
| 305 | - ideMessenger.post("controlPlane/openUrl", { | |
| 306 | - path: DISCORD_LINK, | |
| 307 | - orgSlug: undefined, | |
| 308 | - }); | |
| 302 | + ideMessenger.post("openUrl", DISCORD_LINK); | |
| 309 | 303 | }} |
| 310 | 304 | > |
| 311 | 305 | <DiscordIcon className="h-5 w-5" /> |
modified gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx +5 −0
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | import { IdeMessengerContext } from "../../../context/IdeMessenger"; |
| 8 | 8 | import { ToggleWithIcon } from "./ToggleWithIcon"; |
| 9 | 9 | import { ToolCallStatusMessage } from "./ToolCallStatusMessage"; |
| 10 | +import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon"; | |
| 10 | 11 | import { toolCallStateToContextItems } from "./utils"; |
| 11 | 12 | |
| 12 | 13 | interface SimpleToolCallUIProps { |
| @@ -61,6 +62,10 @@ | ||
| 61 | 62 | /> |
| 62 | 63 | <ToolCallStatusMessage tool={tool} toolCallState={toolCallState} /> |
| 63 | 64 | </div> |
| 65 | + | |
| 66 | + {!!toolCallState.output?.length && ( | |
| 67 | + <ToolTruncateHistoryIcon historyIndex={historyIndex} /> | |
| 68 | + )} | |
| 64 | 69 | </div> |
| 65 | 70 | |
| 66 | 71 | {isToggleable && ( |
modified gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx +5 −1
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | import { Tool, ToolCallState } from "core"; |
| 2 | 2 | import { ToolCallStatusMessage } from "./ToolCallStatusMessage"; |
| 3 | +import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon"; | |
| 3 | 4 | |
| 4 | 5 | interface ToolCallDisplayProps { |
| 5 | 6 | children: React.ReactNode; |
| @@ -19,7 +20,7 @@ | ||
| 19 | 20 | return ( |
| 20 | 21 | <div className="flex flex-col justify-center px-4"> |
| 21 | 22 | <div className="mb-2 flex flex-col"> |
| 22 | - <div className="flex flex-row items-center justify-between gap-1.5"> | |
| 23 | + <div className="flex flex-row items-start justify-between gap-1.5"> | |
| 23 | 24 | <div className="flex min-w-0 flex-row items-center gap-2"> |
| 24 | 25 | <div className="mt-[1px] h-4 w-4 flex-shrink-0 font-semibold"> |
| 25 | 26 | {icon} |
| @@ -29,6 +30,9 @@ | ||
| 29 | 30 | )} |
| 30 | 31 | <ToolCallStatusMessage tool={tool} toolCallState={toolCallState} /> |
| 31 | 32 | </div> |
| 33 | + {!!toolCallState.output?.length && ( | |
| 34 | + <ToolTruncateHistoryIcon historyIndex={historyIndex} /> | |
| 35 | + )} | |
| 32 | 36 | </div> |
| 33 | 37 | </div> |
| 34 | 38 | <div>{children}</div> |
modified gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx +1 −1
| @@ -53,7 +53,7 @@ | ||
| 53 | 53 | |
| 54 | 54 | return ( |
| 55 | 55 | <div |
| 56 | - className="text-description line-clamp-4 min-w-0 break-all" | |
| 56 | + className="text-description line-clamp-4 min-w-0 break-words" | |
| 57 | 57 | data-testid="tool-call-title" |
| 58 | 58 | > |
| 59 | 59 | {`Continue ${intro} ${message}`} |
modified gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +2 −1
| @@ -21,7 +21,8 @@ | ||
| 21 | 21 | const { mainEditor } = useMainEditor(); |
| 22 | 22 | |
| 23 | 23 | if (historyIndex === lastMessageIndex) { |
| 24 | - return null; | |
| 24 | + // filler so doesn't jump in | |
| 25 | + return <div className="h-3 w-3" />; | |
| 25 | 26 | } |
| 26 | 27 | |
| 27 | 28 | return ( |
modified packages/llm-info/src/index.ts +21 −5
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | import { Vllm } from "./providers/vllm.js"; |
| 11 | 11 | import { Voyage } from "./providers/voyage.js"; |
| 12 | 12 | import { xAI } from "./providers/xAI.js"; |
| 13 | -import { LlmInfo, ModelProvider, UseCase } from "./types.js"; | |
| 13 | +import { LlmInfoWithProvider, ModelProvider, UseCase } from "./types.js"; | |
| 14 | 14 | |
| 15 | 15 | export const allModelProviders: ModelProvider[] = [ |
| 16 | 16 | OpenAi, |
| @@ -27,16 +27,32 @@ | ||
| 27 | 27 | xAI, |
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | -export const allLlms: LlmInfo[] = allModelProviders.flatMap((provider) => | |
| 31 | - provider.models.map((model) => ({ ...model, provider: provider.id })), | |
| 30 | +export const allLlms: LlmInfoWithProvider[] = allModelProviders.flatMap( | |
| 31 | + (provider) => | |
| 32 | + provider.models.map((model) => ({ ...model, provider: provider.id })), | |
| 32 | 33 | ); |
| 33 | 34 | |
| 34 | -export function findLlmInfo(model: string): LlmInfo | undefined { | |
| 35 | +export function findLlmInfo( | |
| 36 | + model: string, | |
| 37 | + preferProviderId?: string, | |
| 38 | +): LlmInfoWithProvider | undefined { | |
| 39 | + if (preferProviderId) { | |
| 40 | + const provider = allModelProviders.find((p) => p.id === preferProviderId); | |
| 41 | + const info = provider?.models.find((llm) => | |
| 42 | + llm.regex ? llm.regex.test(model) : llm.model === model, | |
| 43 | + ); | |
| 44 | + if (info) { | |
| 45 | + return { | |
| 46 | + ...info, | |
| 47 | + provider: preferProviderId, | |
| 48 | + }; | |
| 49 | + } | |
| 50 | + } | |
| 35 | 51 | return allLlms.find((llm) => |
| 36 | 52 | llm.regex ? llm.regex.test(model) : llm.model === model, |
| 37 | 53 | ); |
| 38 | 54 | } |
| 39 | 55 | |
| 40 | -export function getAllRecommendedFor(useCase: UseCase): LlmInfo[] { | |
| 56 | +export function getAllRecommendedFor(useCase: UseCase): LlmInfoWithProvider[] { | |
| 41 | 57 | return allLlms.filter((llm) => llm.recommendedFor?.includes(useCase)); |
| 42 | 58 | } |