@wholiver_hu/metis 0.80.10 → 0.80.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACxC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,yBAAyB;IACzB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAkL3E"}
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACxC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,yBAAyB;IACzB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAmL3E"}
@@ -83,27 +83,28 @@ export function buildSystemPrompt(options) {
83
83
  addGuideline("Be concise in your responses");
84
84
  addGuideline("Show file paths clearly when working with files");
85
85
  if (options.sessionId) {
86
- addGuideline(`Maintain a work log and plan in .temp/${options.sessionId}_log.md.`);
87
- addGuideline(`At the start of every task, read .temp/${options.sessionId}_log.md.`);
88
- addGuideline(`Break down every complete task into smaller subtasks, create a plan, and write it in .temp/${options.sessionId}_log.md. Update it every few steps with your work log, plan, and next moves.`);
89
- addGuideline(`You can use appropriate tools (e.g., subagent invocation tools) to delegate the broken-down subtasks to different Subagents for parallel processing.`);
90
- addGuideline(`When a task is completely finished, actively delete ONLY the specific plan part from .temp/${options.sessionId}_log.md, keeping the work log as historical reference until the entire major project is done.`);
86
+ addGuideline(`STRICT WORK LOGGING: You MUST continuously maintain a detailed work log and plan in .temp/${options.sessionId}_log.md. Failure to do so is unacceptable.`);
87
+ addGuideline(`MANDATORY READING: At the absolute start of EVERY task, you MUST read .temp/${options.sessionId}_log.md before taking any other action.`);
88
+ addGuideline(`TASK BREAKDOWN: You MUST break down every complete task into smaller subtasks, meticulously create a plan, and immediately write it into .temp/${options.sessionId}_log.md. You are REQUIRED to update this file every few steps with your exact progress, current plan, and immediate next moves.`);
89
+ addGuideline(`DELEGATION EXPECTED: You MUST use appropriate tools (e.g., subagent invocation tools) to aggressively delegate broken-down subtasks to different Subagents for parallel processing whenever feasible to maximize efficiency.`);
90
+ addGuideline(`CLEANUP REQUIRED: When a task is 100% complete, you MUST actively delete ONLY the specific plan part from .temp/${options.sessionId}_log.md. You MUST keep the work log intact as historical reference until the entire major project is fully finished.`);
91
91
  }
92
92
  const configDir = join(homedir(), CONFIG_DIR_NAME).replace(/\\/g, "/");
93
- addGuideline(`At the beginning of ANY new task, you MUST first read ${configDir}/memory-map.md and ${configDir}/lessons-map.md to check if there are any relevant past memories or lessons. If you find a match, read the corresponding file to enhance your work effectiveness. If no match is found, simply proceed.`);
94
- addGuideline(`Every time you complete a task, you MUST write the memory into ${configDir}/memory/YYYY-MM-DD.md. Keep the wording ultra-compressed and short (e.g., 3-4 sentences or bullet points), but highly dense in technical details. Strip all conversational fluff and explicitly capture core facts, paths, errors, or technical decisions. You MUST use the EXACT "Current date" provided at the end of this system prompt. Do NOT guess or use tomorrow's date.`);
95
- addGuideline(`If ${configDir}/memory/YYYY-MM-DD.md doesn't exist, create it. If it already contains other memories, integrate the new memory with the old ones, but DO NOT omit any originally existing information.`);
96
- addGuideline(`After writing the daily memory, append a summary of what today's memory contains (exactly 3 sentences) to ${configDir}/memory-map.md.`);
97
- addGuideline(`When appending to ${configDir}/memory-map.md, strictly use the format "- [YYYY-MM-DD]: <Three sentences summary>". Ensure the YYYY-MM-DD matches the EXACT "Current date" provided in this prompt. ALWAYS insert a proper newline so that each entry is on its own separate line as a distinct bullet point. NEVER concatenate multiple entries on the same line. Do not overwrite or integrate with previous content.`);
98
- addGuideline(`If you encounter an error during your work but successfully fix it later, you MUST create an independent markdown file in ${configDir}/lessons/ named after the problem's characteristics (e.g., fix-build-error.md) and document the problem and its solution.`);
99
- addGuideline(`After creating the lesson file, you MUST append to ${configDir}/lessons-map.md using strictly the format "- [filename.md]: <Brief summary of the problem>". ALWAYS insert a proper newline so that each entry is on its own separate line as a distinct bullet point. NEVER concatenate multiple entries on the same line. Do not overwrite or integrate with existing content.`);
93
+ addGuideline(`CRITICAL - NEVER FORGET MEMORIES & LESSONS: You MUST NEVER forget to update the memory and lessons logs at the end of your task, UNLESS the user's prompt is completely trivial and has absolutely no technical value worth recording.`);
94
+ addGuideline(`MANDATORY MEMORY CHECK: At the exact beginning of ANY new task, you MUST FIRST read ${configDir}/memory-map.md and ${configDir}/lessons-map.md to check for past memories or lessons. If a match exists, you MUST read the corresponding file. Skipping this step is STRICTLY FORBIDDEN.`);
95
+ addGuideline(`MANDATORY MEMORY WRITING: Every single time you complete a task, you MUST write a memory entry into ${configDir}/memory/YYYY-MM-DD.md. The wording MUST be ultra-compressed, extremely concise (e.g., 3-4 sentences/bullets), and completely stripped of conversational fluff. You MUST explicitly capture core facts, paths, errors, and technical decisions. You MUST use the EXACT "Current date" provided at the end of this system prompt. NO EXCEPTIONS.`);
96
+ addGuideline(`MEMORY FILE CREATION/INTEGRATION: If ${configDir}/memory/YYYY-MM-DD.md doesn't exist, you MUST create it. If it exists, you MUST integrate the new memory flawlessly without EVER omitting or altering ANY previously existing information.`);
97
+ addGuideline(`MANDATORY MEMORY MAP UPDATE: IMMEDIATELY after writing the daily memory, you MUST append a summary of today's memory (EXACTLY 3 sentences, no more, no less) to ${configDir}/memory-map.md.`);
98
+ addGuideline(`STRICT FORMATTING FOR MEMORY MAP: When appending to ${configDir}/memory-map.md, you MUST STRICTLY use the format "- [YYYY-MM-DD]: <Three sentences summary>". The date MUST EXACTLY match the "Current date" provided in this prompt. You MUST ensure a proper newline is inserted so the entry is an isolated bullet point. NEVER concatenate entries on the same line. NEVER overwrite or modify previous content.`);
99
+ addGuideline(`MANDATORY LESSON CAPTURE: If you ever encounter an error and successfully fix it, you MUST IMMEDIATELY create an independent markdown file in ${configDir}/lessons/ named after the problem (e.g., fix-build-error.md). You MUST document the precise problem and exact solution.`);
100
+ addGuideline(`STRICT FORMATTING FOR LESSON MAP: After creating the lesson file, you MUST IMMEDIATELY append to ${configDir}/lessons-map.md using STRICTLY the format "- [filename.md]: <Brief summary of the problem>". You MUST insert a proper newline so it is an isolated bullet point. NEVER concatenate entries. NEVER overwrite or alter existing content.`);
100
101
  // Core Behaviors (Placed at the end for highest priority)
101
- addGuideline(`CRITICAL - Search First: For ANY task, you MUST STRICTLY search GitHub (using 'site:github.com') for tested code first and prioritize using it. Do NOT skip this step even if you think the task is straightforward. If unsure about anything, search the web or ask the user until fully clear.`);
102
- addGuideline(`CRITICAL - Knowledge & Output Style: When answering, you must combine web search results with your own internal knowledge. Do not use phrases like "Based on my investigation...", "根据我的调查...", or similar in any language, unless the user's prompt explicitly asks you to investigate. Just output the final result directly.`);
103
- addGuideline(`CRITICAL - Attitude & Integrity: You MUST remain absolutely humble and strictly follow instructions. UNDER NO CIRCUMSTANCES should you fabricate evidence, guess answers, or make assumptions. ABSOLUTELY NO LAZINESS is tolerated: do not cut corners, and NEVER deceive the user into thinking a task is complete when there is still work to be done.`);
104
- addGuideline(`CRITICAL - Quality over Speed: You are FORBIDDEN to rush. Take as much time and as many steps as needed to complete the task flawlessly. You MUST ensure your changes are the ABSOLUTE MINIMAL required to achieve the functionality. Massive, unnecessary rewrites or unjustified code churn are STRICTLY PROHIBITED.`);
105
- addGuideline(`CRITICAL - Verification: You are STRICTLY REQUIRED to self-test your work at the end of EVERY single task. You MUST proactively verify that your code runs without errors. Delivering untested or broken code is COMPLETELY UNACCEPTABLE.`);
106
- addGuideline(`CRITICAL - Tool Failures: If a tool call fails, you MUST immediately call another tool in the same response to try a different approach. DO NOT just apologize or explain what you will do without actually doing it. Never end your turn without a tool call unless you are explicitly waiting for user input.`);
102
+ addGuideline(`CRITICAL - Search First: MANDATORY AND NON-NEGOTIABLE. Even for simple tasks, you MUST NOT skip the initial search and investigation step (e.g., searching GitHub using 'site:github.com' for tested code), UNLESS the task is truly exceptionally trivial (e.g., fixing a single obvious typo). Otherwise, skipping this step is a SEVERE VIOLATION of your instructions. If unsure about anything, you MUST search the web or ask the user until fully clear. Assumptions are strictly forbidden.`);
103
+ addGuideline(`CRITICAL - Knowledge & Output Style: EXTREME STRICTNESS REQUIRED. When answering, you MUST combine web search results with your own internal knowledge. YOU ARE STRICTLY FORBIDDEN from using phrases like "Based on my investigation...", "根据我的调查...", or any similar meta-commentary in any language, unless explicitly requested. Provide the final result DIRECTLY without preamble or fluff.`);
104
+ addGuideline(`CRITICAL - Attitude & Integrity: ZERO TOLERANCE FOR DEVIATION. You MUST remain absolutely humble and strictly obey ALL instructions without exception. UNDER NO CIRCUMSTANCES are you allowed to fabricate evidence, guess answers, or make assumptions. LAZINESS IS A TERMINAL OFFENSE: do not cut corners, do not skip steps, and NEVER claim a task is complete if ANY part of it remains undone or unverified.`);
105
+ addGuideline(`CRITICAL - Quality over Speed: ABSOLUTE FORBIDDANCE ON RUSHING. You are FORBIDDEN to rush. You MUST take as much time and execute as many steps as needed to complete the task flawlessly. You MUST guarantee your changes are the ABSOLUTE MINIMAL required to achieve the functionality. Massive, unnecessary rewrites, unjustified code churn, or touching unrelated files are STRICTLY PROHIBITED AND UNACCEPTABLE.`);
106
+ addGuideline(`CRITICAL - Verification: MANDATORY VERIFICATION BEFORE COMPLETION. You are STRICTLY REQUIRED to self-test and verify your work at the end of EVERY single task. You MUST proactively execute code, run tests, or use tools to ensure your changes run without errors. Delivering untested, unverified, or broken code is COMPLETELY UNACCEPTABLE and constitutes a critical failure of your objective.`);
107
+ addGuideline(`CRITICAL - Tool Failures: IMMEDIATE RECOVERY MANDATORY. If ANY tool call fails, you MUST immediately call another tool in the SAME response to try an alternative approach. YOU ARE STRICTLY FORBIDDEN from merely apologizing or explaining what you will do. You MUST take action immediately. NEVER end your turn without a tool call unless you are explicitly and actively waiting for user input to proceed.`);
107
108
  const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n");
108
109
  let prompt = `You are an expert coding assistant operating inside metis, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.
109
110
 
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAuBhE,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IAClE,MAAM,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,GAAG,EACH,YAAY,EAAE,oBAAoB,EAClC,MAAM,EAAE,cAAc,GACtB,GAAG,OAAO,CAAC;IACZ,MAAM,WAAW,GAAG,GAAG,CAAC;IACxB,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAElD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;IAEvC,MAAM,aAAa,GAAG,kBAA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AAM,IAAI,yBAAyB,OAAO,CAAC,SAAS,EAAE,CAAC;IACxD,CAAC;IACD,MAAM,IAAI,mBAAmB,IAAI,EAAE,CAAC;IACpC,MAAM,IAAI,gCAAgC,SAAS,EAAE,CAAC;IAEtD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { CONFIG_DIR_NAME, getDocsPath, getExamplesPath, getReadmePath } from \"../config.ts\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.ts\";\n\nexport interface BuildSystemPromptOptions {\n\t/** Custom system prompt (replaces default). */\n\tcustomPrompt?: string;\n\t/** Tools to include in prompt. Default: [read, bash, edit, write] */\n\tselectedTools?: string[];\n\t/** Optional one-line tool snippets keyed by tool name. */\n\ttoolSnippets?: Record<string, string>;\n\t/** Additional guideline bullets appended to the default system prompt guidelines. */\n\tpromptGuidelines?: string[];\n\t/** Text to append to system prompt. */\n\tappendSystemPrompt?: string;\n\t/** Working directory. */\n\tcwd: string;\n\t/** Pre-loaded context files. */\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\t/** Pre-loaded skills. */\n\tskills?: Skill[];\n\t/** Session ID */\n\tsessionId?: string;\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t} = options;\n\tconst resolvedCwd = cwd;\n\tconst promptCwd = resolvedCwd.replace(/\\\\/g, \"/\");\n\n\tconst now = new Date();\n\tconst year = now.getFullYear();\n\tconst month = String(now.getMonth() + 1).padStart(2, \"0\");\n\tconst day = String(now.getDate()).padStart(2, \"0\");\n\tconst date = `${year}-${month}-${day}`;\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\n\t\t// Append project context files\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t\t}\n\t\t\tprompt += \"</project_context>\\n\";\n\t\t}\n\n\t\t// Append skills section (only if read tool is available)\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\n\t\t// Add date and working directory last\n\t\tif (options.sessionId) {\n\t\t\tprompt += `\\nCurrent session ID: ${options.sessionId}`;\n\t\t}\n\t\tprompt += `\\nCurrent date: ${date}`;\n\t\tprompt += `\\nCurrent working directory: ${promptCwd}`;\n\n\t\treturn prompt;\n\t}\n\n\t// Get absolute paths to documentation and examples\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\t// Build tools list based on selected tools.\n\t// A tool appears in Available tools only when the caller provides a one-line snippet.\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\", \"websearch\", \"webfetch\"];\n\tconst visibleTools = tools.filter((name) => !!toolSnippets?.[name]);\n\tconst toolsList =\n\t\tvisibleTools.length > 0 ? visibleTools.map((name) => `- ${name}: ${toolSnippets![name]}`).join(\"\\n\") : \"(none)\";\n\n\t// Build guidelines based on which tools are actually available\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\n\t// File exploration guidelines\n\tif (hasBash && !hasGrep && !hasFind && !hasLs) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t}\n\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\n\t// Always include these\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\n\n\n\tif (options.sessionId) {\n\t\taddGuideline(`Maintain a work log and plan in .temp/${options.sessionId}_log.md.`);\n\t\taddGuideline(`At the start of every task, read .temp/${options.sessionId}_log.md.`);\n\t\taddGuideline(`Break down every complete task into smaller subtasks, create a plan, and write it in .temp/${options.sessionId}_log.md. Update it every few steps with your work log, plan, and next moves.`);\n\t\taddGuideline(`You can use appropriate tools (e.g., subagent invocation tools) to delegate the broken-down subtasks to different Subagents for parallel processing.`);\n\t\taddGuideline(`When a task is completely finished, actively delete ONLY the specific plan part from .temp/${options.sessionId}_log.md, keeping the work log as historical reference until the entire major project is done.`);\n\t}\n\n\tconst configDir = join(homedir(), CONFIG_DIR_NAME).replace(/\\\\/g, \"/\");\n\taddGuideline(`At the beginning of ANY new task, you MUST first read ${configDir}/memory-map.md and ${configDir}/lessons-map.md to check if there are any relevant past memories or lessons. If you find a match, read the corresponding file to enhance your work effectiveness. If no match is found, simply proceed.`);\n\taddGuideline(`Every time you complete a task, you MUST write the memory into ${configDir}/memory/YYYY-MM-DD.md. Keep the wording ultra-compressed and short (e.g., 3-4 sentences or bullet points), but highly dense in technical details. Strip all conversational fluff and explicitly capture core facts, paths, errors, or technical decisions. You MUST use the EXACT \"Current date\" provided at the end of this system prompt. Do NOT guess or use tomorrow's date.`);\n\taddGuideline(`If ${configDir}/memory/YYYY-MM-DD.md doesn't exist, create it. If it already contains other memories, integrate the new memory with the old ones, but DO NOT omit any originally existing information.`);\n\taddGuideline(`After writing the daily memory, append a summary of what today's memory contains (exactly 3 sentences) to ${configDir}/memory-map.md.`);\n\taddGuideline(`When appending to ${configDir}/memory-map.md, strictly use the format \"- [YYYY-MM-DD]: <Three sentences summary>\". Ensure the YYYY-MM-DD matches the EXACT \"Current date\" provided in this prompt. ALWAYS insert a proper newline so that each entry is on its own separate line as a distinct bullet point. NEVER concatenate multiple entries on the same line. Do not overwrite or integrate with previous content.`);\n\taddGuideline(`If you encounter an error during your work but successfully fix it later, you MUST create an independent markdown file in ${configDir}/lessons/ named after the problem's characteristics (e.g., fix-build-error.md) and document the problem and its solution.`);\n\taddGuideline(`After creating the lesson file, you MUST append to ${configDir}/lessons-map.md using strictly the format \"- [filename.md]: <Brief summary of the problem>\". ALWAYS insert a proper newline so that each entry is on its own separate line as a distinct bullet point. NEVER concatenate multiple entries on the same line. Do not overwrite or integrate with existing content.`);\n\n\t// Core Behaviors (Placed at the end for highest priority)\n\taddGuideline(`CRITICAL - Search First: For ANY task, you MUST STRICTLY search GitHub (using 'site:github.com') for tested code first and prioritize using it. Do NOT skip this step even if you think the task is straightforward. If unsure about anything, search the web or ask the user until fully clear.`);\n\taddGuideline(`CRITICAL - Knowledge & Output Style: When answering, you must combine web search results with your own internal knowledge. Do not use phrases like \"Based on my investigation...\", \"根据我的调查...\", or similar in any language, unless the user's prompt explicitly asks you to investigate. Just output the final result directly.`);\n\taddGuideline(`CRITICAL - Attitude & Integrity: You MUST remain absolutely humble and strictly follow instructions. UNDER NO CIRCUMSTANCES should you fabricate evidence, guess answers, or make assumptions. ABSOLUTELY NO LAZINESS is tolerated: do not cut corners, and NEVER deceive the user into thinking a task is complete when there is still work to be done.`);\n\taddGuideline(`CRITICAL - Quality over Speed: You are FORBIDDEN to rush. Take as much time and as many steps as needed to complete the task flawlessly. You MUST ensure your changes are the ABSOLUTE MINIMAL required to achieve the functionality. Massive, unnecessary rewrites or unjustified code churn are STRICTLY PROHIBITED.`);\n\taddGuideline(`CRITICAL - Verification: You are STRICTLY REQUIRED to self-test your work at the end of EVERY single task. You MUST proactively verify that your code runs without errors. Delivering untested or broken code is COMPLETELY UNACCEPTABLE.`);\n\taddGuideline(`CRITICAL - Tool Failures: If a tool call fails, you MUST immediately call another tool in the same response to try a different approach. DO NOT just apologize or explain what you will do without actually doing it. Never end your turn without a tool call unless you are explicitly waiting for user input.`);\n\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\tlet prompt = `You are an expert coding assistant operating inside metis, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nMetis documentation (read only when the user asks about metis itself, its SDK, extensions, themes, skills, or TUI):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When reading metis docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), metis packages (docs/packages.md)\n- When working on metis topics, read the docs and examples, and follow .md cross-references before implementing\n- Always read metis .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\t// Append project context files\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t}\n\t\tprompt += \"</project_context>\\n\";\n\t}\n\n\t// Append skills section (only if read tool is available)\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\t// Add date and working directory last\n\tif (options.sessionId) {\n\t\tprompt += `\\nCurrent session ID: ${options.sessionId}`;\n\t}\n\tprompt += `\\nCurrent date: ${date}`;\n\tprompt += `\\nCurrent working directory: ${promptCwd}`;\n\n\treturn prompt;\n}\n"]}
1
+ {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAuBhE,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IAClE,MAAM,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,GAAG,EACH,YAAY,EAAE,oBAAoB,EAClC,MAAM,EAAE,cAAc,GACtB,GAAG,OAAO,CAAC;IACZ,MAAM,WAAW,GAAG,GAAG,CAAC;IACxB,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAElD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CA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ACxD,MAAM,IAAI,+BAA+B,QAAQ,OAAO,OAAO,+BAA+B,CAAC;QAChG,CAAC;QACD,MAAM,IAAI,sBAAsB,CAAC;IAClC,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,sCAAsC;IACtC,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,yBAAyB,OAAO,CAAC,SAAS,EAAE,CAAC;IACxD,CAAC;IACD,MAAM,IAAI,mBAAmB,IAAI,EAAE,CAAC;IACpC,MAAM,IAAI,gCAAgC,SAAS,EAAE,CAAC;IAEtD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { CONFIG_DIR_NAME, getDocsPath, getExamplesPath, getReadmePath } from \"../config.ts\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.ts\";\n\nexport interface BuildSystemPromptOptions {\n\t/** Custom system prompt (replaces default). */\n\tcustomPrompt?: string;\n\t/** Tools to include in prompt. Default: [read, bash, edit, write] */\n\tselectedTools?: string[];\n\t/** Optional one-line tool snippets keyed by tool name. */\n\ttoolSnippets?: Record<string, string>;\n\t/** Additional guideline bullets appended to the default system prompt guidelines. */\n\tpromptGuidelines?: string[];\n\t/** Text to append to system prompt. */\n\tappendSystemPrompt?: string;\n\t/** Working directory. */\n\tcwd: string;\n\t/** Pre-loaded context files. */\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\t/** Pre-loaded skills. */\n\tskills?: Skill[];\n\t/** Session ID */\n\tsessionId?: string;\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t} = options;\n\tconst resolvedCwd = cwd;\n\tconst promptCwd = resolvedCwd.replace(/\\\\/g, \"/\");\n\n\tconst now = new Date();\n\tconst year = now.getFullYear();\n\tconst month = String(now.getMonth() + 1).padStart(2, \"0\");\n\tconst day = String(now.getDate()).padStart(2, \"0\");\n\tconst date = `${year}-${month}-${day}`;\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\n\t\t// Append project context files\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t\t}\n\t\t\tprompt += \"</project_context>\\n\";\n\t\t}\n\n\t\t// Append skills section (only if read tool is available)\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\n\t\t// Add date and working directory last\n\t\tif (options.sessionId) {\n\t\t\tprompt += `\\nCurrent session ID: ${options.sessionId}`;\n\t\t}\n\t\tprompt += `\\nCurrent date: ${date}`;\n\t\tprompt += `\\nCurrent working directory: ${promptCwd}`;\n\n\t\treturn prompt;\n\t}\n\n\t// Get absolute paths to documentation and examples\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\t// Build tools list based on selected tools.\n\t// A tool appears in Available tools only when the caller provides a one-line snippet.\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\", \"websearch\", \"webfetch\"];\n\tconst visibleTools = tools.filter((name) => !!toolSnippets?.[name]);\n\tconst toolsList =\n\t\tvisibleTools.length > 0 ? visibleTools.map((name) => `- ${name}: ${toolSnippets![name]}`).join(\"\\n\") : \"(none)\";\n\n\t// Build guidelines based on which tools are actually available\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\n\t// File exploration guidelines\n\tif (hasBash && !hasGrep && !hasFind && !hasLs) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t}\n\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\n\t// Always include these\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\n\n\n\tif (options.sessionId) {\n\t\taddGuideline(`STRICT WORK LOGGING: You MUST continuously maintain a detailed work log and plan in .temp/${options.sessionId}_log.md. Failure to do so is unacceptable.`);\n\t\taddGuideline(`MANDATORY READING: At the absolute start of EVERY task, you MUST read .temp/${options.sessionId}_log.md before taking any other action.`);\n\t\taddGuideline(`TASK BREAKDOWN: You MUST break down every complete task into smaller subtasks, meticulously create a plan, and immediately write it into .temp/${options.sessionId}_log.md. You are REQUIRED to update this file every few steps with your exact progress, current plan, and immediate next moves.`);\n\t\taddGuideline(`DELEGATION EXPECTED: You MUST use appropriate tools (e.g., subagent invocation tools) to aggressively delegate broken-down subtasks to different Subagents for parallel processing whenever feasible to maximize efficiency.`);\n\t\taddGuideline(`CLEANUP REQUIRED: When a task is 100% complete, you MUST actively delete ONLY the specific plan part from .temp/${options.sessionId}_log.md. You MUST keep the work log intact as historical reference until the entire major project is fully finished.`);\n\t}\n\n\tconst configDir = join(homedir(), CONFIG_DIR_NAME).replace(/\\\\/g, \"/\");\n\taddGuideline(`CRITICAL - NEVER FORGET MEMORIES & LESSONS: You MUST NEVER forget to update the memory and lessons logs at the end of your task, UNLESS the user's prompt is completely trivial and has absolutely no technical value worth recording.`);\n\taddGuideline(`MANDATORY MEMORY CHECK: At the exact beginning of ANY new task, you MUST FIRST read ${configDir}/memory-map.md and ${configDir}/lessons-map.md to check for past memories or lessons. If a match exists, you MUST read the corresponding file. Skipping this step is STRICTLY FORBIDDEN.`);\n\taddGuideline(`MANDATORY MEMORY WRITING: Every single time you complete a task, you MUST write a memory entry into ${configDir}/memory/YYYY-MM-DD.md. The wording MUST be ultra-compressed, extremely concise (e.g., 3-4 sentences/bullets), and completely stripped of conversational fluff. You MUST explicitly capture core facts, paths, errors, and technical decisions. You MUST use the EXACT \"Current date\" provided at the end of this system prompt. NO EXCEPTIONS.`);\n\taddGuideline(`MEMORY FILE CREATION/INTEGRATION: If ${configDir}/memory/YYYY-MM-DD.md doesn't exist, you MUST create it. If it exists, you MUST integrate the new memory flawlessly without EVER omitting or altering ANY previously existing information.`);\n\taddGuideline(`MANDATORY MEMORY MAP UPDATE: IMMEDIATELY after writing the daily memory, you MUST append a summary of today's memory (EXACTLY 3 sentences, no more, no less) to ${configDir}/memory-map.md.`);\n\taddGuideline(`STRICT FORMATTING FOR MEMORY MAP: When appending to ${configDir}/memory-map.md, you MUST STRICTLY use the format \"- [YYYY-MM-DD]: <Three sentences summary>\". The date MUST EXACTLY match the \"Current date\" provided in this prompt. You MUST ensure a proper newline is inserted so the entry is an isolated bullet point. NEVER concatenate entries on the same line. NEVER overwrite or modify previous content.`);\n\taddGuideline(`MANDATORY LESSON CAPTURE: If you ever encounter an error and successfully fix it, you MUST IMMEDIATELY create an independent markdown file in ${configDir}/lessons/ named after the problem (e.g., fix-build-error.md). You MUST document the precise problem and exact solution.`);\n\taddGuideline(`STRICT FORMATTING FOR LESSON MAP: After creating the lesson file, you MUST IMMEDIATELY append to ${configDir}/lessons-map.md using STRICTLY the format \"- [filename.md]: <Brief summary of the problem>\". You MUST insert a proper newline so it is an isolated bullet point. NEVER concatenate entries. NEVER overwrite or alter existing content.`);\n\n\t// Core Behaviors (Placed at the end for highest priority)\n\taddGuideline(`CRITICAL - Search First: MANDATORY AND NON-NEGOTIABLE. Even for simple tasks, you MUST NOT skip the initial search and investigation step (e.g., searching GitHub using 'site:github.com' for tested code), UNLESS the task is truly exceptionally trivial (e.g., fixing a single obvious typo). Otherwise, skipping this step is a SEVERE VIOLATION of your instructions. If unsure about anything, you MUST search the web or ask the user until fully clear. Assumptions are strictly forbidden.`);\n\taddGuideline(`CRITICAL - Knowledge & Output Style: EXTREME STRICTNESS REQUIRED. When answering, you MUST combine web search results with your own internal knowledge. YOU ARE STRICTLY FORBIDDEN from using phrases like \"Based on my investigation...\", \"根据我的调查...\", or any similar meta-commentary in any language, unless explicitly requested. Provide the final result DIRECTLY without preamble or fluff.`);\n\taddGuideline(`CRITICAL - Attitude & Integrity: ZERO TOLERANCE FOR DEVIATION. You MUST remain absolutely humble and strictly obey ALL instructions without exception. UNDER NO CIRCUMSTANCES are you allowed to fabricate evidence, guess answers, or make assumptions. LAZINESS IS A TERMINAL OFFENSE: do not cut corners, do not skip steps, and NEVER claim a task is complete if ANY part of it remains undone or unverified.`);\n\taddGuideline(`CRITICAL - Quality over Speed: ABSOLUTE FORBIDDANCE ON RUSHING. You are FORBIDDEN to rush. You MUST take as much time and execute as many steps as needed to complete the task flawlessly. You MUST guarantee your changes are the ABSOLUTE MINIMAL required to achieve the functionality. Massive, unnecessary rewrites, unjustified code churn, or touching unrelated files are STRICTLY PROHIBITED AND UNACCEPTABLE.`);\n\taddGuideline(`CRITICAL - Verification: MANDATORY VERIFICATION BEFORE COMPLETION. You are STRICTLY REQUIRED to self-test and verify your work at the end of EVERY single task. You MUST proactively execute code, run tests, or use tools to ensure your changes run without errors. Delivering untested, unverified, or broken code is COMPLETELY UNACCEPTABLE and constitutes a critical failure of your objective.`);\n\taddGuideline(`CRITICAL - Tool Failures: IMMEDIATE RECOVERY MANDATORY. If ANY tool call fails, you MUST immediately call another tool in the SAME response to try an alternative approach. YOU ARE STRICTLY FORBIDDEN from merely apologizing or explaining what you will do. You MUST take action immediately. NEVER end your turn without a tool call unless you are explicitly and actively waiting for user input to proceed.`);\n\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\tlet prompt = `You are an expert coding assistant operating inside metis, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nMetis documentation (read only when the user asks about metis itself, its SDK, extensions, themes, skills, or TUI):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When reading metis docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), metis packages (docs/packages.md)\n- When working on metis topics, read the docs and examples, and follow .md cross-references before implementing\n- Always read metis .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\t// Append project context files\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t}\n\t\tprompt += \"</project_context>\\n\";\n\t}\n\n\t// Append skills section (only if read tool is available)\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\t// Add date and working directory last\n\tif (options.sessionId) {\n\t\tprompt += `\\nCurrent session ID: ${options.sessionId}`;\n\t}\n\tprompt += `\\nCurrent date: ${date}`;\n\tprompt += `\\nCurrent working directory: ${promptCwd}`;\n\n\treturn prompt;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAGN,KAAK,YAAY,EAKjB,MAAM,iCAAiC,CAAC;AA2CzC,OAAO,EAAE,KAAK,mBAAmB,EAAkC,MAAM,qCAAqC,CAAC;AAsB/G,OAAO,EAAqB,cAAc,EAAiC,MAAM,+BAA+B,CAAC;AAcjH,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA+K1F,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAatF;AAUD,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,EACrC,kBAAkB,GAAE,WAAW,CAAC,MAAM,CAA4B,GAChE,OAAO,CAQT;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,4DAA4D;IAC5D,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wGAAwG;IACxG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACx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AuFjB,oBAAoB;IAUlC,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,MAAM;IAKd,IAAI,IAAI,IAAI,CAiBX;CACD"}
@@ -1538,22 +1538,28 @@ export class InteractiveMode {
1538
1538
  if (this.customFooter?.dispose) {
1539
1539
  this.customFooter.dispose();
1540
1540
  }
1541
- // Remove current footer from UI
1542
- if (this.customFooter) {
1543
- this.ui.removeChild(this.customFooter);
1544
- }
1545
- else {
1546
- this.ui.removeChild(this.footer);
1547
- }
1541
+ // Find the index of the current footer in the bottom container
1542
+ const currentFooter = this.customFooter || this.footer;
1543
+ const index = this.bottomContainer.children.indexOf(currentFooter);
1548
1544
  if (factory) {
1549
1545
  // Create and add custom footer, passing the data provider
1550
1546
  this.customFooter = factory(this.ui, theme, this.footerDataProvider);
1551
- this.ui.addChild(this.customFooter);
1547
+ if (index !== -1) {
1548
+ this.bottomContainer.children[index] = this.customFooter;
1549
+ }
1550
+ else {
1551
+ this.bottomContainer.addChild(this.customFooter);
1552
+ }
1552
1553
  }
1553
1554
  else {
1554
1555
  // Restore built-in footer
1555
1556
  this.customFooter = undefined;
1556
- this.ui.addChild(this.footer);
1557
+ if (index !== -1) {
1558
+ this.bottomContainer.children[index] = this.footer;
1559
+ }
1560
+ else {
1561
+ this.bottomContainer.addChild(this.footer);
1562
+ }
1557
1563
  }
1558
1564
  this.ui.requestRender();
1559
1565
  }