feat(agent): implement local image handling and enhance generated image integration in canvas

This commit is contained in:
HouYunFei
2026-07-29 17:19:20 +08:00
parent 7a48f441cf
commit 2afe2f3898
6 changed files with 71 additions and 5 deletions
+2 -1
View File
@@ -61,7 +61,8 @@ function initializeWorkspace(workspacePath: string) {
if (initializedWorkspaces.has(workspacePath)) return;
fs.mkdirSync(workspacePath, { recursive: true });
const instructionsFile = path.join(workspacePath, "AGENTS.md");
if (!fs.existsSync(instructionsFile)) fs.writeFileSync(instructionsFile, AGENT_PROMPT);
const current = fs.existsSync(instructionsFile) ? fs.readFileSync(instructionsFile, "utf8") : "";
if (!current || current.startsWith("# Infinite Canvas Agent")) fs.writeFileSync(instructionsFile, AGENT_PROMPT);
initializedWorkspaces.add(workspacePath);
}