get_web_url: forzar HTTP en forge + documentar ?pruebas=1 obligatorio
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,10 +4,10 @@ This is an Acai CMS website project. Follow these instructions when working with
|
|||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
- The site runs in Docker. The development URL is provided via `ACAI_WEB_URL` environment variable (e.g. `https://username_domain.forge.acaisuite.com/`)
|
- The site runs in Docker. **Before using fetch or Playwright, call the `get_web_url` tool** to get the correct development URL. Never hardcode or guess URLs.
|
||||||
- **Before using fetch or Playwright, call the `get_web_url` tool** to get the correct development URL. Never hardcode or guess URLs.
|
- **ALWAYS append `?pruebas=1`** to any URL you visit (e.g. `http://.../?pruebas=1`). This query param is required to view the site in development mode.
|
||||||
- **NEVER navigate to the production domain** (e.g. `keepsailing.es`, `tienda.com`). The production site is NOT your development environment.
|
- **NEVER navigate to the production domain** (e.g. `keepsailing.es`, `tienda.com`). The production site is NOT your development environment.
|
||||||
- **NEVER use localhost:8080** — that does not resolve in this environment.
|
- **NEVER use localhost:8080 or https://** — use HTTP (not HTTPS) with the URL from `get_web_url`.
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
|
|||||||
@@ -20,14 +20,20 @@ export function registerGetWebUrlTool(server) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inside Docker, HTTPS is not available — force HTTP for internal requests
|
||||||
|
let webUrl = credentials.web_url;
|
||||||
|
if (webUrl && webUrl.startsWith("https://") && webUrl.includes(".forge.")) {
|
||||||
|
webUrl = webUrl.replace("https://", "http://");
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: [{
|
content: [{
|
||||||
type: "text",
|
type: "text",
|
||||||
text: JSON.stringify({
|
text: JSON.stringify({
|
||||||
web_url: credentials.web_url,
|
web_url: webUrl,
|
||||||
api_web_url: credentials.api_web_url || null,
|
api_web_url: credentials.api_web_url || null,
|
||||||
website: credentials.website || null,
|
website: credentials.website || null,
|
||||||
note: "Always use web_url for Playwright/fetch. Never use the production domain directly.",
|
note: "Always use web_url for Playwright/fetch. IMPORTANT: Always append ?pruebas=1 to any URL you visit (e.g. web_url + '/?pruebas=1' or web_url + '/servicios/?pruebas=1'). Never use the production domain directly.",
|
||||||
})
|
})
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user