/** * HTTP route bridge — 跨模块共享公网 baseUrl 自动检测。 * * v5.7.24 起简化:只做 baseUrl 自动检测,不再做 sub-route dispatch。 * * 背景:v5.7.23 把 bot-share 挂在 dashboard 的 `/plugins/enhance` prefix route 下, * 通过 bridge dispatch 子路径——后来发现 SDK 的 overlap 规则只检查 `${prefix}/` 形式, * 所以 `/plugins/enhance-share`(兄弟 prefix)跟 `/plugins/enhance` **不算 overlap**, * bot-share 可以直接注册自己独立的 prefix route。SubRoute dispatch 不再需要。 * * 但 baseUrl 检测仍要从 dashboard 请求里抓——dashboard 是用户最常访问的入口; * 任何 `/plugins/enhance*` / `/plugins/enhance-share/*` 请求都顺手喂 detect 函数。 * * 红线:纯只读 in-memory,零 child_process / fs 写。 */ import type { IncomingMessage } from "node:http"; /** dashboard / share handler 顶部都调一下:从请求头抽公网 baseUrl 缓存住。 */ export declare function detectBaseUrlFromRequest(req: IncomingMessage): void; /** 工具运行时调用:env > 配置 > 检测到的 external > internal > fallback */ export declare function resolveBaseUrl(opts: { configBaseUrl?: string; envName?: string; fallback?: string; }): string; /** 测试/调试 */ export declare function _resetBridge(): void; export declare function getDetectionState(): { external: string | null; internal: string | null; };