mindspace: close authority boundaries

This commit is contained in:
john
2026-07-27 15:34:35 +08:00
parent dfab78c75a
commit e94052ff24
78 changed files with 11962 additions and 2162 deletions
@@ -8,7 +8,6 @@ import {
sendMindSpaceRybbitEvent,
} from '../mindspace-rybbit.mjs';
import { createPageEditSessionService } from '../mindspace-page-edit-session.mjs';
import { resolveMindSpaceRuntimeConfig } from '../mindspace-runtime-config.mjs';
import { createNotificationDispatcher } from '../notification-dispatcher.mjs';
import { startScheduleReminderWorker } from '../schedule-reminder-worker.mjs';
import { isPassiveCanaryRuntime } from './portal-runtime-role.mjs';
@@ -20,7 +19,7 @@ export async function bootstrapPortalIntegrationServices({
env = process.env,
usersRoot,
wechatMpConfig,
authPool,
mindSpacePublicFinish,
userAuth,
sessionAccess,
tkmindProxy,
@@ -39,8 +38,6 @@ export async function bootstrapPortalIntegrationServices({
mindSpacePageLiveEdit,
logger = console,
loadWechatMpModuleFn = loadWechatMpModule,
resolveMindSpaceRuntimeConfigFn =
resolveMindSpaceRuntimeConfig,
resolveAnalyticsOwnerSegmentFn =
resolveAnalyticsOwnerSegment,
resolveAnalyticsOwnerLabelFn =
@@ -78,17 +75,21 @@ export async function bootstrapPortalIntegrationServices({
config: wechatMpConfig,
userAuth,
sessionAccess,
pageDataFinishGuard: authPool
? {
pool: authPool,
h5Root,
storageRoot:
resolveMindSpaceRuntimeConfigFn(
h5Root,
env,
).storageRoot,
}
: null,
htmlDeliveryAuthority:
typeof mindSpacePublicFinish
?.prepareWechatHtmlDelivery ===
'function' &&
typeof mindSpacePublicFinish
?.ensureWechatFreshPageThumbnails ===
'function'
? mindSpacePublicFinish
: null,
pageDataFinishGuard:
typeof mindSpacePublicFinish
?.prepareWechatPageDataDelivery ===
'function'
? mindSpacePublicFinish
: null,
apiFetch: tkmindProxy.apiFetch,
startAgentSession: ({
userId,