@tbox.cn/app-module-mall-core 0.2.0 → 0.2.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.
@@ -3,7 +3,7 @@ import { SCOPE_ASSEMBLY_KIND as SCOPE_ASSEMBLY_KIND2 } from "@tbox.cn/app-contra
3
3
  import { MALL_INFO_CACHE_SERVICE } from "@tbox.cn/app-contracts-mall";
4
4
 
5
5
  // src/server/assembly.ts
6
- import { createLogger } from "@tbox.cn/app-sdk/server";
6
+ import { createLogger } from "@tbox.cn/app-agent-sdk-server";
7
7
  import { SCOPE_ASSEMBLY_KIND } from "@tbox.cn/app-contracts";
8
8
  import {
9
9
  createMallRuntimeAssembly,
@@ -168,7 +168,7 @@ function buildDefaultMallContext(controlPlane, rootMiniAppId) {
168
168
  }
169
169
 
170
170
  // src/server/mall-info-tool.ts
171
- import { createTool } from "@tbox.cn/app-sdk/server";
171
+ import { createTool } from "@tbox.cn/app-agent-sdk-server";
172
172
  import { z } from "zod";
173
173
  var ctxRef;
174
174
  function bindMallInfoContext(ctx) {
@@ -204,7 +204,7 @@ var mallInfoTool = createTool({
204
204
  });
205
205
 
206
206
  // src/server/pre-tools.ts
207
- import { definePreTool } from "@tbox.cn/app-sdk/server";
207
+ import { definePreTool } from "@tbox.cn/app-agent-sdk-server";
208
208
  import { mallSlot } from "@tbox.cn/app-contracts-mall";
209
209
  var preTools = {
210
210
  "mall-info": definePreTool(mallInfoTool, {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { bindMallInfoContext, buildDefaultMallContext, cachedMallName, createScopeAssembly, mallInfoTool, preTools, resolveMallInfo, resolveMallScopeAssembly, default as serverModule } from './server/index.js';
2
2
  export { MallScopeAssembly } from '@tbox.cn/app-contracts-mall';
3
- import '@tbox.cn/app-sdk/server';
3
+ import '@tbox.cn/app-sdk-server';
4
+ import '@tbox.cn/app-agent-sdk-server';
4
5
  import '@mastra/core/tools';
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  resolveMallInfo,
9
9
  resolveMallScopeAssembly,
10
10
  serverModule
11
- } from "./chunk-FBL6MHK5.js";
11
+ } from "./chunk-WSJ2HA5F.js";
12
12
  export {
13
13
  bindMallInfoContext,
14
14
  buildDefaultMallContext,
@@ -1,5 +1,6 @@
1
- import * as _tbox_cn_app_sdk_server from '@tbox.cn/app-sdk/server';
2
- import { IntegrationsRaw, ServerContext, IntegrationsRegistry, PreToolDef } from '@tbox.cn/app-sdk/server';
1
+ import * as _tbox_cn_app_sdk_server from '@tbox.cn/app-sdk-server';
2
+ import * as _tbox_cn_app_agent_sdk_server from '@tbox.cn/app-agent-sdk-server';
3
+ import { IntegrationsRaw, ServerContext, IntegrationsRegistry, PreToolDef } from '@tbox.cn/app-agent-sdk-server';
3
4
  import * as _mastra_core_tools from '@mastra/core/tools';
4
5
  import { MallDeploymentControlPlane, MallScopeAssembly, MallInfo } from '@tbox.cn/app-contracts-mall';
5
6
  export { MallScopeAssembly } from '@tbox.cn/app-contracts-mall';
@@ -69,7 +70,7 @@ declare function resolveMallInfo(mallId: string, integrations: IntegrationsRegis
69
70
 
70
71
  /** register 期绑定(模块注册面;测试可显式绑定裸上下文) */
71
72
  declare function bindMallInfoContext(ctx: ServerContext | undefined): void;
72
- declare const mallInfoTool: _mastra_core_tools.Tool<{
73
+ declare const mallInfoTool: _tbox_cn_app_agent_sdk_server.Tool<{
73
74
  mallId: string;
74
75
  }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-info", unknown>;
75
76
 
@@ -82,9 +83,11 @@ declare const mallInfoTool: _mastra_core_tools.Tool<{
82
83
  * not-found 不落键,下轮重试防钉死;缓存服务负缓存 5min 限流上游)。
83
84
  */
84
85
  declare const preTools: {
85
- 'mall-info': PreToolDef<_mastra_core_tools.Tool<{
86
+ 'mall-info': PreToolDef<_tbox_cn_app_agent_sdk_server.Tool<{
86
87
  mallId: string;
87
- }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-info", unknown>>;
88
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-info", unknown>, {
89
+ mallId: string;
90
+ }>;
88
91
  };
89
92
 
90
93
  declare const serverModule: {
@@ -93,9 +96,11 @@ declare const serverModule: {
93
96
  };
94
97
  cards: {};
95
98
  preTools: {
96
- 'mall-info': _tbox_cn_app_sdk_server.PreToolDef<_mastra_core_tools.Tool<{
99
+ 'mall-info': _tbox_cn_app_sdk_server.PreToolDef<_tbox_cn_app_agent_sdk_server.Tool<{
100
+ mallId: string;
101
+ }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-info", unknown>, {
97
102
  mallId: string;
98
- }, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "mall-info", unknown>>;
103
+ }>;
99
104
  };
100
105
  register(ctx: ServerContext): void;
101
106
  };
@@ -9,7 +9,7 @@ import {
9
9
  resolveMallScopeAssembly,
10
10
  serverModule,
11
11
  server_default
12
- } from "../chunk-FBL6MHK5.js";
12
+ } from "../chunk-WSJ2HA5F.js";
13
13
  export {
14
14
  bindMallInfoContext,
15
15
  buildDefaultMallContext,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-mall-core",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "商圈核心模块:scope 域装配注册(ctx.domainAssemblies)+ mall-info 工具/缓存/preTool + mall-directory 服务(无 UI)。",
6
6
  "exports": {
@@ -15,9 +15,10 @@
15
15
  "./package.json": "./package.json"
16
16
  },
17
17
  "dependencies": {
18
- "@tbox.cn/app-sdk": "0.20.0",
19
- "@tbox.cn/app-contracts": "0.11.0",
20
- "@tbox.cn/app-contracts-mall": "0.11.0"
18
+ "@tbox.cn/app-contracts": "0.12.0",
19
+ "@tbox.cn/app-contracts-mall": "0.12.0",
20
+ "@tbox.cn/app-agent-sdk-client": "0.1.0",
21
+ "@tbox.cn/app-agent-sdk-server": "0.1.0"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "zod": "3.25.76"
@@ -13,8 +13,8 @@
13
13
  *
14
14
  * instanceIdOf 注入 mall 语义(SDK 零领域铁律——mallId 派生归本模块)。
15
15
  */
16
- import { createLogger, type ServerContext } from '@tbox.cn/app-sdk/server';
17
- import type { IntegrationsRaw } from '@tbox.cn/app-sdk/server';
16
+ import { createLogger, type ServerContext } from '@tbox.cn/app-agent-sdk-server';
17
+ import type { IntegrationsRaw } from '@tbox.cn/app-agent-sdk-server';
18
18
  import { SCOPE_ASSEMBLY_KIND } from '@tbox.cn/app-contracts';
19
19
  import type { ProviderInstanceDeclarations } from '@tbox.cn/app-contracts';
20
20
  import {
@@ -6,7 +6,7 @@
6
6
  * register 只注册不解析(注册期纯净铁律):域装配投影为纯函数计算(ctx.integrations.raw 输入),
7
7
  * 消费点(模板装配/WS/HTTP)运行期惰性查表。
8
8
  */
9
- import type { ServerContext, ServerModule } from '@tbox.cn/app-sdk/server';
9
+ import type { ServerContext, ServerModule } from '@tbox.cn/app-agent-sdk-server';
10
10
  import { SCOPE_ASSEMBLY_KIND } from '@tbox.cn/app-contracts';
11
11
  import { MALL_INFO_CACHE_SERVICE, type MallInfoCachePort } from '@tbox.cn/app-contracts-mall';
12
12
  import { createScopeAssembly } from './assembly.js';
@@ -16,7 +16,7 @@
16
16
  * mallId 形状守卫与 provider 侧同则(双保险,防 path 注入类字符进上游 URL)。
17
17
  */
18
18
  import type { MallInfo, MallInfoPort } from '@tbox.cn/app-contracts-mall';
19
- import type { IntegrationsRegistry } from '@tbox.cn/app-sdk/server';
19
+ import type { IntegrationsRegistry } from '@tbox.cn/app-agent-sdk-server';
20
20
  import type { RequestContext } from '@tbox.cn/app-contracts';
21
21
 
22
22
  const CACHE_TTL_MS = 30 * 60 * 1000; // plaza 信息低频变更(实测 updateTime 佐证)
@@ -1,5 +1,5 @@
1
- // 铁律:不直接 import @mastra/core,经 @tbox.cn/app-sdk/server 的 createTool 入口(单例铁律)
2
- import { createTool, type ServerContext } from '@tbox.cn/app-sdk/server';
1
+ // 铁律:不直接 import @mastra/core,经 @tbox.cn/app-agent-sdk-server 的 createTool 入口(单例铁律)
2
+ import { createTool, type ServerContext } from '@tbox.cn/app-agent-sdk-server';
3
3
  import { z } from 'zod';
4
4
  import { resolveMallInfo } from './mall-info-cache.js';
5
5
 
@@ -1,5 +1,5 @@
1
- // 铁律:不直接 import @mastra/core,经 @tbox.cn/app-sdk/server 的 definePreTool 入口(单例铁律)
2
- import { definePreTool, type PreToolDef } from '@tbox.cn/app-sdk/server';
1
+ // 铁律:不直接 import @mastra/core,经 @tbox.cn/app-agent-sdk-server 的 definePreTool 入口(单例铁律)
2
+ import { definePreTool, type PreToolDef } from '@tbox.cn/app-agent-sdk-server';
3
3
  import { mallSlot } from '@tbox.cn/app-contracts-mall';
4
4
  import { mallInfoTool } from './mall-info-tool.js';
5
5
 
package/tbox.module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "name": "module-mall-core",
4
- "title": "商圈核心",
3
+ "id": "module-mall-core",
4
+ "name": "商圈核心",
5
5
  "description": "无 UI 基础设施:域装配注册、商场信息工具与缓存、商场目录服务",
6
6
  "version": "0.1.0",
7
7
  "kind": "business",
@@ -12,7 +12,16 @@
12
12
  "distribution": {
13
13
  "defaultMode": "codegen"
14
14
  },
15
- "contributes": {
15
+ "dependencies": {
16
+ "modules": [
17
+ {
18
+ "id": "contracts-mall",
19
+ "required": true
20
+ }
21
+ ]
22
+ },
23
+ "env": [],
24
+ "declare": {
16
25
  "handlers": [],
17
26
  "tools": [
18
27
  "mall-info"
@@ -22,15 +31,17 @@
22
31
  "pages": [],
23
32
  "tabs": [],
24
33
  "actions": [],
25
- "services": []
26
- },
27
- "dependencies": {
28
- "modules": [
34
+ "consumes": [],
35
+ "owns": [
29
36
  {
30
- "id": "contracts-mall",
31
- "required": true
37
+ "service": "auth.alipay-login"
38
+ },
39
+ {
40
+ "service": "mall.info"
41
+ },
42
+ {
43
+ "service": "mall.info-cache"
32
44
  }
33
45
  ]
34
- },
35
- "env": []
46
+ }
36
47
  }
@@ -7,11 +7,11 @@
7
7
  * mall-directory 服务;raw 缺席 → 不注册(无控制面降级语义)
8
8
  */
9
9
  import { describe, expect, it } from 'vitest';
10
- import type { IntegrationsRegistry, ServerContext } from '@tbox.cn/app-sdk/server';
11
- import { createServerContext, parseIntegrationsConfig, registerServerModules } from '@tbox.cn/app-sdk/server';
10
+ import type { IntegrationsRegistry, ServerContext } from '@tbox.cn/app-agent-sdk-server';
11
+ import { createServerContext, parseIntegrationsConfig, registerServerModules } from '@tbox.cn/app-agent-sdk-server';
12
12
  import { SCOPE_ASSEMBLY_KIND } from '@tbox.cn/app-contracts';
13
13
  import type { ProviderInstanceDeclarations } from '@tbox.cn/app-contracts';
14
- import type { IntegrationsRaw } from '@tbox.cn/app-sdk/server';
14
+ import type { IntegrationsRaw } from '@tbox.cn/app-agent-sdk-server';
15
15
  import { createScopeAssembly, buildDefaultMallContext, serverModule } from '../src/server/index.js';
16
16
 
17
17
  /** 模拟 real-env 素材形态:root instances 注册表 + defaultInstanceId + services */
@@ -3,7 +3,7 @@
3
3
  * register 注册缓存读面(闭包 integrations)——形状守卫短路 + 缓存缺席路径不抛错。
4
4
  */
5
5
  import { describe, expect, it } from 'vitest';
6
- import { createServerContext } from '@tbox.cn/app-sdk/server';
6
+ import { createServerContext } from '@tbox.cn/app-agent-sdk-server';
7
7
  import { MALL_INFO_CACHE_SERVICE, type MallInfoCachePort } from '@tbox.cn/app-contracts-mall';
8
8
  import { serverModule } from '../src/server/index';
9
9
 
@@ -7,7 +7,7 @@
7
7
  * mock IntegrationsRegistry(只实现 resolveService 调用计数与返回)。
8
8
  */
9
9
  import { describe, expect, it } from 'vitest';
10
- import type { IntegrationsRegistry } from '@tbox.cn/app-sdk/server';
10
+ import type { IntegrationsRegistry } from '@tbox.cn/app-agent-sdk-server';
11
11
  import type { MallInfo, MallInfoPort } from '@tbox.cn/app-contracts-mall';
12
12
  import { cachedMallName, resolveMallInfo } from '../src/server/mall-info-cache.js';
13
13
 
@@ -9,8 +9,8 @@
9
9
  * 每用例独立 mallId(resolveMallInfo 模块级缓存单例——测试互不污染)。
10
10
  */
11
11
  import { describe, expect, it } from 'vitest';
12
- import type { IntegrationsRegistry, ServerContext } from '@tbox.cn/app-sdk/server';
13
- import { createServerContext, createEngineFromContext, registerServerModules } from '@tbox.cn/app-sdk/server';
12
+ import type { IntegrationsRegistry, ServerContext } from '@tbox.cn/app-agent-sdk-server';
13
+ import { createServerContext, createEngineFromContext, registerServerModules } from '@tbox.cn/app-agent-sdk-server';
14
14
  import type { MallInfo, MallInfoPort } from '@tbox.cn/app-contracts-mall';
15
15
  import { serverModule } from '../src/server/index.js';
16
16
  import { preTools } from '../src/server/pre-tools.js';
package/tsup.config.ts CHANGED
@@ -14,5 +14,5 @@ export default defineConfig({
14
14
  // dts worker 以命令行式传参会撞 TS5074(incremental 需单文件 emit 或 tsBuildInfoFile);
15
15
  // 声明产物一次性构建无需增量——仅 dts 关闭,typecheck 的增量缓存不受影响。
16
16
  dts: { compilerOptions: { incremental: false } },
17
- external: ['@tbox.cn/app-sdk', '@tbox.cn/app-contracts', '@tbox.cn/app-contracts-mall', 'zod'],
17
+ external: ['@tbox.cn/app-agent-sdk-client', '@tbox.cn/app-agent-sdk-server', '@tbox.cn/app-contracts', '@tbox.cn/app-contracts-mall', 'zod'],
18
18
  });