diff --git a/CHANGELOG.yaml b/CHANGELOG.yaml index 3f1fdbc..5fb92a1 100644 --- a/CHANGELOG.yaml +++ b/CHANGELOG.yaml @@ -1,4 +1,7 @@ releases: + - version: "0.2" + features: + - "add mode config, you can create mode config in _infio_prompts folder" - version: "0.1.8" improvements: - "fix chat input command plugin" diff --git a/src/components/chat-view/ChatView.tsx b/src/components/chat-view/ChatView.tsx index 75d50c7..12a12aa 100644 --- a/src/components/chat-view/ChatView.tsx +++ b/src/components/chat-view/ChatView.tsx @@ -114,6 +114,7 @@ const Chat = forwardRef((props, ref) => { const { streamResponse, chatModel } = useLLM() const promptGenerator = useMemo(() => { + // @ts-expect-error return new PromptGenerator(getRAGEngine, app, settings, diffStrategy, customModePrompts, customModeList) }, [getRAGEngine, app, settings, diffStrategy, customModePrompts, customModeList]) diff --git a/src/utils/modes.ts b/src/utils/modes.ts index 33b17be..09920b0 100644 --- a/src/utils/modes.ts +++ b/src/utils/modes.ts @@ -1,3 +1,5 @@ +import { App } from "obsidian" + import { addCustomInstructions } from "../core/prompts/sections/custom-instructions" import { ALWAYS_AVAILABLE_TOOLS, TOOL_GROUPS, ToolGroup } from "./tool-groups" @@ -262,6 +264,7 @@ export async function getAllModesWithPrompts(): Promise { // Helper function to get complete mode details with all overrides export async function getFullModeDetails( + app: App, modeSlug: string, customModes?: ModeConfig[], customModePrompts?: CustomModePrompts, @@ -284,6 +287,7 @@ export async function getFullModeDetails( let fullCustomInstructions = baseCustomInstructions if (options?.cwd) { fullCustomInstructions = await addCustomInstructions( + app, baseCustomInstructions, options.globalCustomInstructions || "", options.cwd, diff --git a/src/utils/prompt-generator.ts b/src/utils/prompt-generator.ts index 134a91d..bbba00b 100644 --- a/src/utils/prompt-generator.ts +++ b/src/utils/prompt-generator.ts @@ -252,7 +252,7 @@ export class PromptGenerator { // Add current mode details const currentMode = this.settings.mode - const modeDetails = await getFullModeDetails(currentMode) + const modeDetails = await getFullModeDetails(this.app, currentMode, this.customModeList, this.customModePrompts) details += `\n\n# Current Mode\n` details += `${currentMode}\n` details += `${modeDetails.name}\n`