@imenam/mcp-documentor 1.0.76 → 1.0.77

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.
@@ -32,6 +32,13 @@ const dataDir = process.env.MCP_DATA_DIR?.trim() || path.join(rootDir, ".docs-da
32
32
  const staticRoot = path.join(rootDir, "gui/dist");
33
33
  const absoluteStaticRoot = path.resolve(staticRoot);
34
34
  const configuredAppPath = process.env.APP_PATH || "/documentor-gui";
35
+ /**
36
+ * Chemin réellement monté par le proxy. Il peut différer de `configuredAppPath`
37
+ * quand `APP_PATH_PREFIX` est défini : le client partagé préfixe alors le chemin
38
+ * naturel et renvoie le chemin final dans `result.path`. Le `<base href>` doit
39
+ * suivre ce chemin, sinon les assets de la SPA sont demandés au mauvais endroit.
40
+ */
41
+ let effectiveAppPath = configuredAppPath;
35
42
  function resolveGuiMode() {
36
43
  const proxyUrl = process.env.PROXY_URL?.trim();
37
44
  if (proxyUrl)
@@ -567,7 +574,7 @@ app.get("/api/export-zip/:id", async (c) => {
567
574
  docId = ref;
568
575
  }
569
576
  else {
570
- zip.file(`${ref}.md`, `# [Unqualified doc reference: ${ref} — no project given]
577
+ zip.file(`${ref}.md`, `# [Unqualified doc reference: ${ref} — no project given]
571
578
  `);
572
579
  continue;
573
580
  }
@@ -732,7 +739,7 @@ app.get("/*", (c, next) => {
732
739
  // ?__pdf=1 : accès direct depuis Puppeteer — pas de préfixe proxy dans <base href>
733
740
  // En mode standalone la GUI est déjà servie à la racine : même règle.
734
741
  const isPdfRender = c.req.query('__pdf') === '1';
735
- const baseHref = isStandalone || isPdfRender ? '/' : getHtmlBaseHref(configuredAppPath);
742
+ const baseHref = isStandalone || isPdfRender ? '/' : getHtmlBaseHref(effectiveAppPath);
736
743
  const html = fs
737
744
  .readFileSync(indexPath, "utf8")
738
745
  .replace("<head>", `<head>\n <base href="${baseHref}" />`);
@@ -800,8 +807,7 @@ async function startServer() {
800
807
  try {
801
808
  // APP_GROUP place la GUI dans une section repliable du proxy (facultatif).
802
809
  const registerOptions = { path: appPath, name: appName, group: process.env.APP_GROUP };
803
- // Second arg: fallbackPort (required by published @imenam/mcp-gui-interface API); unused when proxy assigns the port.
804
- result = await proxyClient.register(registerOptions, 0);
810
+ result = await proxyClient.register(registerOptions);
805
811
  }
806
812
  catch (e) {
807
813
  process.stderr.write('[GUI] Enregistrement proxy échoué — arrêt.\n');
@@ -827,7 +833,8 @@ async function startServer() {
827
833
  }
828
834
  const finalPort = result.port;
829
835
  localPort = finalPort;
830
- const publicUrl = result.url || `${proxyUrl}${appPath}`;
836
+ effectiveAppPath = result.path ?? appPath;
837
+ const publicUrl = result.url || `${proxyUrl}${effectiveAppPath}`;
831
838
  guiPublicUrl = publicUrl;
832
839
  logger.info(`Registered with proxy. Public URL: ${publicUrl}, Local Port: ${finalPort}`);
833
840
  const cleanupProxy = async () => {
@@ -1 +1 @@
1
- export declare const APP_VERSION = "1.0.76";
1
+ export declare const APP_VERSION = "1.0.77";
@@ -1,2 +1,2 @@
1
1
  // Auto-generated version file - do not edit manually
2
- export const APP_VERSION = '1.0.76';
2
+ export const APP_VERSION = '1.0.77';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imenam/mcp-documentor",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "main": "dist/src/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",