Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion core/config/markdown/loadMarkdownRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ export async function loadMarkdownRules(ide: IDE): Promise<{
uriType: "file",
fileUri: file.path,
});
rules.push({ ...rule, source: "rules-block", sourceFile: file.path });
if (rule.invokable) {
// skip prompt files which are invokable
} else {
rules.push({
...rule,
source: "rules-block",
sourceFile: file.path,
});
}
} catch (e) {
errors.push({
fatal: false,
Expand Down
10 changes: 8 additions & 2 deletions core/promptFiles/getPromptFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export async function getPromptFilesFromDir(
const uris = await walkDir(dir, ide, {
source: "get dir prompt files",
});
const promptFilePaths = uris.filter((p) => p.endsWith(".prompt"));
const promptFilePaths = uris.filter(
(p) => p.endsWith(".prompt") || p.endsWith(".md"),
);
const results = promptFilePaths.map(async (uri) => {
const content = await ide.readFile(uri); // make a try catch
return { path: uri, content };
Expand Down Expand Up @@ -60,6 +62,8 @@ export async function getAllPromptFiles(
await Promise.all(fullDirs.map((dir) => getPromptFilesFromDir(ide, dir)))
).flat();

console.log("debug1 prompt files", promptFiles);

// Also read from ~/.continue/prompts and ~/.continue/rules
promptFiles.push(...readAllGlobalPromptFiles());

Expand All @@ -68,10 +72,12 @@ export async function getAllPromptFiles(
);
promptFiles.push(...promptFilesFromRulesDirectory);

return await Promise.all(
const result = await Promise.all(
promptFiles.map(async (file) => {
const content = await ide.readFile(file.path);
return { path: file.path, content };
}),
);
console.log("debug1 result", result);
return result;
}
Loading