cambios mcp remoto

This commit is contained in:
Jordan Diaz
2026-04-17 20:03:02 +00:00
parent d41a94b57d
commit 2ac01acd61
15 changed files with 344 additions and 123 deletions

View File

@@ -6,6 +6,7 @@ import { handleToolError, validateRequired, handleApiResponse } from "../helpers
import { withAuthParams } from "../helpers/authSchema.js";
import { AcaiHttpClient } from "../helpers/acaiHttpClient.js";
import { pythonPost } from "../helpers/pythonServerClient.js";
import { resolveCurrentProjectDir } from "../files/helpers.js";
/**
* Helper: POST to mcp_respond.php via viewer_functions.php
@@ -78,7 +79,7 @@ async function resolveLocalImageAsBase64(imageUrl) {
}
// Intento B: resolver el pathname contra ACAI_PROJECT_DIR y leer del disco
const projectDir = process.env.ACAI_PROJECT_DIR || "";
const projectDir = resolveCurrentProjectDir();
if (projectDir && parsed.pathname) {
try {
const localPath = path.join(projectDir, parsed.pathname);
@@ -118,7 +119,7 @@ export function registerUploadRecordImageTool(server) {
);
if (validationError) return validationError;
const projectSlug = path.basename(process.env.ACAI_PROJECT_DIR || "");
const projectSlug = path.basename(resolveCurrentProjectDir());
// Intentar via Python server (tiene sync + optimizacion)
let result;