From aba72c6cf892225efecbe099f16561da3b023bb1 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 2 Jul 2026 21:11:36 +0800 Subject: [PATCH] Route WeChat publish URLs through facade --- wechat-mp.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wechat-mp.mjs b/wechat-mp.mjs index 41f5304..8f36a0c 100644 --- a/wechat-mp.mjs +++ b/wechat-mp.mjs @@ -8,7 +8,7 @@ import { reconcileAgentSession } from './session-reconcile.mjs'; import { isScheduleIntent, parseScheduleIntent, shouldUseScheduleAssistant } from './schedule-intent.mjs'; import { materializeMissingPublicHtmlWrites } from './mindspace-public-finish-sync.mjs'; import { buildCurrentTimeAgentPrefix } from './user-memory-profile.mjs'; -import { PUBLISH_ROOT_DIR } from './user-publish.mjs'; +import { buildPublicUrl, PUBLISH_ROOT_DIR } from './user-publish.mjs'; import { buildAutoChatSkillPrefix } from './chat-skills.mjs'; import { downloadTemporaryMedia, persistWechatImage } from './wechat-media.mjs'; import { buildAckText } from './wechat/ack/ack-provider.mjs'; @@ -431,7 +431,7 @@ function isMissingRequiredPublishSkill(reply, intent) { function buildPublicHtmlUrl(workingDir, relativePath, publicBaseUrl) { const owner = path.basename(path.resolve(workingDir)); const normalized = relativePath.split(path.sep).map(encodeURIComponent).join('/'); - return `${String(publicBaseUrl ?? '').replace(/\/+$/, '')}/${PUBLISH_ROOT_DIR}/${encodeURIComponent(owner)}/${normalized}`; + return buildPublicUrl(publicBaseUrl, owner, normalized); } function ensurePublicHtmlArtifact(htmlPath, workingDir) {