@tbox.cn/app-template-agent 0.10.27 → 0.10.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-template-agent",
3
- "version": "0.10.27",
3
+ "version": "0.10.28",
4
4
  "description": "tbox AI Agent 全栈模板(多包 pnpm workspace):apps/client + apps/server。唯一模板(W4 单一模板统一化:缺省带 AI 支付体验的 chat 形态;mall 能力经 profiles/mall 加装),能力经 CLI module add 模块扩展(shopping-guide/member 等)。",
5
5
  "engines": {
6
6
  "node": ">=24.0.0 <25.0.0"
@@ -36,7 +36,7 @@
36
36
  "typescript-eslint": "8.67.0",
37
37
  "eslint-plugin-react-hooks": "5.2.0",
38
38
  "vite": "6.4.3",
39
- "@tbox.cn/app-sdk-server": "0.26.2"
39
+ "@tbox.cn/app-sdk-server": "0.26.3"
40
40
  },
41
41
  "license": "MIT",
42
42
  "publishConfig": {
@@ -30,6 +30,8 @@ export const mallInfoExampleFactory: ServiceAdapterFactory = (input) => {
30
30
  async getMallInfo(mallId: string): Promise<MallInfo | undefined> {
31
31
  // 实现方负责形状守卫(防 path 注入进上游 URL)。
32
32
  if (!/^[A-Za-z0-9_-]+$/.test(mallId)) return undefined;
33
+ // 商场身份单源:mallId 恒来自会话(入口 URL 或默认商场配置)——勿从 config 读、
34
+ // 勿声明身份配置键;厂商字段名不同(如 plazaId)时按其字段名直传本值。
33
35
  // 惰性凭据:未配置 credentialRef → undefined;真实值不进代码/配置明文。
34
36
  // 真实实现通常把 credential.value 映射为签名/请求头;此处仅演示读取时机。
35
37
  const credential = input.credential?.();
@@ -21,7 +21,9 @@ export const PROVIDER_CUSTOM = 'provider-custom';
21
21
  *
22
22
  * const myApiAdapterFactory: ServiceAdapterFactory = (input) => {
23
23
  * // input.service 服务 id(如 'parking.query'——多服务单键时按此分支返回各 Port)
24
- * // input.instanceId 部署实例键(mall 场景 = mallId;通配激活时由框架解析)
24
+ * // input.instanceId 部署实例键(mall 场景 = mallId,来自入口 URL 或默认商场配置;
25
+ * // 通配激活时由框架解析)——厂商 API 的商场标识参数(plazaId 等)
26
+ * // 直接取本值或查询上下文 q.scope.mallId 直传,勿加配置键/转换层
25
27
  * // input.config 绑定组五层合并后的连接参数(baseUrl 等)
26
28
  * // input.transport HTTP 通道(baseUrl/认证/熔断/HTTPS 强制内建):
27
29
  * // await input.transport.request({ path, method, body, query })
@@ -25,8 +25,8 @@ catalogs:
25
25
  specifier: 0.21.4
26
26
  version: 0.21.4
27
27
  '@tbox.cn/app-sdk-server':
28
- specifier: 0.26.2
29
- version: 0.26.2
28
+ specifier: 0.26.3
29
+ version: 0.26.3
30
30
  '@tbox.cn/app-theme-tbox':
31
31
  specifier: 0.1.5
32
32
  version: 0.1.5
@@ -103,7 +103,7 @@ importers:
103
103
  devDependencies:
104
104
  '@tbox.cn/app-sdk-server':
105
105
  specifier: 'catalog:'
106
- version: 0.26.2
106
+ version: 0.26.3
107
107
  eslint:
108
108
  specifier: 'catalog:'
109
109
  version: 9.39.5
@@ -194,7 +194,7 @@ importers:
194
194
  version: 0.21.4
195
195
  '@tbox.cn/app-sdk-server':
196
196
  specifier: 'catalog:'
197
- version: 0.26.2
197
+ version: 0.26.3
198
198
  typescript:
199
199
  specifier: 'catalog:'
200
200
  version: 5.9.3
@@ -1446,6 +1446,11 @@ packages:
1446
1446
  engines: {node: '>=20.0.0'}
1447
1447
  hasBin: true
1448
1448
 
1449
+ '@tbox.cn/app-sdk-server@0.26.3':
1450
+ resolution: {integrity: sha512-usdD799bdK2ceQf18pVnBDR6CbqsGqhBsoGbYiqiawiYbNtUoEBqvndm1895e015Ch4fXfTsWgXJ3C/L7PmFwA==}
1451
+ engines: {node: '>=20.0.0'}
1452
+ hasBin: true
1453
+
1449
1454
  '@tbox.cn/app-theme-tbox@0.1.5':
1450
1455
  resolution: {integrity: sha512-NL3xmPQOuXBf7vWutU3dWLhvhCvQSA6cHGH76qcqBkPSAgUlKacE1G67jOFyWlC9rg5oMWVOdrkniXvhi5v/4w==}
1451
1456
 
@@ -1453,6 +1458,10 @@ packages:
1453
1458
  resolution: {integrity: sha512-i+rz8tUwndygwCw/T5dp/59p2JKW+Xpfy2UznKOY8vuKbqbe2ANCUTDUuNf8IDuyfvy158Iw/+5H/hLVNAD/3w==}
1454
1459
  engines: {node: '>=20.0.0'}
1455
1460
 
1461
+ '@tbox.cn/app-toolkit@0.8.4':
1462
+ resolution: {integrity: sha512-/0LZpQWAV1ujQJUPPdckSpdwq+WkzhOxqc1DbkIGcjEuoW5rFpBW0mmG+19tMMyH3Pdu4puHy6ioxFOFlb0O6Q==}
1463
+ engines: {node: '>=20.0.0'}
1464
+
1456
1465
  '@types/babel__core@7.20.5':
1457
1466
  resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
1458
1467
 
@@ -4236,6 +4245,18 @@ snapshots:
4236
4245
  transitivePeerDependencies:
4237
4246
  - supports-color
4238
4247
 
4248
+ '@tbox.cn/app-sdk-server@0.26.3':
4249
+ dependencies:
4250
+ '@ag-ui/core': 0.0.47
4251
+ '@tbox.cn/app-contracts': 0.13.3
4252
+ '@tbox.cn/app-sdk-core': 0.20.5
4253
+ '@tbox.cn/app-toolkit': 0.8.4
4254
+ express: 4.22.2
4255
+ jose: 6.2.8
4256
+ zod: 3.25.76
4257
+ transitivePeerDependencies:
4258
+ - supports-color
4259
+
4239
4260
  '@tbox.cn/app-theme-tbox@0.1.5': {}
4240
4261
 
4241
4262
  '@tbox.cn/app-toolkit@0.8.3':
@@ -4243,6 +4264,11 @@ snapshots:
4243
4264
  ajv: 8.20.0
4244
4265
  zod: 3.25.76
4245
4266
 
4267
+ '@tbox.cn/app-toolkit@0.8.4':
4268
+ dependencies:
4269
+ ajv: 8.20.0
4270
+ zod: 3.25.76
4271
+
4246
4272
  '@types/babel__core@7.20.5':
4247
4273
  dependencies:
4248
4274
  '@babel/parser': 7.29.8
@@ -40,7 +40,7 @@ catalog:
40
40
  "@tbox.cn/agent-plugin": 0.1.0
41
41
  "@tbox.cn/app-sdk-core": 0.20.5
42
42
  "@tbox.cn/app-sdk-client": 0.21.4
43
- "@tbox.cn/app-sdk-server": 0.26.2
43
+ "@tbox.cn/app-sdk-server": 0.26.3
44
44
  "@tbox.cn/app-agent-sdk-server": 0.3.3
45
45
  "@tbox.cn/app-agent-sdk-client": 0.2.1
46
46
  "@tbox.cn/app-contracts": 0.13.3