Elffuss BraidHub

kikocis/continue public

Merge branch 'main' of https://github.com/continuedev/continue into feat/add-agents-to-guides
Changesetc977fe2591e2b98b7c5691cdae3f6cf86a9aa368a3daa8db598d63bce5b4a430
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-25 15:48 -07:00
CommitterDallin Romney <dallinromney@gmail.com> · 2025-09-25 15:48 -07:00
Parentsdfa6694c3770, f636b4841cdd

Browse the files at this changeset

18 files changed

modified core/config/markdown/utils.ts +10 −4
@@ -4,6 +4,15 @@
44 } from "@continuedev/config-yaml";
55 import { joinPathsToUri } from "../../util/uri";
66
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+
716 /**
817 * Creates the file path for a rule in the workspace .continue/rules directory
918 */
@@ -11,11 +20,8 @@
1120 workspaceDir: string,
1221 ruleName: string,
1322 ): string {
14- const safeRuleName = sanitizeRuleName(ruleName);
1523 return joinPathsToUri(
1624 workspaceDir,
17- ".continue",
18- "rules",
19- `${safeRuleName}.${RULE_FILE_EXTENSION}`,
25+ ...createRelativeRuleFilePathParts(ruleName),
2026 );
2127 }
modified core/llm/index.ts +1 −1
@@ -213,7 +213,7 @@
213213 this.providerName === "continue-proxy"
214214 ? this.model?.split("/").pop() || this.model
215215 : this.model;
216- const llmInfo = findLlmInfo(modelSearchString);
216+ const llmInfo = findLlmInfo(modelSearchString, this.underlyingProviderName);
217217
218218 const templateType =
219219 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 @@
11 import { type AssistantConfig } from "@continuedev/sdk";
2+import { createRelativeRuleFilePath } from "core/config/markdown/utils.js";
23
34 import { SlashCommandResult } from "../ui/hooks/useChat.types.js";
45
56 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.
79
810 Create an AGENTS.md file with the following structure:
911
@@ -30,7 +32,23 @@
3032 - Development environment setup
3133 - Lint and format commands
3234
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.`;
3452 }
3553
3654 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 @@
1313 }) => {
1414 const lines = content.split("\n");
1515
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+
1627 return (
1728 <Box flexDirection="column" paddingLeft={2}>
1829 {lines.map((line, index) => {
@@ -25,6 +36,7 @@
2536 if (checkboxMatch) {
2637 const [, indent, status, taskText] = checkboxMatch;
2738 const isCompleted = status === "x";
39+ const isFirstIncomplete = index === firstIncompleteIndex;
2840
2941 return (
3042 <Box key={index}>
@@ -34,8 +46,11 @@
3446 </Text>
3547 <Text> </Text>
3648 <Text
37- color={isCompleted ? "gray" : "white"}
49+ color={
50+ isCompleted ? "gray" : isFirstIncomplete ? "cyan" : "white"
51+ }
3852 strikethrough={isCompleted}
53+ bold={isFirstIncomplete}
3954 >
4055 {taskText}
4156 </Text>
modified gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx +1 −3
@@ -48,9 +48,7 @@
4848 ) : (
4949 <>
5050 <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`}>
5452 {selectedProfile.title}
5553 </span>
5654 </>
modified gui/src/components/AssistantAndOrgListbox/index.tsx +1 −1
@@ -150,7 +150,7 @@
150150 />
151151 <Transition>
152152 <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"
154154 style={{ zIndex: 200 }}
155155 >
156156 <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 @@
8484 font-family: var(--vscode-editor-font-family);
8585 }
8686
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+
87107 code:not(pre > code) {
88108 font-family: var(--vscode-editor-font-family);
89109 }
modified gui/src/components/mainInput/InputToolbar.tsx +0 −1
@@ -56,7 +56,6 @@
5656 const hasReasoningEnabled = useAppSelector(
5757 (store) => store.session.hasReasoningEnabled,
5858 );
59-
6059 const isEnterDisabled =
6160 props.disabled || (isInEdit && codeToEdit.length === 0);
6261
modified gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx +1 −1
@@ -105,7 +105,7 @@
105105 };
106106
107107 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">
109109 <div className="flex items-center gap-1">
110110 {shouldShowError && (
111111 <ToolTip delayShow={700} content="View configuration errors">
modified gui/src/components/ui/Button.tsx +1 −1
@@ -40,7 +40,7 @@
4040 className={cn(
4141 "cursor-pointer transition-all duration-200",
4242 "hover:enabled:cursor-pointer",
43- "disabled:text-description-muted disabled:pointer-events-none disabled:opacity-50",
43+ "disabled:cursor-not-allowed disabled:opacity-50",
4444 buttonVariants[variant],
4545 isIcon
4646 ? iconButtonSizes[size]
modified gui/src/pages/gui/StreamError.tsx +2 −8
@@ -290,10 +290,7 @@
290290 <GhostButton
291291 className="flex flex-row items-center gap-2 rounded px-3 py-1.5"
292292 onClick={() => {
293- ideMessenger.post("controlPlane/openUrl", {
294- path: GITHUB_LINK,
295- orgSlug: undefined,
296- });
293+ ideMessenger.post("openUrl", GITHUB_LINK);
297294 }}
298295 >
299296 <GithubIcon className="h-5 w-5" />
@@ -302,10 +299,7 @@
302299 <GhostButton
303300 className="flex flex-row items-center gap-2 rounded px-3 py-1.5"
304301 onClick={() => {
305- ideMessenger.post("controlPlane/openUrl", {
306- path: DISCORD_LINK,
307- orgSlug: undefined,
308- });
302+ ideMessenger.post("openUrl", DISCORD_LINK);
309303 }}
310304 >
311305 <DiscordIcon className="h-5 w-5" />
modified gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx +5 −0
@@ -7,6 +7,7 @@
77 import { IdeMessengerContext } from "../../../context/IdeMessenger";
88 import { ToggleWithIcon } from "./ToggleWithIcon";
99 import { ToolCallStatusMessage } from "./ToolCallStatusMessage";
10+import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon";
1011 import { toolCallStateToContextItems } from "./utils";
1112
1213 interface SimpleToolCallUIProps {
@@ -61,6 +62,10 @@
6162 />
6263 <ToolCallStatusMessage tool={tool} toolCallState={toolCallState} />
6364 </div>
65+
66+ {!!toolCallState.output?.length && (
67+ <ToolTruncateHistoryIcon historyIndex={historyIndex} />
68+ )}
6469 </div>
6570
6671 {isToggleable && (
modified gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx +5 −1
@@ -1,5 +1,6 @@
11 import { Tool, ToolCallState } from "core";
22 import { ToolCallStatusMessage } from "./ToolCallStatusMessage";
3+import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon";
34
45 interface ToolCallDisplayProps {
56 children: React.ReactNode;
@@ -19,7 +20,7 @@
1920 return (
2021 <div className="flex flex-col justify-center px-4">
2122 <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">
2324 <div className="flex min-w-0 flex-row items-center gap-2">
2425 <div className="mt-[1px] h-4 w-4 flex-shrink-0 font-semibold">
2526 {icon}
@@ -29,6 +30,9 @@
2930 )}
3031 <ToolCallStatusMessage tool={tool} toolCallState={toolCallState} />
3132 </div>
33+ {!!toolCallState.output?.length && (
34+ <ToolTruncateHistoryIcon historyIndex={historyIndex} />
35+ )}
3236 </div>
3337 </div>
3438 <div>{children}</div>
modified gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx +1 −1
@@ -53,7 +53,7 @@
5353
5454 return (
5555 <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"
5757 data-testid="tool-call-title"
5858 >
5959 {`Continue ${intro} ${message}`}
modified gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +2 −1
@@ -21,7 +21,8 @@
2121 const { mainEditor } = useMainEditor();
2222
2323 if (historyIndex === lastMessageIndex) {
24- return null;
24+ // filler so doesn't jump in
25+ return <div className="h-3 w-3" />;
2526 }
2627
2728 return (
modified packages/llm-info/src/index.ts +21 −5
@@ -10,7 +10,7 @@
1010 import { Vllm } from "./providers/vllm.js";
1111 import { Voyage } from "./providers/voyage.js";
1212 import { xAI } from "./providers/xAI.js";
13-import { LlmInfo, ModelProvider, UseCase } from "./types.js";
13+import { LlmInfoWithProvider, ModelProvider, UseCase } from "./types.js";
1414
1515 export const allModelProviders: ModelProvider[] = [
1616 OpenAi,
@@ -27,16 +27,32 @@
2727 xAI,
2828 ];
2929
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 })),
3233 );
3334
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+ }
3551 return allLlms.find((llm) =>
3652 llm.regex ? llm.regex.test(model) : llm.model === model,
3753 );
3854 }
3955
40-export function getAllRecommendedFor(useCase: UseCase): LlmInfo[] {
56+export function getAllRecommendedFor(useCase: UseCase): LlmInfoWithProvider[] {
4157 return allLlms.filter((llm) => llm.recommendedFor?.includes(useCase));
4258 }