prompt files v2
This commit is contained in:
parent
80ad763531
commit
462a2239bf
22 changed files with 252 additions and 56 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { CustomCommand, SlashCommand, SlashCommandDescription } from "../";
|
||||
import { stripImages } from "../llm/images";
|
||||
import { renderTemplatedString } from "../promptFiles/renderTemplatedString";
|
||||
import { renderTemplatedString } from "../promptFiles/v1/renderTemplatedString";
|
||||
import SlashCommands from "./slash";
|
||||
|
||||
export function slashFromCustomCommand(
|
||||
|
|
|
|||
|
|
@ -1,16 +1,9 @@
|
|||
import { execSync } from "child_process";
|
||||
import * as JSONC from "comment-json";
|
||||
import * as fs from "fs";
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
import * as tar from "tar";
|
||||
import {
|
||||
slashCommandFromDescription,
|
||||
slashFromCustomCommand,
|
||||
} from "../commands/index.js";
|
||||
import CustomContextProviderClass from "../context/providers/CustomContextProvider";
|
||||
import FileContextProvider from "../context/providers/FileContextProvider";
|
||||
import { contextProviderClassFromName } from "../context/providers/index";
|
||||
import { AllRerankers } from "../context/rerankers/index";
|
||||
import { LLMReranker } from "../context/rerankers/llm";
|
||||
import {
|
||||
BrowserSerializedContinueConfig,
|
||||
Config,
|
||||
|
|
@ -30,18 +23,25 @@ import {
|
|||
SerializedContinueConfig,
|
||||
SlashCommand,
|
||||
} from "..";
|
||||
import TransformersJsEmbeddingsProvider from "../indexing/embeddings/TransformersJsEmbeddingsProvider";
|
||||
import { allEmbeddingsProviders } from "../indexing/embeddings";
|
||||
import { BaseLLM } from "../llm";
|
||||
import CustomLLMClass from "../llm/llms/CustomLLM";
|
||||
import FreeTrial from "../llm/llms/FreeTrial";
|
||||
import { llmFromDescription } from "../llm/llms";
|
||||
import os from "os";
|
||||
import { execSync } from "child_process";
|
||||
import {
|
||||
slashCommandFromDescription,
|
||||
slashFromCustomCommand,
|
||||
} from "../commands/index.js";
|
||||
import CodebaseContextProvider from "../context/providers/CodebaseContextProvider";
|
||||
import ContinueProxyContextProvider from "../context/providers/ContinueProxyContextProvider";
|
||||
import { fetchwithRequestOptions } from "../util/fetchWithOptions";
|
||||
import CustomContextProviderClass from "../context/providers/CustomContextProvider";
|
||||
import FileContextProvider from "../context/providers/FileContextProvider";
|
||||
import { contextProviderClassFromName } from "../context/providers/index";
|
||||
import { AllRerankers } from "../context/rerankers/index";
|
||||
import { LLMReranker } from "../context/rerankers/llm";
|
||||
import { allEmbeddingsProviders } from "../indexing/embeddings";
|
||||
import TransformersJsEmbeddingsProvider from "../indexing/embeddings/TransformersJsEmbeddingsProvider";
|
||||
import { BaseLLM } from "../llm";
|
||||
import { llmFromDescription } from "../llm/llms";
|
||||
import CustomLLMClass from "../llm/llms/CustomLLM";
|
||||
import FreeTrial from "../llm/llms/FreeTrial";
|
||||
import { copyOf } from "../util";
|
||||
import { fetchwithRequestOptions } from "../util/fetchWithOptions";
|
||||
import mergeJson from "../util/merge";
|
||||
import {
|
||||
DEFAULT_CONFIG_TS_CONTENTS,
|
||||
|
|
@ -65,8 +65,9 @@ import {
|
|||
getPromptFiles,
|
||||
slashCommandFromPromptFile,
|
||||
} from "./promptFile.js";
|
||||
import { validateConfig, ConfigValidationError } from "./validation.js";
|
||||
import { ConfigValidationError, validateConfig } from "./validation.js";
|
||||
|
||||
import PromptFilesContextProvider from "../context/providers/PromptFilesContextProvider";
|
||||
import { GlobalContext } from "../util/GlobalContext";
|
||||
|
||||
export interface ConfigResult<T> {
|
||||
|
|
@ -187,6 +188,7 @@ async function serializedToIntermediateConfig(
|
|||
const promptFolder = initial.experimental?.promptPath;
|
||||
|
||||
if (loadPromptFiles) {
|
||||
// v1 prompt files
|
||||
let promptFiles: { path: string; content: string }[] = [];
|
||||
promptFiles = (
|
||||
await Promise.all(
|
||||
|
|
@ -238,6 +240,7 @@ async function intermediateToFinalConfig(
|
|||
uniqueId: string,
|
||||
writeLog: (log: string) => Promise<void>,
|
||||
workOsAccessToken: string | undefined,
|
||||
loadPromptFiles: boolean = true,
|
||||
allowFreeTrial: boolean = true,
|
||||
): Promise<ContinueConfig> {
|
||||
// Auto-detect models
|
||||
|
|
@ -389,6 +392,7 @@ async function intermediateToFinalConfig(
|
|||
const DEFAULT_CONTEXT_PROVIDERS = [
|
||||
new FileContextProvider({}),
|
||||
new CodebaseContextProvider(codebaseContextParams),
|
||||
...(loadPromptFiles ? [new PromptFilesContextProvider({})] : []),
|
||||
];
|
||||
|
||||
const DEFAULT_CONTEXT_PROVIDERS_TITLES = DEFAULT_CONTEXT_PROVIDERS.map(
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import * as YAML from "yaml";
|
|||
import type { IDE, SlashCommand } from "..";
|
||||
import { walkDir } from "../indexing/walkDir";
|
||||
import { stripImages } from "../llm/images";
|
||||
import { renderTemplatedString } from "../promptFiles/renderTemplatedString";
|
||||
import { renderTemplatedString } from "../promptFiles/v1/renderTemplatedString";
|
||||
import { getBasename } from "../util/index";
|
||||
|
||||
export const DEFAULT_PROMPTS_FOLDER = ".prompts";
|
||||
|
|
|
|||
55
core/context/providers/PromptFilesContextProvider.ts
Normal file
55
core/context/providers/PromptFilesContextProvider.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { BaseContextProvider } from "..";
|
||||
import {
|
||||
ContextItem,
|
||||
ContextProviderDescription,
|
||||
ContextProviderExtras,
|
||||
ContextSubmenuItem,
|
||||
LoadSubmenuItemsArgs,
|
||||
} from "../../";
|
||||
import { getAllPromptFilesV2 } from "../../promptFiles/v2/getPromptFiles";
|
||||
import { parsePreamble } from "../../promptFiles/v2/parse";
|
||||
import { renderPromptFileV2 } from "../../promptFiles/v2/renderPromptFile";
|
||||
|
||||
class PromptFilesContextProvider extends BaseContextProvider {
|
||||
static description: ContextProviderDescription = {
|
||||
title: "prompt-files",
|
||||
displayTitle: "Prompt Files",
|
||||
description: ".prompt files",
|
||||
type: "submenu",
|
||||
};
|
||||
|
||||
async getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras,
|
||||
): Promise<ContextItem[]> {
|
||||
const rawContent = await extras.ide.readFile(query);
|
||||
const preamble = parsePreamble(query, rawContent);
|
||||
const rendered = await renderPromptFileV2(rawContent);
|
||||
return [
|
||||
{
|
||||
content: rendered,
|
||||
name: preamble.name,
|
||||
description: preamble.description,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
async loadSubmenuItems(
|
||||
args: LoadSubmenuItemsArgs,
|
||||
): Promise<ContextSubmenuItem[]> {
|
||||
const promptFiles = await getAllPromptFilesV2(
|
||||
args.ide,
|
||||
args.config.experimental?.promptPath,
|
||||
);
|
||||
return promptFiles.map((file) => {
|
||||
const preamble = parsePreamble(file.path, file.content);
|
||||
return {
|
||||
id: file.path,
|
||||
title: preamble.name,
|
||||
description: preamble.description,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default PromptFilesContextProvider;
|
||||
|
|
@ -4,6 +4,7 @@ import CodeContextProvider from "./CodeContextProvider";
|
|||
import ContinueProxyContextProvider from "./ContinueProxyContextProvider";
|
||||
import CurrentFileContextProvider from "./CurrentFileContextProvider";
|
||||
import DatabaseContextProvider from "./DatabaseContextProvider";
|
||||
import DebugLocalsProvider from "./DebugLocalsProvider";
|
||||
import DiffContextProvider from "./DiffContextProvider";
|
||||
import DiscordContextProvider from "./DiscordContextProvider";
|
||||
import DocsContextProvider from "./DocsContextProvider";
|
||||
|
|
@ -15,7 +16,6 @@ import GoogleContextProvider from "./GoogleContextProvider";
|
|||
import GreptileContextProvider from "./GreptileContextProvider";
|
||||
import HttpContextProvider from "./HttpContextProvider";
|
||||
import JiraIssuesContextProvider from "./JiraIssuesContextProvider/";
|
||||
import DebugLocalsProvider from "./DebugLocalsProvider";
|
||||
import OSContextProvider from "./OSContextProvider";
|
||||
import OpenFilesContextProvider from "./OpenFilesContextProvider";
|
||||
import PostgresContextProvider from "./PostgresContextProvider";
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import {
|
|||
setupLocalConfigAfterFreeTrial,
|
||||
setupQuickstartConfig,
|
||||
} from "./config/onboarding";
|
||||
import { createNewPromptFile } from "./config/promptFile";
|
||||
import { addModel, addOpenAIKey, deleteModel } from "./config/util";
|
||||
import { recentlyEditedFilesCache } from "./context/retrieval/recentlyEditedFilesCache";
|
||||
import { ContinueServerClient } from "./continueServer/stubs/client";
|
||||
|
|
@ -18,6 +17,7 @@ import { streamDiffLines } from "./edit/streamDiffLines";
|
|||
import { CodebaseIndexer, PauseToken } from "./indexing/CodebaseIndexer";
|
||||
import DocsService from "./indexing/docs/DocsService";
|
||||
import Ollama from "./llm/llms/Ollama";
|
||||
import { createNewPromptFileV2 } from "./promptFiles/v2/createNewPromptFile";
|
||||
import type { FromCoreProtocol, ToCoreProtocol } from "./protocol";
|
||||
import { GlobalContext } from "./util/GlobalContext";
|
||||
import { ChatDescriber } from "./util/chatDescriber";
|
||||
|
|
@ -245,11 +245,11 @@ export class Core {
|
|||
});
|
||||
|
||||
on("config/newPromptFile", async (msg) => {
|
||||
void createNewPromptFile(
|
||||
await createNewPromptFileV2(
|
||||
this.ide,
|
||||
(await this.config()).experimental?.promptPath,
|
||||
);
|
||||
void this.configHandler.reloadConfig();
|
||||
await this.configHandler.reloadConfig();
|
||||
});
|
||||
|
||||
on("config/reload", (msg) => {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@ import {
|
|||
LLMOptions,
|
||||
ModelDescription,
|
||||
} from "../..";
|
||||
import { renderTemplatedString } from "../../promptFiles/renderTemplatedString";
|
||||
import { renderTemplatedString } from "../../promptFiles/v1/renderTemplatedString";
|
||||
import { BaseLLM } from "../index";
|
||||
import Anthropic from "./Anthropic";
|
||||
import Asksage from "./Asksage";
|
||||
import Azure from "./Azure";
|
||||
import Bedrock from "./Bedrock";
|
||||
import BedrockImport from "./BedrockImport";
|
||||
|
|
@ -40,11 +41,10 @@ import SageMaker from "./SageMaker";
|
|||
import SambaNova from "./SambaNova";
|
||||
import TextGenWebUI from "./TextGenWebUI";
|
||||
import Together from "./Together";
|
||||
import VertexAI from "./VertexAI";
|
||||
import Vllm from "./Vllm";
|
||||
import WatsonX from "./WatsonX";
|
||||
import ContinueProxy from "./stubs/ContinueProxy";
|
||||
import VertexAI from "./VertexAI";
|
||||
import Asksage from "./Asksage";
|
||||
|
||||
const LLMs = [
|
||||
Anthropic,
|
||||
|
|
@ -84,7 +84,7 @@ const LLMs = [
|
|||
Cerebras,
|
||||
Asksage,
|
||||
Nebius,
|
||||
VertexAI
|
||||
VertexAI,
|
||||
];
|
||||
|
||||
export async function llmFromDescription(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import path from "path";
|
||||
import { IDE } from "..";
|
||||
import { DEFAULT_PROMPTS_FOLDER } from "./";
|
||||
import { DEFAULT_PROMPTS_FOLDER } from ".";
|
||||
import { IDE } from "../..";
|
||||
|
||||
const DEFAULT_PROMPT_FILE = `# This is an example ".prompt" file
|
||||
# It is used to define and reuse prompts within Continue
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { IDE } from "..";
|
||||
import { walkDir } from "../indexing/walkDir";
|
||||
import { IDE } from "../..";
|
||||
import { walkDir } from "../../indexing/walkDir";
|
||||
|
||||
export async function getPromptFiles(
|
||||
ide: IDE,
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
import { IDE } from "..";
|
||||
import { getPromptFiles } from "./getPromptFiles";
|
||||
import { createNewPromptFile } from "./createNewPromptFile";
|
||||
import { getPromptFiles } from "./getPromptFiles";
|
||||
import { slashCommandFromPromptFile } from "./slashCommandFromPromptFile";
|
||||
|
||||
export const DEFAULT_PROMPTS_FOLDER = ".prompts";
|
||||
|
||||
export { getPromptFiles, createNewPromptFile, slashCommandFromPromptFile };
|
||||
export { createNewPromptFile, getPromptFiles, slashCommandFromPromptFile };
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { SlashCommand } from "..";
|
||||
import { stripImages } from "../llm/images";
|
||||
import * as YAML from "yaml";
|
||||
import { SlashCommand } from "../..";
|
||||
import { stripImages } from "../../llm/images";
|
||||
import { getBasename } from "../../util/index";
|
||||
import { getContextProviderHelpers } from "./getContextProviderHelpers";
|
||||
import { renderTemplatedString } from "./renderTemplatedString";
|
||||
import { updateChatHistory } from "./updateChatHistory";
|
||||
import * as YAML from "yaml";
|
||||
import { getBasename } from "../util/index";
|
||||
|
||||
export function extractName(preamble: { name?: string }, path: string): string {
|
||||
return preamble.name ?? getBasename(path).split(".prompt")[0];
|
||||
35
core/promptFiles/v2/createNewPromptFile.ts
Normal file
35
core/promptFiles/v2/createNewPromptFile.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import path from "path";
|
||||
import { IDE } from "../..";
|
||||
import { DEFAULT_PROMPTS_FOLDER_V2 } from "./getPromptFiles";
|
||||
|
||||
const DEFAULT_PROMPT_FILE = `# This is an example ".prompt" file
|
||||
# It is used to define and reuse prompts within Continue
|
||||
# Continue will automatically create a context provider for each prompt in the .prompts folder
|
||||
# To learn more, see the full .prompt file reference: https://docs.continue.dev/features/prompt-files
|
||||
temperature: 0.0
|
||||
version: 2
|
||||
---
|
||||
@README.md
|
||||
|
||||
Please reference the above README.md file to understand the current project.
|
||||
`;
|
||||
|
||||
export async function createNewPromptFileV2(
|
||||
ide: IDE,
|
||||
promptPath: string | undefined,
|
||||
): Promise<void> {
|
||||
const workspaceDirs = await ide.getWorkspaceDirs();
|
||||
if (workspaceDirs.length === 0) {
|
||||
throw new Error(
|
||||
"No workspace directories found. Make sure you've opened a folder in your IDE.",
|
||||
);
|
||||
}
|
||||
const promptFilePath = path.join(
|
||||
workspaceDirs[0],
|
||||
promptPath ?? DEFAULT_PROMPTS_FOLDER_V2,
|
||||
"new-prompt-file.prompt",
|
||||
);
|
||||
|
||||
await ide.writeFile(promptFilePath, DEFAULT_PROMPT_FILE);
|
||||
await ide.openFile(promptFilePath);
|
||||
}
|
||||
59
core/promptFiles/v2/getPromptFiles.ts
Normal file
59
core/promptFiles/v2/getPromptFiles.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import path from "path";
|
||||
import { IDE } from "../..";
|
||||
import { walkDir } from "../../indexing/walkDir";
|
||||
import { readAllGlobalPromptFiles } from "../../util/paths";
|
||||
|
||||
async function getPromptFilesFromDir(
|
||||
ide: IDE,
|
||||
dir: string,
|
||||
): Promise<{ path: string; content: string }[]> {
|
||||
try {
|
||||
const exists = await ide.fileExists(dir);
|
||||
|
||||
if (!exists) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const paths = await walkDir(dir, ide, { ignoreFiles: [] });
|
||||
const results = paths.map(async (path) => {
|
||||
const content = await ide.readFile(path); // make a try catch
|
||||
return { path, content };
|
||||
});
|
||||
return Promise.all(results);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export const DEFAULT_PROMPTS_FOLDER_V2 = ".prompts";
|
||||
|
||||
export async function getAllPromptFilesV2(
|
||||
ide: IDE,
|
||||
overridePromptFolder?: string,
|
||||
): Promise<{ path: string; content: string }[]> {
|
||||
const workspaceDirs = await ide.getWorkspaceDirs();
|
||||
let promptFiles: { path: string; content: string }[] = [];
|
||||
promptFiles = (
|
||||
await Promise.all(
|
||||
workspaceDirs.map((dir) =>
|
||||
getPromptFilesFromDir(
|
||||
ide,
|
||||
path.join(dir, overridePromptFolder ?? DEFAULT_PROMPTS_FOLDER_V2),
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
.flat()
|
||||
.filter(({ path }) => path.endsWith(".prompt"));
|
||||
|
||||
// Also read from ~/.continue/.prompts
|
||||
promptFiles.push(...readAllGlobalPromptFiles());
|
||||
|
||||
return await Promise.all(
|
||||
promptFiles.map(async (file) => {
|
||||
const content = await ide.readFile(file.path);
|
||||
return { path: file.path, content };
|
||||
}),
|
||||
);
|
||||
}
|
||||
27
core/promptFiles/v2/parse.ts
Normal file
27
core/promptFiles/v2/parse.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import * as YAML from "yaml";
|
||||
import { getBasename } from "../../util";
|
||||
|
||||
export function extractName(preamble: { name?: string }, path: string): string {
|
||||
return preamble.name ?? getBasename(path).split(".prompt")[0];
|
||||
}
|
||||
|
||||
export function parsePreamble(
|
||||
path: string,
|
||||
content: string,
|
||||
): { [key: string]: any; name: string; description: string } {
|
||||
let [preambleRaw, prompt] = content.split("\n---\n");
|
||||
if (prompt === undefined) {
|
||||
// This means there is no preamble
|
||||
preambleRaw = "";
|
||||
}
|
||||
|
||||
const preamble = YAML.parse(preambleRaw) ?? {};
|
||||
const name = extractName(preamble, path);
|
||||
const description = preamble.description ?? name;
|
||||
|
||||
return {
|
||||
...preamble,
|
||||
name,
|
||||
description,
|
||||
};
|
||||
}
|
||||
3
core/promptFiles/v2/renderPromptFile.ts
Normal file
3
core/promptFiles/v2/renderPromptFile.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export async function renderPromptFileV2(rawContent: string): Promise<string> {
|
||||
return rawContent;
|
||||
}
|
||||
4
extensions/vscode/package-lock.json
generated
4
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.224",
|
||||
"version": "0.9.225",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.224",
|
||||
"version": "0.9.225",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import {
|
|||
BookOpenIcon,
|
||||
CodeBracketIcon,
|
||||
CommandLineIcon,
|
||||
DocumentTextIcon,
|
||||
ExclamationCircleIcon,
|
||||
ExclamationTriangleIcon,
|
||||
FolderIcon,
|
||||
|
|
@ -21,6 +22,7 @@ import {
|
|||
import { Editor } from "@tiptap/react";
|
||||
import {
|
||||
forwardRef,
|
||||
useContext,
|
||||
useEffect,
|
||||
useImperativeHandle,
|
||||
useRef,
|
||||
|
|
@ -36,6 +38,7 @@ import {
|
|||
vscListActiveForeground,
|
||||
vscQuickInputBackground,
|
||||
} from "..";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import {
|
||||
setDialogMessage,
|
||||
setShowDialog,
|
||||
|
|
@ -61,6 +64,7 @@ const ICONS_FOR_DROPDOWN: { [key: string]: any } = {
|
|||
issue: ExclamationCircleIcon,
|
||||
trash: TrashIcon,
|
||||
web: GlobeAltIcon,
|
||||
"prompt-files": DocumentTextIcon,
|
||||
"repo-map": FolderIcon,
|
||||
"/edit": PencilIcon,
|
||||
"/clear": TrashIcon,
|
||||
|
|
@ -177,6 +181,8 @@ interface MentionListProps {
|
|||
const MentionList = forwardRef((props: MentionListProps, ref) => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||
|
||||
const [subMenuTitle, setSubMenuTitle] = useState<string | undefined>(
|
||||
|
|
@ -208,6 +214,15 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
|
|||
},
|
||||
description: "Add a new documentation source",
|
||||
});
|
||||
} else if (subMenuTitle === ".prompt files") {
|
||||
items.push({
|
||||
title: "New .prompt file",
|
||||
type: "action",
|
||||
action: () => {
|
||||
ideMessenger.request("config/newPromptFile", undefined);
|
||||
},
|
||||
description: "Create a new .prompt file",
|
||||
});
|
||||
}
|
||||
|
||||
setAllItems(items);
|
||||
|
|
@ -375,7 +390,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
|
|||
onClick={() => selectItem(index)}
|
||||
onMouseEnter={() => setSelectedIndex(index)}
|
||||
>
|
||||
<span className="flex justify-between w-full items-center">
|
||||
<span className="flex w-full items-center justify-between">
|
||||
<div className="flex items-center justify-center">
|
||||
{showFileIconForItem(item) && (
|
||||
<FileIcon
|
||||
|
|
@ -400,7 +415,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
|
|||
opacity: index !== selectedIndex ? 0 : 1,
|
||||
minWidth: "30px",
|
||||
}}
|
||||
className="whitespace-nowrap overflow-hidden overflow-ellipsis ml-2 flex items-center"
|
||||
className="ml-2 flex items-center overflow-hidden overflow-ellipsis whitespace-nowrap"
|
||||
>
|
||||
{item.description}
|
||||
{item.type === "contextProvider" &&
|
||||
|
|
|
|||
|
|
@ -189,18 +189,17 @@ export function getSlashCommandDropdownOptions(
|
|||
const items = async ({ query }: { query: string }) => {
|
||||
const options = [
|
||||
...availableSlashCommandsRef.current,
|
||||
{
|
||||
title: "Build a custom prompt",
|
||||
description: "Build a custom prompt",
|
||||
type: "action",
|
||||
id: "createPromptFile",
|
||||
label: "Create Prompt File",
|
||||
action: () => {
|
||||
console.log("I", ideMessenger.request);
|
||||
ideMessenger.request("config/newPromptFile", undefined);
|
||||
},
|
||||
name: "Create Prompt File",
|
||||
},
|
||||
// {
|
||||
// title: "Build a custom prompt",
|
||||
// description: "Build a custom prompt",
|
||||
// type: "action",
|
||||
// id: "createPromptFile",
|
||||
// label: "Create Prompt File",
|
||||
// action: () => {
|
||||
// ideMessenger.request("config/newPromptFile", undefined);
|
||||
// },
|
||||
// name: "Create Prompt File",
|
||||
// },
|
||||
];
|
||||
return (
|
||||
options.filter((slashCommand) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue