mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-09 00:20:09 +00:00
add mode config, fix app params
This commit is contained in:
@@ -114,6 +114,7 @@ const Chat = forwardRef<ChatRef, ChatProps>((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])
|
||||
|
||||
|
||||
@@ -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<ModeConfig[]> {
|
||||
|
||||
// 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,
|
||||
|
||||
@@ -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 += `<slug>${currentMode}</slug>\n`
|
||||
details += `<name>${modeDetails.name}</name>\n`
|
||||
|
||||
Reference in New Issue
Block a user