@tbox.cn/app-module-mall-core 0.3.4 → 0.3.5

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.
package/AGENTS.md ADDED
@@ -0,0 +1,9 @@
1
+ # module-mall-core —— 集成指引(AI 助手用)
2
+
3
+ 本模块为商圈基础域(scope 域装配、mall-info 工具、家页形态 home 槽主屏)。平台服务槽
4
+ (mall.info / auth.alipay-login)的接入语义与边界见本包 `INTEGRATION.md`(真源)。
5
+
6
+ ## 自定义服务集成
7
+
8
+ 见本包 `INTEGRATION.md`;实施落点与流程见应用根 `INTEGRATION.md` 与
9
+ `packages/provider-custom/INTEGRATION.md`。
package/INTEGRATION.md ADDED
@@ -0,0 +1,24 @@
1
+ # INTEGRATION —— module-mall-core(商圈基础)接入指引
2
+
3
+ > 本模块 owns 两个**平台服务槽**:`mall.info`(商场信息)与 `auth.alipay-login`(登录
4
+ > 换码);自身不消费业务槽。「应用维度」自定义 API 接入(owns 并集)会覆盖 `mall.info`。
5
+
6
+ ## mall.info(可自定义接入)
7
+
8
+ - 商场名称/地址/坐标等动态信息源——自定义 API 可承接(无真实端点的厂商以实例 config
9
+ 数据兜底是既有先例)。
10
+ - 消费方:客服联系电话解析、导购附近商场数据源、家页信息面。
11
+
12
+ ## auth.alipay-login(不适用自定义 API 内联流程——边界声明)
13
+
14
+ - 登录换码走 **provider 包换码器注册链**(`ctx.authExchanges.register`,scoped 候选 +
15
+ 兜底厂商)——**不是** adapter 工厂注册,**不要**对本槽落内联声明(运行时按
16
+ `resolveLoginExchange` transport 级解析,与 `resolveService` adapter 表不同轴)。
17
+ - 装配时序约束:登录槽绑定的 provider 必须已装配对应 provider 包——漏装时 scoped 谓词
18
+ 不在场,登录落内置 alipay(未配凭据 → 503 显性降级)。
19
+
20
+ ## 关联配置面
21
+
22
+ - 碰一下 banner 数据面(`/api/m/mall-core/bumpin-banner`)与
23
+ module-alipay-activity 共享 `config/bumpin.json` 配置单例——接入见该模块 INTEGRATION.md。
24
+ - 本模块 register 期向 alipay-activity 注入 bumpin 配置路径(`configureAlipayBumpIn`)。
@@ -180,7 +180,7 @@ function bindMallInfoContext(ctx) {
180
180
  var mallInfoTool = createTool({
181
181
  id: "mall-info",
182
182
  description: "\u67E5\u8BE2\u5546\u573A\u57FA\u672C\u4FE1\u606F\uFF08\u540D\u79F0/\u5730\u5740/\u7ECF\u7EAC\u5EA6\uFF09\u3002\u7528\u6237\u95EE\u67D0\u5546\u573A\u53EB\u4EC0\u4E48\u3001\u5728\u54EA\u513F\u3001\u5730\u5740\u65F6\u8C03\u7528\uFF1B\u5F53\u524D\u4F1A\u8BDD\u5546\u573A ID \u53EF\u4ECE mall-info \u6CE8\u5165\u5757\u53D6\u3002",
183
- // D11 参数规范:纯 string(preTool decide 注入 / 模型直传入参)
183
+ // 参数规范:纯 string(preTool decide 注入 / 模型直传入参)
184
184
  inputSchema: z.object({ mallId: z.string().describe("\u5546\u573A ID") }),
185
185
  // 无 outputSchema:可选字段动态形状(对齐 mall-context;出卡工具建议省略的约定此处同理由)
186
186
  execute: async (input) => {
@@ -389,7 +389,7 @@ function createMallHomeRouter(ctx) {
389
389
  }
390
390
  const reqCtxWithMall = withMallScopeFromQuery(authCtx, req.query, { miniAppId: mallMiniAppId });
391
391
  const [memberResult, parkingResult] = await Promise.allSettled([
392
- // 会员积分(W3-3 服务化消费:member.snapshot 工厂缺席 = member 模块未装 → null,
392
+ // 会员积分(服务化消费:member.snapshot 工厂缺席 = member 模块未装 → null,
393
393
  // 与迁移前 loader null 同语义;工厂执行失败 → null——与迁移前端口 resolve 失败同语义)
394
394
  (async () => {
395
395
  const memberStartedAt = Date.now();
@@ -417,7 +417,7 @@ function createMallHomeRouter(ctx) {
417
417
  enrollUrl: port.enrollUrl || null
418
418
  };
419
419
  })(),
420
- // 停车车辆(W3-3 服务化消费:parking.snapshot 工厂;缺席 → unavailable,执行失败 → error)
420
+ // 停车车辆(服务化消费:parking.snapshot 工厂;缺席 → unavailable,执行失败 → error)
421
421
  (async () => {
422
422
  const parkingStartedAt = Date.now();
423
423
  const factory = ctx.resolveService(PARKING_SNAPSHOT_SERVICE);
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  resolveMallInfo,
10
10
  resolveMallScopeAssembly,
11
11
  serverModule
12
- } from "./chunk-K5KNIRJD.js";
12
+ } from "./chunk-X2O2MNNU.js";
13
13
  import {
14
14
  clientModule
15
15
  } from "./chunk-FATH6I75.js";
@@ -9,7 +9,7 @@ export { MallScopeAssembly } from '@tbox.cn/app-contracts-mall';
9
9
  import { Router } from 'express';
10
10
 
11
11
  /**
12
- * mall 域装配(单一模板统一化 W3-1):register 期注册于 `ctx.domainAssemblies`
12
+ * mall 域装配(单一模板统一化):register 期注册于 `ctx.domainAssemblies`
13
13
  * (SCOPE_ASSEMBLY_KIND),全部消费点运行期惰性查表——模板 app.ts 域语义清零。
14
14
  *
15
15
  * 自 mall 模板 app.ts 装配段 + config/deployment.ts 迁入(语义逐字保留):
@@ -38,7 +38,7 @@ declare function resolveMallScopeAssembly(ctx: ServerContext): MallScopeAssembly
38
38
  declare function createScopeAssembly(raw: IntegrationsRaw | undefined, ctx: ServerContext): MallScopeAssembly | undefined;
39
39
  /**
40
40
  * 016:默认商圈 HELLO context(无 URL 参数访问时的服务端兜底)。
41
- * v4 mallId-only 注入(D8/D9):miniAppId 是尽力回填的展示值,非会话边界——
41
+ * v4 mallId-only 注入(/):miniAppId 是尽力回填的展示值,非会话边界——
42
42
  * 读源统一经 resolveMallMiniAppId 单点;双缺不再阻断注入(此前 warn-refuse 会造成
43
43
  * 默认商圈静默失效),按 mallId-only 注入。缺省 defaultMallId → undefined(不兜底)。
44
44
  */
@@ -47,13 +47,13 @@ declare function buildDefaultMallContext(controlPlane: MallDeploymentControlPlan
47
47
  /**
48
48
  * 商场基础信息缓存(mall.info 槽消费方;动态商场信息源)。
49
49
  *
50
- * 自 mall 模板 config/mall-info.ts 迁入(单一模板统一化 W3-1;语义逐字保留)。
50
+ * 自 mall 模板 config/mall-info.ts 迁入(单一模板统一化 ;语义逐字保留)。
51
51
  *
52
52
  * 职责:
53
53
  * - cachedMallName:withMallName 同步回退通道(会话建立后 mallName 直接回显)
54
54
  * - resolveMallInfo:缓存 → single-flight → mall.info 槽拉取;失败/未知 → undefined(fail-soft)
55
55
  *
56
- * 缓存纪律(S1 DoS 加固):
56
+ * 缓存纪律(DoS 加固):
57
57
  * - 正缓存 TTL 30min(plaza 信息低频变更)
58
58
  * - 负缓存 TTL 5min(垃圾/拉取失败 ID 防重复打上游)
59
59
  * - LRU 封顶 1024(Map 插入序近似,可接受)
@@ -77,7 +77,7 @@ declare const mallInfoTool: _tbox_cn_app_agent_sdk_server.Tool<{
77
77
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-info", unknown>;
78
78
 
79
79
  /**
80
- * 模块前置工具声明(010 声明式通道;自 mall 模板 pre-tools.ts 迁入——单一模板统一化 W3-1)。
80
+ * 模块前置工具声明(010 声明式通道;自 mall 模板 pre-tools.ts 迁入——单一模板统一化)。
81
81
  *
82
82
  * mall-info —— 商场基本信息每轮背景注入(mall-context 同款三件套,2026-09-14):
83
83
  * always + decide 自 mallSlot.read(attributes) 注入 mallId(B3 入参化——dedup 键随
@@ -94,7 +94,7 @@ declare const preTools: {
94
94
 
95
95
  /**
96
96
  * 商圈首页路由(/api/m/mall-core/* 四端点:config / linked-panel / nearby-mall / bumpin-banner;
97
- * 自 mall 模板 app.ts 端点迁入——单一模板统一化 W3-2;2026-09-20 随 module-mall-home 并入本包,
97
+ * 自 mall 模板 app.ts 端点迁入——单一模板统一化 ;2026-09-20 随 module-mall-home 并入本包,
98
98
  * 路由命名空间同步更名 /api/m/mall-home/* → /api/m/mall-core/*)。
99
99
  *
100
100
  * - 时序契约:ctx.routes.mount() 挂载于 app 的 /api/m(先于 createPlatformApiRouter 的 /api 404 兜底,
@@ -204,17 +204,17 @@ declare const serverModule: {
204
204
  parkedMinutes: zod.ZodOptional<zod.ZodNumber>;
205
205
  }, "strip", zod.ZodTypeAny, {
206
206
  status: "ready";
207
- primaryPlate: string;
208
207
  plateCount: number;
209
- parkedPlates?: string[] | undefined;
208
+ primaryPlate: string;
210
209
  freeMinutesRemaining?: number | undefined;
210
+ parkedPlates?: string[] | undefined;
211
211
  parkedMinutes?: number | undefined;
212
212
  }, {
213
213
  status: "ready";
214
- primaryPlate: string;
215
214
  plateCount: number;
216
- parkedPlates?: string[] | undefined;
215
+ primaryPlate: string;
217
216
  freeMinutesRemaining?: number | undefined;
217
+ parkedPlates?: string[] | undefined;
218
218
  parkedMinutes?: number | undefined;
219
219
  }>, zod.ZodObject<{
220
220
  status: zod.ZodLiteral<"unavailable">;
@@ -245,34 +245,34 @@ declare const serverModule: {
245
245
  progressUnit: zod.ZodOptional<zod.ZodString>;
246
246
  }, "strip", zod.ZodTypeAny, {
247
247
  title: string;
248
- progressStyle?: "bar" | "steps" | undefined;
249
248
  totalProgress?: string | undefined;
250
249
  currentProgress?: string | undefined;
251
250
  progressUnit?: string | undefined;
251
+ progressStyle?: "steps" | "bar" | undefined;
252
252
  }, {
253
253
  title: string;
254
- progressStyle?: "bar" | "steps" | undefined;
255
254
  totalProgress?: string | undefined;
256
255
  currentProgress?: string | undefined;
257
256
  progressUnit?: string | undefined;
257
+ progressStyle?: "steps" | "bar" | undefined;
258
258
  }>;
259
259
  }, "strip", zod.ZodTypeAny, {
260
260
  status: "ready";
261
261
  banner: {
262
262
  title: string;
263
- progressStyle?: "bar" | "steps" | undefined;
264
263
  totalProgress?: string | undefined;
265
264
  currentProgress?: string | undefined;
266
265
  progressUnit?: string | undefined;
266
+ progressStyle?: "steps" | "bar" | undefined;
267
267
  };
268
268
  }, {
269
269
  status: "ready";
270
270
  banner: {
271
271
  title: string;
272
- progressStyle?: "bar" | "steps" | undefined;
273
272
  totalProgress?: string | undefined;
274
273
  currentProgress?: string | undefined;
275
274
  progressUnit?: string | undefined;
275
+ progressStyle?: "steps" | "bar" | undefined;
276
276
  };
277
277
  }>, zod.ZodObject<{
278
278
  status: zod.ZodLiteral<"unauthenticated">;
@@ -329,10 +329,10 @@ declare const serverModule: {
329
329
  status: "empty";
330
330
  } | {
331
331
  status: "ready";
332
- primaryPlate: string;
333
332
  plateCount: number;
334
- parkedPlates?: string[] | undefined;
333
+ primaryPlate: string;
335
334
  freeMinutesRemaining?: number | undefined;
335
+ parkedPlates?: string[] | undefined;
336
336
  parkedMinutes?: number | undefined;
337
337
  } | {
338
338
  status: "unavailable";
@@ -345,10 +345,10 @@ declare const serverModule: {
345
345
  status: "ready";
346
346
  banner: {
347
347
  title: string;
348
- progressStyle?: "bar" | "steps" | undefined;
349
348
  totalProgress?: string | undefined;
350
349
  currentProgress?: string | undefined;
351
350
  progressUnit?: string | undefined;
351
+ progressStyle?: "steps" | "bar" | undefined;
352
352
  };
353
353
  } | {
354
354
  status: "unauthenticated";
@@ -359,9 +359,9 @@ declare const serverModule: {
359
359
  } | {
360
360
  status: "error";
361
361
  };
362
+ enrollUrl?: string | null | undefined;
362
363
  mallName?: string | undefined;
363
364
  showDevServices?: boolean | undefined;
364
- enrollUrl?: string | null | undefined;
365
365
  }, {
366
366
  member: {
367
367
  status: "loading";
@@ -392,10 +392,10 @@ declare const serverModule: {
392
392
  status: "empty";
393
393
  } | {
394
394
  status: "ready";
395
- primaryPlate: string;
396
395
  plateCount: number;
397
- parkedPlates?: string[] | undefined;
396
+ primaryPlate: string;
398
397
  freeMinutesRemaining?: number | undefined;
398
+ parkedPlates?: string[] | undefined;
399
399
  parkedMinutes?: number | undefined;
400
400
  } | {
401
401
  status: "unavailable";
@@ -408,10 +408,10 @@ declare const serverModule: {
408
408
  status: "ready";
409
409
  banner: {
410
410
  title: string;
411
- progressStyle?: "bar" | "steps" | undefined;
412
411
  totalProgress?: string | undefined;
413
412
  currentProgress?: string | undefined;
414
413
  progressUnit?: string | undefined;
414
+ progressStyle?: "steps" | "bar" | undefined;
415
415
  };
416
416
  } | {
417
417
  status: "unauthenticated";
@@ -422,9 +422,9 @@ declare const serverModule: {
422
422
  } | {
423
423
  status: "error";
424
424
  };
425
+ enrollUrl?: string | null | undefined;
425
426
  mallName?: string | undefined;
426
427
  showDevServices?: boolean | undefined;
427
- enrollUrl?: string | null | undefined;
428
428
  }>>;
429
429
  };
430
430
  preTools: {
@@ -10,7 +10,7 @@ import {
10
10
  resolveMallScopeAssembly,
11
11
  serverModule,
12
12
  server_default
13
- } from "../chunk-K5KNIRJD.js";
13
+ } from "../chunk-X2O2MNNU.js";
14
14
  export {
15
15
  bindMallInfoContext,
16
16
  buildDefaultMallContext,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-mall-core",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "description": "商圈基础模块:scope 域装配注册 + mall-info 工具链 + mall-directory 服务 + 首页主屏(home 槽 / 联单面板 / 会员停车快览)+ 首页预览卡。",
6
6
  "exports": {
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@tbox.cn/app-contracts": "0.12.3",
23
- "@tbox.cn/app-contracts-mall": "0.12.3",
24
- "@tbox.cn/app-agent-sdk-client": "0.1.3",
25
- "@tbox.cn/app-agent-sdk-server": "0.1.4"
23
+ "@tbox.cn/app-contracts-mall": "0.12.4",
24
+ "@tbox.cn/app-agent-sdk-client": "0.1.4",
25
+ "@tbox.cn/app-agent-sdk-server": "0.2.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "18.3.1",
@@ -56,7 +56,9 @@
56
56
  "tsconfig.json",
57
57
  "tsup.config.ts",
58
58
  "README.md",
59
- "LICENSE"
59
+ "LICENSE",
60
+ "AGENTS.md",
61
+ "INTEGRATION.md"
60
62
  ],
61
63
  "engines": {
62
64
  "node": ">=20.0.0"
@@ -18,7 +18,7 @@ const BUMPIN_CARD_TYPE = 'promotion-bumpin-activity';
18
18
  export const BumpInActivityChatCard: CardComponent = (props) => {
19
19
  const triggerRef = useRef<HTMLButtonElement>(null);
20
20
  const [detailOrigin, setDetailOrigin] = useState<SurfaceRect | null>(null);
21
- // W3-2:原始注册表经 kit context 读取(组合层覆盖 → 原始形态单向,防嵌套)
21
+ // 原始注册表经 kit context 读取(组合层覆盖 → 原始形态单向,防嵌套)
22
22
  const rawCards = useChatRawCards();
23
23
  const Base = (rawCards as Record<string, CardComponent | undefined>)[BUMPIN_CARD_TYPE];
24
24
  const { data, cardId, isHistory, actionTokens } = props;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 商圈主屏运行时纯函数(014 T6):空态判定、支付联单进度与滚动控制。
2
+ * 商圈主屏运行时纯函数:空态判定、支付联单进度与滚动控制。
3
3
  * 纯函数便于单测;与组件层解耦(组件只读状态,不在这里持有)。
4
4
  */
5
5
  import type { TboxCardPayload } from '@tbox.cn/app-contracts';
@@ -1,7 +1,7 @@
1
1
  /**
2
- * home 槽渲染(单一模板统一化 W2-5 换装,过渡形态):
2
+ * home 槽渲染(单一模板统一化 换装,过渡形态):
3
3
  * 商圈主屏 + 会员门禁浮层自持段——自 pages/index/index.tsx 域段原样抽取。
4
- * W3-2 收口 ctx.slots.register('home', ...);2026-09-20 随 module-mall-home 并入本包。
4
+ * 收口 ctx.slots.register('home', ...);2026-09-20 随 module-mall-home 并入本包。
5
5
  *
6
6
  * slot 值 = 自持渲染函数(kit ChatPage 恒挂载;域自持数据加载/门禁状态机/浮层显隐)。
7
7
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * mall 域装配(单一模板统一化 W3-1):register 期注册于 `ctx.domainAssemblies`
2
+ * mall 域装配(单一模板统一化):register 期注册于 `ctx.domainAssemblies`
3
3
  * (SCOPE_ASSEMBLY_KIND),全部消费点运行期惰性查表——模板 app.ts 域语义清零。
4
4
  *
5
5
  * 自 mall 模板 app.ts 装配段 + config/deployment.ts 迁入(语义逐字保留):
@@ -29,7 +29,7 @@ import { cachedMallName, resolveMallInfo } from './mall-info-cache.js';
29
29
 
30
30
  const deploymentLogger = createLogger('DEPLOYMENT');
31
31
 
32
- /** D1 enhanceContext 预热上界(2s 有界;后台继续补缓存) */
32
+ /** enhanceContext 预热上界(2s 有界;后台继续补缓存) */
33
33
  const WARM_TIMEOUT_MS = 2000;
34
34
 
35
35
  /** 无声明兜底常量(冻结共享——stub registry 路径 ref 稳定,投影缓存同样命中) */
@@ -43,7 +43,7 @@ interface ProjectedAssembly {
43
43
  }
44
44
 
45
45
  /**
46
- * mall 域装配形状 = TIER1 契约 MallScopeAssembly(W3-3 下沉 contracts-mall:
46
+ * mall 域装配形状 = TIER1 契约 MallScopeAssembly(下沉 contracts-mall:
47
47
  * 同包消费方(家页面 routes 等)按契约类型查表——装配点与消费端零重复实现)。
48
48
  */
49
49
  export type { MallScopeAssembly } from '@tbox.cn/app-contracts-mall';
@@ -138,7 +138,7 @@ export function createScopeAssembly(
138
138
 
139
139
  /**
140
140
  * mall miniAppId 读源单点:root config.miniAppId 优先 → 参考表按 mallId 查;双缺 → undefined。
141
- * 软依赖契约(v4 D9):miniAppId 是尽力回填的展示/定位值,非会话边界——双缺由调用方按
141
+ * 软依赖契约(v4):miniAppId 是尽力回填的展示/定位值,非会话边界——双缺由调用方按
142
142
  * mallId-only 降级(消费点自补语义,见 contracts-mall createMallContextValidator 注释)。
143
143
  * 严禁任何假值注入(09-01 事故防线:回退假字面量致真实档业务槽验签 appId 恒假 → 网关 401)。
144
144
  */
@@ -152,7 +152,7 @@ export function resolveMallMiniAppId(
152
152
 
153
153
  /**
154
154
  * 016:默认商圈 HELLO context(无 URL 参数访问时的服务端兜底)。
155
- * v4 mallId-only 注入(D8/D9):miniAppId 是尽力回填的展示值,非会话边界——
155
+ * v4 mallId-only 注入(/):miniAppId 是尽力回填的展示值,非会话边界——
156
156
  * 读源统一经 resolveMallMiniAppId 单点;双缺不再阻断注入(此前 warn-refuse 会造成
157
157
  * 默认商圈静默失效),按 mallId-only 注入。缺省 defaultMallId → undefined(不兜底)。
158
158
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * module-mall-core 服务端入口(单一模板统一化 W3-1;2026-09-20 随 module-mall-home 并入:
2
+ * module-mall-core 服务端入口(首页面四端点 + bumpin 配置面注入自本包注册;
3
3
  * 首页面四端点 + bumpin 配置面注入自本包 server/index.ts 同源注册):
4
4
  * 域装配注册(ctx.domainAssemblies → SCOPE_ASSEMBLY_KIND)+ mall-info 工具/缓存/preTool +
5
5
  * mall-directory 服务 + /api/m/mall-core/* 首页路由。
@@ -67,13 +67,13 @@ export const serverModule = {
67
67
  // mall-info 工具上下文绑定(execute 惰性读取 ctx.integrations——register 期赋值)
68
68
  bindMallInfoContext(ctx);
69
69
 
70
- // 域装配注册(W1-③ 注册表消费首例):raw 缺席(无 integrations.json)→ 不注册,
70
+ // 域装配注册(注册表消费首例):raw 缺席(无 integrations.json)→ 不注册,
71
71
  // 装配点按"无控制面"降级(语义对齐迁移前模板 if (deployment) 分支)
72
72
  const assembly = createScopeAssembly(ctx.integrations?.raw, ctx);
73
73
  if (assembly) {
74
74
  ctx.domainAssemblies.register(SCOPE_ASSEMBLY_KIND, assembly);
75
75
 
76
- // 015 S7:mall-directory 服务注入(deployment.malls 单一来源;shopping-guide
76
+ // mall-directory 服务注入(deployment.malls 单一来源;shopping-guide
77
77
  // 「附近商场」数据源 + customer-service-faq 客服电话;模块只 resolveService 消费)
78
78
  ctx.services.register('mall-directory', {
79
79
  nearbyMalls: () =>
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * 商场基础信息缓存(mall.info 槽消费方;动态商场信息源)。
3
3
  *
4
- * 自 mall 模板 config/mall-info.ts 迁入(单一模板统一化 W3-1;语义逐字保留)。
4
+ * 自 mall 模板 config/mall-info.ts 迁入(单一模板统一化 ;语义逐字保留)。
5
5
  *
6
6
  * 职责:
7
7
  * - cachedMallName:withMallName 同步回退通道(会话建立后 mallName 直接回显)
8
8
  * - resolveMallInfo:缓存 → single-flight → mall.info 槽拉取;失败/未知 → undefined(fail-soft)
9
9
  *
10
- * 缓存纪律(S1 DoS 加固):
10
+ * 缓存纪律(DoS 加固):
11
11
  * - 正缓存 TTL 30min(plaza 信息低频变更)
12
12
  * - 负缓存 TTL 5min(垃圾/拉取失败 ID 防重复打上游)
13
13
  * - LRU 封顶 1024(Map 插入序近似,可接受)
@@ -5,7 +5,7 @@ import { resolveMallInfo } from './mall-info-cache.js';
5
5
 
6
6
  /**
7
7
  * 商场基本信息工具(mall.info 槽消费方;动态商场信息源)。
8
- * 自 mall 模板 tools/mall-info.ts 迁入(单一模板统一化 W3-1;语义逐字保留)。
8
+ * 自 mall 模板 tools/mall-info.ts 迁入(单一模板统一化 ;语义逐字保留)。
9
9
  *
10
10
  * - 数据面 = 本模块缓存服务 resolveMallInfo(缓存 → single-flight → mall.info 槽拉取,fail-soft);
11
11
  * - register 期经 bindMallInfoContext 绑定 ctx(execute 惰性读取 ctx.integrations——
@@ -26,7 +26,7 @@ export const mallInfoTool = createTool({
26
26
  id: 'mall-info',
27
27
  description:
28
28
  '查询商场基本信息(名称/地址/经纬度)。用户问某商场叫什么、在哪儿、地址时调用;当前会话商场 ID 可从 mall-info 注入块取。',
29
- // D11 参数规范:纯 string(preTool decide 注入 / 模型直传入参)
29
+ // 参数规范:纯 string(preTool decide 注入 / 模型直传入参)
30
30
  inputSchema: z.object({ mallId: z.string().describe('商场 ID') }),
31
31
  // 无 outputSchema:可选字段动态形状(对齐 mall-context;出卡工具建议省略的约定此处同理由)
32
32
  execute: async (input: { mallId?: string }) => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bumpin 模块 ports 动态装配(bumpin-banner 数据源;单一模板统一化 W3-3 后仅存此一态)。
2
+ * bumpin 模块 ports 动态装配(bumpin-banner 数据源;单一模板统一化 后仅存此一态)。
3
3
  *
4
4
  * 双态语义:模板源不声明 @app/* 依赖——未装模块时 import 解析失败 → catch → null(端点降级空数据);
5
5
  * 生成应用(module add 后)可解析,tsup noExternal @app/* 按字面量 specifier 内联进 dist(生产全功能)。
@@ -8,7 +8,7 @@
8
8
  * return 处对真实模块类型做严格可赋值检查(port 改名/收参/删导出 → 编译报错,由生成应用 verify 执行)。
9
9
  * 类型真源 = contracts-mall Port(Pick 派生 + resolver 属性签名,不手抄字段)。
10
10
  *
11
- * member/parking 快览消费已服务化(W3-3:member.snapshot / parking.snapshot 经
11
+ * member/parking 快览消费已服务化(member.snapshot / parking.snapshot 经
12
12
  * ctx.services.resolveService 缺席降级,见 routes.ts)——本文件不再承载其 loader。
13
13
  * bumpin 保留动态装配原因:消费面 = resolveAlipayBumpInService(ctx) + 配置读写 +
14
14
  * toBumpInCardData 投影函数族,非单一服务注册面可承载。
@@ -4,7 +4,7 @@ import { mallSlot } from '@tbox.cn/app-contracts-mall';
4
4
  import { mallInfoTool } from './mall-info-tool.js';
5
5
 
6
6
  /**
7
- * 模块前置工具声明(010 声明式通道;自 mall 模板 pre-tools.ts 迁入——单一模板统一化 W3-1)。
7
+ * 模块前置工具声明(010 声明式通道;自 mall 模板 pre-tools.ts 迁入——单一模板统一化)。
8
8
  *
9
9
  * mall-info —— 商场基本信息每轮背景注入(mall-context 同款三件套,2026-09-14):
10
10
  * always + decide 自 mallSlot.read(attributes) 注入 mallId(B3 入参化——dedup 键随
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 商圈首页路由(/api/m/mall-core/* 四端点:config / linked-panel / nearby-mall / bumpin-banner;
3
- * 自 mall 模板 app.ts 端点迁入——单一模板统一化 W3-2;2026-09-20 随 module-mall-home 并入本包,
3
+ * 自 mall 模板 app.ts 端点迁入——单一模板统一化 ;2026-09-20 随 module-mall-home 并入本包,
4
4
  * 路由命名空间同步更名 /api/m/mall-home/* → /api/m/mall-core/*)。
5
5
  *
6
6
  * - 时序契约:ctx.routes.mount() 挂载于 app 的 /api/m(先于 createPlatformApiRouter 的 /api 404 兜底,
@@ -81,9 +81,9 @@ router.get('/linked-panel', async (req, res) => {
81
81
  // mallId 注入经 TIER1 唯一写入口(query 契约键 + opts.miniAppId 兜底),使
82
82
  // resolveMember*Port/resolveParkingQueryPort 能正常取到 mall scope
83
83
  // miniAppId 读源单点(对齐 WS enhanceContext)= resolveMallMiniAppId(root config 优先 →
84
- // 参考表按 mallId 查);双缺按 mallId-only 降级继续(v4 D9:miniAppId 是尽力回填的展示值,
84
+ // 参考表按 mallId 查);双缺按 mallId-only 降级继续(v4 miniAppId 是尽力回填的展示值,
85
85
  // 非会话边界——与 HELLO defaultMallContext 同语义)。绝不注入假值(09-01 事故防线保留):
86
- // 真实档加签读源 scope ?? config(如 wanda-headers),scope 缺席回落部署 config,无假值消费面。
86
+ // 真实档加签读源 scope ?? config(厂商签名头),scope 缺席回落部署 config,无假值消费面。
87
87
  // (曾回退字面量 'linked-panel' 属假值注入——与本降级有本质区别,仍被禁止)
88
88
  const assembly = resolveMallScopeAssembly(ctx);
89
89
  const mallMiniAppId = assembly
@@ -97,7 +97,7 @@ router.get('/linked-panel', async (req, res) => {
97
97
  const reqCtxWithMall = withMallScopeFromQuery(authCtx, req.query, { miniAppId: mallMiniAppId });
98
98
 
99
99
  const [memberResult, parkingResult] = await Promise.allSettled([
100
- // 会员积分(W3-3 服务化消费:member.snapshot 工厂缺席 = member 模块未装 → null,
100
+ // 会员积分(服务化消费:member.snapshot 工厂缺席 = member 模块未装 → null,
101
101
  // 与迁移前 loader null 同语义;工厂执行失败 → null——与迁移前端口 resolve 失败同语义)
102
102
  (async () => {
103
103
  const memberStartedAt = Date.now();
@@ -127,7 +127,7 @@ router.get('/linked-panel', async (req, res) => {
127
127
  enrollUrl: port.enrollUrl || null,
128
128
  };
129
129
  })(),
130
- // 停车车辆(W3-3 服务化消费:parking.snapshot 工厂;缺席 → unavailable,执行失败 → error)
130
+ // 停车车辆(服务化消费:parking.snapshot 工厂;缺席 → unavailable,执行失败 → error)
131
131
  (async () => {
132
132
  const parkingStartedAt = Date.now();
133
133
  const factory = ctx.resolveService<ParkingSnapshotFactory>(PARKING_SNAPSHOT_SERVICE);