@tbox.cn/app-module-shopping-guide 0.8.3 → 0.9.1

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 CHANGED
@@ -12,5 +12,5 @@
12
12
 
13
13
  ## 真实厂商接入
14
14
 
15
- 官方 provider 包形态(manifest 槽声明 + 独立包发布)参照 `modules/provider-mock` 结构样例与
15
+ 官方 provider 包形态(manifest 槽声明 + 独立包发布)参照 `modules/provider-mock`(极简形态)/ `modules/provider-mocktest`(带 configSchema 形态)结构样例与
16
16
  docs/reference/providers.md;厂商中立措辞纪律见该参考(本文件受 vendor-neutrality 门禁扫描)。
@@ -1,5 +1,5 @@
1
1
  // src/server/index.ts
2
- import { definePreTool, loadModuleSkills, getRequestContext } from "@tbox.cn/app-sdk/server";
2
+ import { definePreTool, loadModuleSkills, getRequestContext } from "@tbox.cn/app-agent-sdk-server";
3
3
  import { Router } from "express";
4
4
  import { toMallQueryContext, withMallScopeFromQuery, mallSlot } from "@tbox.cn/app-contracts-mall";
5
5
 
@@ -655,7 +655,7 @@ var meta11 = {
655
655
  var meta_default11 = meta11;
656
656
 
657
657
  // src/server/tools/index.ts
658
- import { createTool, coerceStringifiedFields, requireToolRequestContext, withCardEmissionHint, internalTool } from "@tbox.cn/app-sdk/server";
658
+ import { createTool, coerceStringifiedFields, requireToolRequestContext, withCardEmissionHint, internalTool } from "@tbox.cn/app-agent-sdk-server";
659
659
  import { z } from "zod";
660
660
  import { mallSubjectIdOf } from "@tbox.cn/app-contracts-mall";
661
661
 
@@ -5,7 +5,7 @@ import "./shopping-guide-EGRHPEDA.css";
5
5
  import { useState as useState2 } from "react";
6
6
  import { createPortal } from "react-dom";
7
7
  import { X } from "@phosphor-icons/react";
8
- import { ItemActionsRow, sendCardAction } from "@tbox.cn/app-sdk/client";
8
+ import { ItemActionsRow, sendCardAction } from "@tbox.cn/app-agent-sdk-client";
9
9
 
10
10
  // src/client/components/ImageWithFallback.tsx
11
11
  import { useState } from "react";
@@ -178,7 +178,7 @@ var product_list_default = ProductListCard;
178
178
 
179
179
  // src/client/cards/product-detail/index.tsx
180
180
  import { useState as useState3 } from "react";
181
- import { ItemActionsRow as ItemActionsRow2 } from "@tbox.cn/app-sdk/client";
181
+ import { ItemActionsRow as ItemActionsRow2 } from "@tbox.cn/app-agent-sdk-client";
182
182
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
183
183
  function ProductDetailCard(props) {
184
184
  const { data, cardId, isHistory } = props;
@@ -239,13 +239,13 @@ var product_detail_default = ProductDetailCard;
239
239
  // src/client/cards/shop-list/index.tsx
240
240
  import { useCallback as useCallback3, useMemo as useMemo2, useRef as useRef3, useState as useState6 } from "react";
241
241
  import { CaretRight } from "@phosphor-icons/react";
242
- import { markSelfRendering } from "@tbox.cn/app-sdk/client";
242
+ import { markSelfRendering } from "@tbox.cn/app-agent-sdk-client";
243
243
 
244
244
  // src/client/components/ShopDetailSheet.tsx
245
245
  import { useCallback, useEffect, useId, useRef, useState as useState4 } from "react";
246
246
  import { createPortal as createPortal2 } from "react-dom";
247
247
  import { Clock, MapPin, Phone, Star, Tag, X as X2 } from "@phosphor-icons/react";
248
- import { ItemActionsRow as ItemActionsRow3, navigateToAlipayPage, sendCardAction as sendCardAction2 } from "@tbox.cn/app-sdk/client";
248
+ import { ItemActionsRow as ItemActionsRow3, navigateToAlipayPage, sendCardAction as sendCardAction2 } from "@tbox.cn/app-agent-sdk-client";
249
249
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
250
250
  var HIDDEN_DETAIL_ACTION_LABELS = /* @__PURE__ */ new Set(["\u67E5\u770B\u8BE6\u60C5", "\u5BFC\u822A", "\u95EE\u95EE\u5BFC\u8D2D"]);
251
251
  function ShopDetailSheet(props) {
@@ -840,7 +840,7 @@ function ShopListSheet(props) {
840
840
  }
841
841
 
842
842
  // src/client/cards/shop-list/index.tsx
843
- import { httpGet } from "@tbox.cn/app-sdk/client";
843
+ import { httpGet } from "@tbox.cn/app-agent-sdk-client";
844
844
  import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
845
845
  var PREVIEW_ITEM_COUNT = 3;
846
846
  function projectSheetDataFromItem(merchant) {
@@ -998,7 +998,7 @@ var shop_list_default = ShopListCard;
998
998
  // src/client/cards/shop-detail/index.tsx
999
999
  import { useCallback as useCallback4, useRef as useRef4, useState as useState7 } from "react";
1000
1000
  import { Clock as Clock2, Phone as Phone2 } from "@phosphor-icons/react";
1001
- import { httpGet as httpGet2, markSelfRendering as markSelfRendering2 } from "@tbox.cn/app-sdk/client";
1001
+ import { httpGet as httpGet2, markSelfRendering as markSelfRendering2 } from "@tbox.cn/app-agent-sdk-client";
1002
1002
  import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1003
1003
  function projectSheetDataFromCardData(data) {
1004
1004
  return {
@@ -1091,7 +1091,7 @@ var shop_detail_default = ShopDetailCard;
1091
1091
  // src/client/cards/category-list/index.tsx
1092
1092
  import { useState as useState8 } from "react";
1093
1093
  import { CaretDown } from "@phosphor-icons/react";
1094
- import { sendCardAction as sendCardAction3 } from "@tbox.cn/app-sdk/client";
1094
+ import { sendCardAction as sendCardAction3 } from "@tbox.cn/app-agent-sdk-client";
1095
1095
 
1096
1096
  // src/client/cards/view.ts
1097
1097
  function formatDistance(distanceKm) {
@@ -1359,7 +1359,7 @@ var product_comparison_default = ProductComparisonCard;
1359
1359
  // src/client/cards/mall-directory/index.tsx
1360
1360
  import { useState as useState10 } from "react";
1361
1361
  import { CaretDown as CaretDown2, Storefront as Storefront2 } from "@phosphor-icons/react";
1362
- import { sendCardAction as sendCardAction4 } from "@tbox.cn/app-sdk/client";
1362
+ import { sendCardAction as sendCardAction4 } from "@tbox.cn/app-agent-sdk-client";
1363
1363
  import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
1364
1364
  function MallDirectoryCard(props) {
1365
1365
  const { data, cardId, isHistory } = props;
@@ -1422,7 +1422,7 @@ function MallDirectoryCard(props) {
1422
1422
  var mall_directory_default = MallDirectoryCard;
1423
1423
 
1424
1424
  // src/client/cards/nearby-mall-list/index.tsx
1425
- import { ItemActionsRow as ItemActionsRow4 } from "@tbox.cn/app-sdk/client";
1425
+ import { ItemActionsRow as ItemActionsRow4 } from "@tbox.cn/app-agent-sdk-client";
1426
1426
  import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
1427
1427
  function NearbyMallListCard(props) {
1428
1428
  const { data, cardId, isHistory } = props;
@@ -1452,7 +1452,7 @@ function NearbyMallListCard(props) {
1452
1452
  var nearby_mall_list_default = NearbyMallListCard;
1453
1453
 
1454
1454
  // src/client/cards/human-guide-list/index.tsx
1455
- import { sendCardAction as sendCardAction5 } from "@tbox.cn/app-sdk/client";
1455
+ import { sendCardAction as sendCardAction5 } from "@tbox.cn/app-agent-sdk-client";
1456
1456
  import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
1457
1457
  function HumanGuideListCard(props) {
1458
1458
  const { data, cardId, isHistory } = props;
@@ -1500,7 +1500,7 @@ var human_guide_list_default = HumanGuideListCard;
1500
1500
 
1501
1501
  // src/client/cards/location-handoff/index.tsx
1502
1502
  import { MapPin as MapPin3, NavigationArrow } from "@phosphor-icons/react";
1503
- import { sendCardAction as sendCardAction6 } from "@tbox.cn/app-sdk/client";
1503
+ import { sendCardAction as sendCardAction6 } from "@tbox.cn/app-agent-sdk-client";
1504
1504
  import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
1505
1505
  function LocationHandoffCard(props) {
1506
1506
  const { data, cardId } = props;
@@ -1,5 +1,5 @@
1
1
  import { CardComponent } from '@tbox.cn/app-contracts';
2
- import { ClientContext } from '@tbox.cn/app-sdk/client';
2
+ import { ClientContext } from '@tbox.cn/app-agent-sdk-client';
3
3
 
4
4
  /**
5
5
  * module-shopping-guide 客户端入口(与服务端 serverModule 对称)。
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clientModule
3
- } from "../chunk-VKDA6RXQ.js";
3
+ } from "../chunk-XJIDKUIG.js";
4
4
  export {
5
5
  clientModule
6
6
  };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  export { ShoppingGuideToolIds, ShoppingGuideTools, createShoppingGuideTools, resolveShoppingGuidePorts, serverModule, shoppingGuideCards } from './server/index.js';
2
2
  export { clientModule } from './client/index.js';
3
+ import '@tbox.cn/app-agent-sdk-server';
3
4
  import '@mastra/core/tools';
4
- import '@tbox.cn/app-sdk/server';
5
+ import '@tbox.cn/app-sdk-server';
5
6
  import '@tbox.cn/app-contracts';
6
7
  import 'zod';
7
8
  import '@tbox.cn/app-contracts-mall';
8
- import '@tbox.cn/app-sdk/client';
9
+ import '@tbox.cn/app-agent-sdk-client';
package/dist/index.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  resolveShoppingGuidePorts,
4
4
  serverModule,
5
5
  shoppingGuideCards
6
- } from "./chunk-AYQZO2FV.js";
6
+ } from "./chunk-HWPVP7N5.js";
7
7
  import {
8
8
  clientModule
9
- } from "./chunk-VKDA6RXQ.js";
9
+ } from "./chunk-XJIDKUIG.js";
10
10
  export {
11
11
  clientModule,
12
12
  createShoppingGuideTools,
@@ -1,6 +1,7 @@
1
+ import * as _tbox_cn_app_agent_sdk_server from '@tbox.cn/app-agent-sdk-server';
2
+ import { ServerContext, PreToolDef } from '@tbox.cn/app-agent-sdk-server';
1
3
  import * as _mastra_core_tools from '@mastra/core/tools';
2
- import * as _tbox_cn_app_sdk_server from '@tbox.cn/app-sdk/server';
3
- import { ServerContext, PreToolDef } from '@tbox.cn/app-sdk/server';
4
+ import * as _tbox_cn_app_sdk_server from '@tbox.cn/app-sdk-server';
4
5
  import * as _tbox_cn_app_contracts from '@tbox.cn/app-contracts';
5
6
  import { RequestContext } from '@tbox.cn/app-contracts';
6
7
  import * as zod from 'zod';
@@ -347,13 +348,13 @@ declare const shoppingGuideCards: {
347
348
  total: zod.ZodNumber;
348
349
  hasMore: zod.ZodBoolean;
349
350
  }, "strip", zod.ZodTypeAny, {
350
- total: number;
351
351
  pageSize: number;
352
+ total: number;
352
353
  page: number;
353
354
  hasMore: boolean;
354
355
  }, {
355
- total: number;
356
356
  pageSize: number;
357
+ total: number;
357
358
  page: number;
358
359
  hasMore: boolean;
359
360
  }>>;
@@ -441,8 +442,8 @@ declare const shoppingGuideCards: {
441
442
  summary?: string | undefined;
442
443
  noResultsReason?: string | undefined;
443
444
  pageInfo?: {
444
- total: number;
445
445
  pageSize: number;
446
+ total: number;
446
447
  page: number;
447
448
  hasMore: boolean;
448
449
  } | undefined;
@@ -520,8 +521,8 @@ declare const shoppingGuideCards: {
520
521
  summary?: string | undefined;
521
522
  noResultsReason?: string | undefined;
522
523
  pageInfo?: {
523
- total: number;
524
524
  pageSize: number;
525
+ total: number;
525
526
  page: number;
526
527
  hasMore: boolean;
527
528
  } | undefined;
@@ -1149,13 +1150,13 @@ declare const shoppingGuideCards: {
1149
1150
  total: zod.ZodNumber;
1150
1151
  hasMore: zod.ZodBoolean;
1151
1152
  }, "strip", zod.ZodTypeAny, {
1152
- total: number;
1153
1153
  pageSize: number;
1154
+ total: number;
1154
1155
  page: number;
1155
1156
  hasMore: boolean;
1156
1157
  }, {
1157
- total: number;
1158
1158
  pageSize: number;
1159
+ total: number;
1159
1160
  page: number;
1160
1161
  hasMore: boolean;
1161
1162
  }>>;
@@ -1241,8 +1242,8 @@ declare const shoppingGuideCards: {
1241
1242
  mallId?: string | undefined;
1242
1243
  noResultsReason?: string | undefined;
1243
1244
  pageInfo?: {
1244
- total: number;
1245
1245
  pageSize: number;
1246
+ total: number;
1246
1247
  page: number;
1247
1248
  hasMore: boolean;
1248
1249
  } | undefined;
@@ -1322,8 +1323,8 @@ declare const shoppingGuideCards: {
1322
1323
  mallId?: string | undefined;
1323
1324
  noResultsReason?: string | undefined;
1324
1325
  pageInfo?: {
1325
- total: number;
1326
1326
  pageSize: number;
1327
+ total: number;
1327
1328
  page: number;
1328
1329
  hasMore: boolean;
1329
1330
  } | undefined;
@@ -2972,7 +2973,7 @@ declare function createShoppingGuideTools(opts: {
2972
2973
  /** 注册期绑定的 ServerContext 读取器(模块顶层单例持有;execute 内获取) */
2973
2974
  getCtx: () => ServerContext;
2974
2975
  }): {
2975
- readonly searchShops: _mastra_core_tools.Tool<{
2976
+ readonly searchShops: _tbox_cn_app_agent_sdk_server.Tool<{
2976
2977
  keywords?: string[] | undefined;
2977
2978
  pageSize?: string | undefined;
2978
2979
  page?: string | undefined;
@@ -2980,19 +2981,19 @@ declare function createShoppingGuideTools(opts: {
2980
2981
  floorCode?: string | undefined;
2981
2982
  businessCategory?: string | undefined;
2982
2983
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "search-shops", unknown>;
2983
- readonly getShop: _mastra_core_tools.Tool<{
2984
+ readonly getShop: _tbox_cn_app_agent_sdk_server.Tool<{
2984
2985
  shopId: string;
2985
2986
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "get-shop", unknown>;
2986
- readonly mallContext: _mastra_core_tools.Tool<{
2987
+ readonly mallContext: _tbox_cn_app_agent_sdk_server.Tool<{
2987
2988
  mallId: string;
2988
2989
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-context", unknown>;
2989
- readonly floorShops: _mastra_core_tools.Tool<{
2990
+ readonly floorShops: _tbox_cn_app_agent_sdk_server.Tool<{
2990
2991
  floorQuery: string;
2991
2992
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "floor-shops", unknown>;
2992
- readonly categoryShops: _mastra_core_tools.Tool<{
2993
+ readonly categoryShops: _tbox_cn_app_agent_sdk_server.Tool<{
2993
2994
  categoryQuery: string;
2994
2995
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "category-shops", unknown>;
2995
- readonly mallOverview: _mastra_core_tools.Tool<{
2996
+ readonly mallOverview: _tbox_cn_app_agent_sdk_server.Tool<{
2996
2997
  mallId: string;
2997
2998
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-overview", unknown>;
2998
2999
  };
@@ -3360,13 +3361,13 @@ declare const serverModule: {
3360
3361
  total: zod.ZodNumber;
3361
3362
  hasMore: zod.ZodBoolean;
3362
3363
  }, "strip", zod.ZodTypeAny, {
3363
- total: number;
3364
3364
  pageSize: number;
3365
+ total: number;
3365
3366
  page: number;
3366
3367
  hasMore: boolean;
3367
3368
  }, {
3368
- total: number;
3369
3369
  pageSize: number;
3370
+ total: number;
3370
3371
  page: number;
3371
3372
  hasMore: boolean;
3372
3373
  }>>;
@@ -3454,8 +3455,8 @@ declare const serverModule: {
3454
3455
  summary?: string | undefined;
3455
3456
  noResultsReason?: string | undefined;
3456
3457
  pageInfo?: {
3457
- total: number;
3458
3458
  pageSize: number;
3459
+ total: number;
3459
3460
  page: number;
3460
3461
  hasMore: boolean;
3461
3462
  } | undefined;
@@ -3533,8 +3534,8 @@ declare const serverModule: {
3533
3534
  summary?: string | undefined;
3534
3535
  noResultsReason?: string | undefined;
3535
3536
  pageInfo?: {
3536
- total: number;
3537
3537
  pageSize: number;
3538
+ total: number;
3538
3539
  page: number;
3539
3540
  hasMore: boolean;
3540
3541
  } | undefined;
@@ -4162,13 +4163,13 @@ declare const serverModule: {
4162
4163
  total: zod.ZodNumber;
4163
4164
  hasMore: zod.ZodBoolean;
4164
4165
  }, "strip", zod.ZodTypeAny, {
4165
- total: number;
4166
4166
  pageSize: number;
4167
+ total: number;
4167
4168
  page: number;
4168
4169
  hasMore: boolean;
4169
4170
  }, {
4170
- total: number;
4171
4171
  pageSize: number;
4172
+ total: number;
4172
4173
  page: number;
4173
4174
  hasMore: boolean;
4174
4175
  }>>;
@@ -4254,8 +4255,8 @@ declare const serverModule: {
4254
4255
  mallId?: string | undefined;
4255
4256
  noResultsReason?: string | undefined;
4256
4257
  pageInfo?: {
4257
- total: number;
4258
4258
  pageSize: number;
4259
+ total: number;
4259
4260
  page: number;
4260
4261
  hasMore: boolean;
4261
4262
  } | undefined;
@@ -4335,8 +4336,8 @@ declare const serverModule: {
4335
4336
  mallId?: string | undefined;
4336
4337
  noResultsReason?: string | undefined;
4337
4338
  pageInfo?: {
4338
- total: number;
4339
4339
  pageSize: number;
4340
+ total: number;
4340
4341
  page: number;
4341
4342
  hasMore: boolean;
4342
4343
  } | undefined;
@@ -5983,18 +5984,26 @@ declare const serverModule: {
5983
5984
  [k: string]: _tbox_cn_app_sdk_server.LocalSkill;
5984
5985
  };
5985
5986
  preTools: {
5986
- 'mall-context': PreToolDef<_mastra_core_tools.Tool<{
5987
+ 'mall-context': PreToolDef<_tbox_cn_app_agent_sdk_server.Tool<{
5988
+ mallId: string;
5989
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-context", unknown>, {
5987
5990
  mallId: string;
5988
- }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-context", unknown>>;
5989
- 'floor-shops': PreToolDef<_mastra_core_tools.Tool<{
5991
+ }>;
5992
+ 'floor-shops': PreToolDef<_tbox_cn_app_agent_sdk_server.Tool<{
5993
+ floorQuery: string;
5994
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "floor-shops", unknown>, {
5990
5995
  floorQuery: string;
5991
- }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "floor-shops", unknown>>;
5992
- 'category-shops': PreToolDef<_mastra_core_tools.Tool<{
5996
+ }>;
5997
+ 'category-shops': PreToolDef<_tbox_cn_app_agent_sdk_server.Tool<{
5998
+ categoryQuery: string;
5999
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "category-shops", unknown>, {
5993
6000
  categoryQuery: string;
5994
- }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "category-shops", unknown>>;
5995
- 'mall-overview': PreToolDef<_mastra_core_tools.Tool<{
6001
+ }>;
6002
+ 'mall-overview': PreToolDef<_tbox_cn_app_agent_sdk_server.Tool<{
5996
6003
  mallId: string;
5997
- }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-overview", unknown>>;
6004
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-overview", unknown>, {
6005
+ mallId: string;
6006
+ }>;
5998
6007
  };
5999
6008
  register(ctx: ServerContext): void;
6000
6009
  };
@@ -3,7 +3,7 @@ import {
3
3
  resolveShoppingGuidePorts,
4
4
  serverModule,
5
5
  shoppingGuideCards
6
- } from "../chunk-AYQZO2FV.js";
6
+ } from "../chunk-HWPVP7N5.js";
7
7
  export {
8
8
  createShoppingGuideTools,
9
9
  resolveShoppingGuidePorts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-shopping-guide",
3
- "version": "0.8.3",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "description": "商圈导购模块:商品/商户搜索、推荐、对比、商场目录、人工导购、位置导航。",
6
6
  "exports": {
@@ -19,9 +19,10 @@
19
19
  "./package.json": "./package.json"
20
20
  },
21
21
  "dependencies": {
22
- "@tbox.cn/app-sdk": "0.19.0",
23
- "@tbox.cn/app-contracts": "0.10.0",
24
- "@tbox.cn/app-contracts-mall": "0.10.0"
22
+ "@tbox.cn/app-contracts": "0.12.0",
23
+ "@tbox.cn/app-contracts-mall": "0.12.0",
24
+ "@tbox.cn/app-agent-sdk-client": "0.1.0",
25
+ "@tbox.cn/app-agent-sdk-server": "0.1.0"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "zod": "3.25.76",
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { useState } from 'react';
6
6
  import { CaretDown } from '@phosphor-icons/react';
7
- import { sendCardAction } from '@tbox.cn/app-sdk/client';
7
+ import { sendCardAction } from '@tbox.cn/app-agent-sdk-client';
8
8
  import { categoryIcon } from '../view';
9
9
  import type { CategoryListCardData } from '@tbox.cn/app-contracts-mall';
10
10
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * human-guide-list 富卡(0.4.0 D6):头像占位 + 渠道标签 + 在线状态 + 联系按钮 + 隐私声明。
3
3
  */
4
- import { sendCardAction } from '@tbox.cn/app-sdk/client';
4
+ import { sendCardAction } from '@tbox.cn/app-agent-sdk-client';
5
5
  import { ImageWithFallback } from '../../components/ImageWithFallback';
6
6
  import type { HumanGuideListCardData } from '@tbox.cn/app-contracts-mall';
7
7
 
@@ -2,7 +2,7 @@
2
2
  * location-handoff 富卡(0.4.0 D6):地图预览 + 地址 + 三级降级(view.deriveLocationLevel)。
3
3
  */
4
4
  import { MapPin, NavigationArrow } from '@phosphor-icons/react';
5
- import { sendCardAction } from '@tbox.cn/app-sdk/client';
5
+ import { sendCardAction } from '@tbox.cn/app-agent-sdk-client';
6
6
  import { ImageWithFallback } from '../../components/ImageWithFallback';
7
7
  import { deriveLocationLevel } from '../view';
8
8
  import type { LocationHandoffCardData } from '@tbox.cn/app-contracts-mall';
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useState } from 'react';
5
5
  import { CaretDown, Storefront } from '@phosphor-icons/react';
6
- import { sendCardAction } from '@tbox.cn/app-sdk/client';
6
+ import { sendCardAction } from '@tbox.cn/app-agent-sdk-client';
7
7
  import type { MallDirectoryCardData } from '@tbox.cn/app-contracts-mall';
8
8
 
9
9
  export function MallDirectoryCard(props: {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * nearby-mall-list 富卡(0.4.0 D6):商场名 + 地址 + 距离(formatDistance)+ 营业状态 + 条目动作。
3
3
  */
4
- import { ItemActionsRow } from '@tbox.cn/app-sdk/client';
4
+ import { ItemActionsRow } from '@tbox.cn/app-agent-sdk-client';
5
5
  import { formatDistance } from '../view';
6
6
  import type { NearbyMallListCardData } from '@tbox.cn/app-contracts-mall';
7
7
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useState } from 'react';
5
5
  import { ImageWithFallback } from '../../components/ImageWithFallback';
6
- import { ItemActionsRow } from '@tbox.cn/app-sdk/client';
6
+ import { ItemActionsRow } from '@tbox.cn/app-agent-sdk-client';
7
7
  import type { ProductDetailCardData } from '@tbox.cn/app-contracts-mall';
8
8
 
9
9
  export function ProductDetailCard(props: {
@@ -5,7 +5,7 @@
5
5
  import { useState } from 'react';
6
6
  import { createPortal } from 'react-dom';
7
7
  import { X } from '@phosphor-icons/react';
8
- import { ItemActionsRow, sendCardAction } from '@tbox.cn/app-sdk/client';
8
+ import { ItemActionsRow, sendCardAction } from '@tbox.cn/app-agent-sdk-client';
9
9
  import { ImageWithFallback } from '../../components/ImageWithFallback';
10
10
  import type { ProductListCardData } from '@tbox.cn/app-contracts-mall';
11
11
 
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useRef, useState } from 'react';
2
2
  import { Clock, Phone } from '@phosphor-icons/react';
3
- import { httpGet, markSelfRendering } from '@tbox.cn/app-sdk/client';
3
+ import { httpGet, markSelfRendering } from '@tbox.cn/app-agent-sdk-client';
4
4
  import { MerchantRow } from '../../components/MerchantRow';
5
5
  import { ShopGuideHeader } from '../../components/ShopGuideHeader';
6
6
  import { ShopDetailSheet } from '../../components/ShopDetailSheet';
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useMemo, useRef, useState } from 'react';
2
2
  import { CaretRight } from '@phosphor-icons/react';
3
- import { markSelfRendering } from '@tbox.cn/app-sdk/client';
3
+ import { markSelfRendering } from '@tbox.cn/app-agent-sdk-client';
4
4
  import { ShopDetailSheet } from '../../components/ShopDetailSheet';
5
5
  import type { ShopDetailSheetData } from '../../components/ShopDetailSheet';
6
6
  import { MerchantRow } from '../../components/MerchantRow';
@@ -8,7 +8,7 @@ import { resolveCategoryTabs } from '../../categories';
8
8
  import { ShopGuideHeader } from '../../components/ShopGuideHeader';
9
9
  import { ShopGuideSectionLabel } from '../../components/ShopGuideSectionLabel';
10
10
  import { ShopListSheet } from '../../components/ShopListSheet';
11
- import { httpGet } from '@tbox.cn/app-sdk/client';
11
+ import { httpGet } from '@tbox.cn/app-agent-sdk-client';
12
12
  import type { ShopListCardData, ShopDetailCardData } from '@tbox.cn/app-contracts-mall';
13
13
 
14
14
  const PREVIEW_ITEM_COUNT = 3;
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useEffect, useId, useRef, useState } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
3
  import { Clock, MapPin, Phone, Star, Tag, X } from '@phosphor-icons/react';
4
- import { ItemActionsRow, navigateToAlipayPage, sendCardAction } from '@tbox.cn/app-sdk/client';
4
+ import { ItemActionsRow, navigateToAlipayPage, sendCardAction } from '@tbox.cn/app-agent-sdk-client';
5
5
  import { ImageWithFallback } from './ImageWithFallback';
6
6
  import type { ActionDraft } from '@tbox.cn/app-contracts-mall';
7
7
 
@@ -4,7 +4,7 @@
4
4
  import './styles/shopping-guide.css'; // 0.4.0 D1:模块自持 CSS(副作用 import,首行保证先行加载)
5
5
 
6
6
  import type { CardComponent } from '@tbox.cn/app-contracts';
7
- import type { ClientContext, ClientModule } from '@tbox.cn/app-sdk/client';
7
+ import type { ClientContext, ClientModule } from '@tbox.cn/app-agent-sdk-client';
8
8
  import {
9
9
  ProductListCard,
10
10
  ProductDetailCard,
@@ -6,7 +6,7 @@
6
6
  * - 固定通用文案:计数 N 取接口分页字段 ShoppingPage.total(投影 pageInfo.total 同源);
7
7
  * - 防御兜底:非整句内容放行 LLM(洋葱守卫:未识别 = 放行,不吞——同 member handler 惯例)。
8
8
  */
9
- import type { HandlerDefinition, ServerContext } from '@tbox.cn/app-sdk/server';
9
+ import type { HandlerDefinition, ServerContext } from '@tbox.cn/app-agent-sdk-server';
10
10
  import { parseMallScope } from '@tbox.cn/app-contracts-mall';
11
11
  import { resolveShoppingGuidePorts } from './ports';
12
12
  import { buildShopListCard, toContext } from './tools';
@@ -12,8 +12,8 @@ import type {
12
12
  ServerModule,
13
13
  TypedBus,
14
14
  PreToolDef,
15
- } from '@tbox.cn/app-sdk/server';
16
- import { definePreTool, loadModuleSkills, getRequestContext } from '@tbox.cn/app-sdk/server';
15
+ } from '@tbox.cn/app-agent-sdk-server';
16
+ import { definePreTool, loadModuleSkills, getRequestContext } from '@tbox.cn/app-agent-sdk-server';
17
17
  import { Router } from 'express';
18
18
  import type { Request, Response } from 'express';
19
19
  import { toMallQueryContext, withMallScopeFromQuery, mallSlot } from '@tbox.cn/app-contracts-mall';
@@ -13,7 +13,7 @@ import type {
13
13
  ShopDirectoryQueryPort,
14
14
  NavigationPort,
15
15
  } from '@tbox.cn/app-contracts-mall';
16
- import type { ServerContext } from '@tbox.cn/app-sdk/server';
16
+ import type { ServerContext } from '@tbox.cn/app-agent-sdk-server';
17
17
  import {
18
18
  mallScopeOf,
19
19
  parseMallScope,
@@ -3,9 +3,9 @@
3
3
  * 全部经 createTool;coerceStringifiedFields 首行转换(JSON 字符串化数值/数组还原)。
4
4
  * 出卡见文件头注释(v2 出参 cards 契约);product-facets 返回分面原始数据、search-knowledge 返回 text 汇总。
5
5
  */
6
- import { createTool, coerceStringifiedFields, requireToolRequestContext, withCardEmissionHint, internalTool } from '@tbox.cn/app-sdk/server';
6
+ import { createTool, coerceStringifiedFields, requireToolRequestContext, withCardEmissionHint, internalTool } from '@tbox.cn/app-agent-sdk-server';
7
7
  import { z } from 'zod';
8
- import type { ServerContext, ToolExecContextLike } from '@tbox.cn/app-sdk/server';
8
+ import type { ServerContext, ToolExecContextLike } from '@tbox.cn/app-agent-sdk-server';
9
9
  import { mallSubjectIdOf } from '@tbox.cn/app-contracts-mall';
10
10
  import type {
11
11
  CommercialCategoryQueryPort,
package/tbox.module.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "name": "module-shopping-guide",
3
+ "id": "module-shopping-guide",
4
+ "name": "智能导购",
5
+ "description": "商户检索、楼层类目浏览、券导与真人导览预约",
4
6
  "version": "0.3.0",
5
7
  "kind": "business",
6
8
  "risk": {
@@ -10,7 +12,16 @@
10
12
  "distribution": {
11
13
  "defaultMode": "codegen"
12
14
  },
13
- "contributes": {
15
+ "dependencies": {
16
+ "modules": [
17
+ {
18
+ "id": "contracts-mall",
19
+ "required": true
20
+ }
21
+ ]
22
+ },
23
+ "env": [],
24
+ "declare": {
14
25
  "handlers": [
15
26
  "shopping-guide"
16
27
  ],
@@ -82,7 +93,7 @@
82
93
  "skills": [
83
94
  "shopping-guide"
84
95
  ],
85
- "services": [
96
+ "consumes": [
86
97
  {
87
98
  "service": "shopping-guide.catalog",
88
99
  "optional": false,
@@ -123,15 +134,20 @@
123
134
  }
124
135
  ]
125
136
  }
126
- ]
127
- },
128
- "dependencies": {
129
- "modules": [
137
+ ],
138
+ "owns": [
130
139
  {
131
- "id": "contracts-mall",
132
- "required": true
140
+ "service": "shopping-guide.catalog"
141
+ },
142
+ {
143
+ "service": "shopping-guide.shops"
144
+ },
145
+ {
146
+ "service": "shopping-guide.categories"
147
+ },
148
+ {
149
+ "service": "shopping-guide.directory"
133
150
  }
134
151
  ]
135
- },
136
- "env": []
152
+ }
137
153
  }
@@ -7,7 +7,7 @@
7
7
  import { afterEach, describe, expect, it, vi } from 'vitest';
8
8
  import { createRoot } from 'react-dom/client';
9
9
  import { act } from 'react-dom/test-utils';
10
- import { httpGet, navigateToAlipayPage, sendCardAction } from '@tbox.cn/app-sdk/client';
10
+ import { httpGet, navigateToAlipayPage, sendCardAction } from '@tbox.cn/app-agent-sdk-client';
11
11
  import {
12
12
  CategoryListCard,
13
13
  ProductComparisonCard,
@@ -17,8 +17,8 @@ import {
17
17
  ShopListCard,
18
18
  } from '../src/client/cards';
19
19
 
20
- vi.mock('@tbox.cn/app-sdk/client', async (importOriginal) => {
21
- const mod = await importOriginal<typeof import('@tbox.cn/app-sdk/client')>();
20
+ vi.mock('@tbox.cn/app-agent-sdk-client', async (importOriginal) => {
21
+ const mod = await importOriginal<typeof import('@tbox.cn/app-agent-sdk-client')>();
22
22
  return { ...mod, httpGet: vi.fn(), navigateToAlipayPage: vi.fn(() => Promise.resolve()), sendCardAction: vi.fn() };
23
23
  });
24
24
 
@@ -5,14 +5,14 @@
5
5
  * - 失败语义:楼层不存在 / 目录不可用 / 引用不可解析 → 无卡 summary(模型降级自答)。
6
6
  */
7
7
  import { describe, expect, it } from 'vitest';
8
- import { createInMemoryStateStore, createToolExecContext } from '@tbox.cn/app-sdk/server';
9
- import { createServerContext } from '@tbox.cn/app-sdk/server';
10
- import type { ServerContext } from '@tbox.cn/app-sdk/server';
8
+ import { createInMemoryStateStore, createToolExecContext } from '@tbox.cn/app-agent-sdk-server';
9
+ import { createServerContext } from '@tbox.cn/app-agent-sdk-server';
10
+ import type { ServerContext } from '@tbox.cn/app-agent-sdk-server';
11
11
  import {
12
12
  createIntegrationsRegistry,
13
13
  createAuthStrategyRegistry,
14
14
  createEnvironmentSecretProvider,
15
- } from '@tbox.cn/app-sdk/server';
15
+ } from '@tbox.cn/app-agent-sdk-server';
16
16
  import { createShoppingGuideTools, extractFloorMentions, normalizeFloorKey } from '../src/server/tools';
17
17
  import { serverModule } from '../src/server/index';
18
18
  import { shopListCardDataSchema } from '@tbox.cn/app-contracts-mall';
@@ -8,13 +8,13 @@
8
8
  * - 失败语义:非整句放行 LLM(continueWith)/ reqCtx 缺失 / scope 缺失 / 空门店 → 无卡文案。
9
9
  */
10
10
  import { describe, expect, it } from 'vitest';
11
- import { createInMemoryStateStore, createServerContext } from '@tbox.cn/app-sdk/server';
11
+ import { createInMemoryStateStore, createServerContext } from '@tbox.cn/app-agent-sdk-server';
12
12
  import {
13
13
  createIntegrationsRegistry,
14
14
  createAuthStrategyRegistry,
15
15
  createEnvironmentSecretProvider,
16
- } from '@tbox.cn/app-sdk/server';
17
- import type { ServerContext } from '@tbox.cn/app-sdk/server';
16
+ } from '@tbox.cn/app-agent-sdk-server';
17
+ import type { ServerContext } from '@tbox.cn/app-agent-sdk-server';
18
18
  import { shopListCardDataSchema } from '@tbox.cn/app-contracts-mall';
19
19
  import type { RequestContext } from '@tbox.cn/app-contracts';
20
20
  import { createShoppingGuideHandler } from '../src/server/handler';
@@ -7,13 +7,13 @@
7
7
  */
8
8
  import { describe, expect, it, vi } from 'vitest';
9
9
  import type { RequestContext } from '@tbox.cn/app-contracts';
10
- import { createServerContext } from '@tbox.cn/app-sdk/server';
11
- import type { ServerContext } from '@tbox.cn/app-sdk/server';
10
+ import { createServerContext } from '@tbox.cn/app-agent-sdk-server';
11
+ import type { ServerContext } from '@tbox.cn/app-agent-sdk-server';
12
12
  import { resolveShoppingGuidePorts } from '../src/server/ports';
13
13
 
14
14
  function requestContext(mallId = 'mall-demo'): RequestContext {
15
15
  return {
16
- identity: { userId: 'u_1001', source: 'dev' },
16
+ identity: { userId: 'u_1001', source: 'local' },
17
17
  credentials: { provider: 'dev', token: 'user-token' },
18
18
  attributes: { mall: { miniAppId: 'app', mallId } },
19
19
  };
@@ -5,7 +5,7 @@
5
5
  * 不含促销词汇——brand-guide 卡的中立定位)。
6
6
  */
7
7
  import { describe, expect, it } from 'vitest';
8
- import { findSampleShapeViolations } from '@tbox.cn/app-sdk/server';
8
+ import { findSampleShapeViolations } from '@tbox.cn/app-agent-sdk-server';
9
9
  import shopListMeta from '../src/server/cards/shop-list/meta';
10
10
  import shopDetailMeta from '../src/server/cards/shop-detail/meta';
11
11
  import recommendMerchantsMeta from '../src/server/cards/recommend-merchants/meta';
@@ -4,14 +4,14 @@
4
4
  * adapter/解码层行为归 provider 包测试覆盖;本文件锁定工具投影与本地知识库域。
5
5
  */
6
6
  import { describe, expect, it, vi } from 'vitest';
7
- import { createInMemoryStateStore, createToolExecContext } from '@tbox.cn/app-sdk/server';
8
- import { createServerContext } from '@tbox.cn/app-sdk/server';
9
- import type { ServerContext } from '@tbox.cn/app-sdk/server';
7
+ import { createInMemoryStateStore, createToolExecContext } from '@tbox.cn/app-agent-sdk-server';
8
+ import { createServerContext } from '@tbox.cn/app-agent-sdk-server';
9
+ import type { ServerContext } from '@tbox.cn/app-agent-sdk-server';
10
10
  import {
11
11
  createIntegrationsRegistry,
12
12
  createAuthStrategyRegistry,
13
13
  createEnvironmentSecretProvider,
14
- } from '@tbox.cn/app-sdk/server';
14
+ } from '@tbox.cn/app-agent-sdk-server';
15
15
  import { createShoppingGuideTools, shopListNote } from '../src/server/tools';
16
16
  import { resolveShoppingGuidePorts } from '../src/server/ports';
17
17
  import { shopListCardDataSchema } from '@tbox.cn/app-contracts-mall';
@@ -22,7 +22,7 @@
22
22
  * 实证出现后再补(证据驱动)。
23
23
  */
24
24
  import { describe, expect, it } from 'vitest';
25
- import { decideSkillInjection } from '@tbox.cn/app-sdk/server';
25
+ import { decideSkillInjection } from '@tbox.cn/app-agent-sdk-server';
26
26
  import { serverModule } from '../src/server/index';
27
27
 
28
28
  type LoadedSkill = {
package/tsup.config.ts CHANGED
@@ -16,7 +16,8 @@ export default defineConfig({
16
16
  // 声明产物一次性构建无需增量——仅 dts 关闭,typecheck 的增量缓存不受影响。
17
17
  dts: { compilerOptions: { incremental: false } },
18
18
  external: [
19
- '@tbox.cn/app-sdk',
19
+ '@tbox.cn/app-agent-sdk-client',
20
+ '@tbox.cn/app-agent-sdk-server',
20
21
  '@tbox.cn/app-contracts',
21
22
  '@tbox.cn/app-contracts-mall',
22
23
  'react',