@tbox.cn/app-template-agent 0.10.28 → 0.10.30
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/.gitignore +6 -0
- package/AGENTS.md +4 -3
- package/README.md +1 -1
- package/apps/client/src/app.tsx +6 -30
- package/apps/client/src/business/README.md +23 -0
- package/apps/client/src/business/routes.json +3 -0
- package/apps/client/src/main.tsx +3 -40
- package/apps/client/src/platform/AgentChatApp.tsx +7 -37
- package/apps/client/src/platform/AppShell.tsx +42 -0
- package/apps/client/src/platform/bootstrap.ts +55 -0
- package/apps/client/src/platform/card-preview-page.tsx +12 -0
- package/apps/client/src/platform/mount-page.tsx +25 -0
- package/apps/client/src/vite-env.d.ts +0 -3
- package/apps/client/tsconfig.json +10 -2
- package/apps/client/vite.config.ts +31 -6
- package/apps/server/src/app.ts +11 -4
- package/apps/server/src/dev.ts +28 -4
- package/apps/server/src/index.ts +34 -10
- package/package.json +2 -2
- package/packages/provider-custom/src/server/example-adapter.ts +4 -2
- package/pnpm-lock.template.yaml +36 -62
- package/pnpm-workspace.template.yaml +4 -4
package/.gitignore
CHANGED
package/AGENTS.md
CHANGED
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
## 关键入口
|
|
42
42
|
|
|
43
43
|
```text
|
|
44
|
-
apps/client/src/main.tsx #
|
|
44
|
+
apps/client/src/main.tsx # 客户端根入口(启动层 = platform/bootstrap)
|
|
45
|
+
apps/client/src/business/routes.json # 页面清单(MPA 文档模式唯一真源;删除 = 单页 legacy)
|
|
45
46
|
apps/client/src/business/App.tsx # 业务应用入口
|
|
46
47
|
apps/client/src/platform/AgentChatApp.tsx # 默认对话运行时
|
|
47
48
|
apps/client/src/modules.ts # 客户端模块装配(与 server 端同构)
|
|
@@ -141,7 +142,7 @@ pnpm install
|
|
|
141
142
|
## 双运行时与插件
|
|
142
143
|
|
|
143
144
|
- 原生能力统一走 `@tbox.cn/app-sdk/client` 的 `createPlatformAdapters()`(ASR/TTS/upload/feedback);业务/UI 不直接判断支付宝壳。
|
|
144
|
-
- API/WS 地址由 `@tbox.cn/app-sdk/client` 的 `configureRuntime({ apiBaseUrl })` 注入(`
|
|
145
|
+
- API/WS 地址由 `@tbox.cn/app-sdk/client` 的 `configureRuntime({ apiBaseUrl })` 注入(`platform/bootstrap.ts`),不得硬编码 host;不直接读 `import.meta.env` 之外的环境。
|
|
145
146
|
- **不直接 import `@tbox-dev-js/sdk`(全禁)**——平台能力(auth/会话/TTS/LLM/插件/能力适配器/协议客户端)一律经 `@tbox.cn/app-sdk` 公开 API。
|
|
146
147
|
- 平台"插件"页添加插件时只改 `config/plugins.json`。应用代码不复制插件鉴权、参数注入、runtime ID 或 SDK 客户端。
|
|
147
148
|
- 插件结果出卡时按 `@tbox.cn/app-contracts` 的 cards schema 注册,在模块包内注册 adapter 和 client 组件。
|
|
@@ -150,7 +151,7 @@ pnpm install
|
|
|
150
151
|
|
|
151
152
|
客户端同时跑浏览器与支付宝小程序 web-view 壳(组件挂载于 H5 视口,非小程序原生渲染),样式遵守:
|
|
152
153
|
|
|
153
|
-
0. **视觉体系 = mall-vis 蓝系**(换肤面四级级联;域色矩阵 member 金 · parking 藏蓝 · sg 蓝 · promotion 红/UI 模式);视觉值只住 kit tokens / 模块域变量块 / 素材变量消费三层(品牌视觉经主题包覆写——出厂接线 `@tbox.cn/app-theme-tbox` 三行,见 `apps/client/src/
|
|
154
|
+
0. **视觉体系 = mall-vis 蓝系**(换肤面四级级联;域色矩阵 member 金 · parking 藏蓝 · sg 蓝 · promotion 红/UI 模式);视觉值只住 kit tokens / 模块域变量块 / 素材变量消费三层(品牌视觉经主题包覆写——出厂接线 `@tbox.cn/app-theme-tbox` 三行,见 `apps/client/src/platform/bootstrap.ts`),平台 token 名字零增减。
|
|
154
155
|
1. **长度单位 PX 大写**(如 `800PX`)——postcss-pxtorem 大小写敏感转义:小写 `px` 按设计稿换算 rem(750 稿 2x),需要固定屏幕像素不随 rem 缩放的值用大写 `PX`(转换器跳过,详见 `apps/client/STYLE_GUIDE.md`)。
|
|
155
156
|
2. **flex 子项设 `flex-shrink: 0`**——壳内内容宽度不定,防元素被压缩变形。
|
|
156
157
|
3. **滚动容器隐藏滚动条**(`::-webkit-scrollbar { display: none }`)——web-view 无原生滚动条,出现即破相。
|
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ definePreTool(findStoreTool, {
|
|
|
185
185
|
| `createToolExecContext(reqCtx)` | `@tbox.cn/app-sdk/server` | 测试/直调助手:构造工具 execute 第二参(散键与引擎同构) |
|
|
186
186
|
| `createPlatformAdapters(session, overrides)` | `@tbox.cn/app-sdk/client` | 自定义 ASR/TTS/upload/feedback 实现(contracts 接口,UI 零改动) |
|
|
187
187
|
| `createAuthClient({ scopeKey })` | `@tbox.cn/app-sdk/client` | 客户端登录配置(`platform/agent-runtime.ts`);**应用级单例**——重复调用幂等返回首建实例,首建选项生效 |
|
|
188
|
-
| `configureRuntime({ apiBaseUrl })` | `@tbox.cn/app-sdk/client` | API/WS 地址注入(`
|
|
188
|
+
| `configureRuntime({ apiBaseUrl })` | `@tbox.cn/app-sdk/client` | API/WS 地址注入(`platform/bootstrap.ts`;对应 `VITE_API_URL`) |
|
|
189
189
|
| bridge 透传 | `@tbox.cn/app-sdk/client` 的 `callJsapi` | 业务新能力(扫码/导航/分享等,壳子补 JSAPI 白名单) |
|
|
190
190
|
|
|
191
191
|
UI 表现与编排(组件/hooks/容器/样式/id 前缀约定)、业务意图表、演示工具、配置数据留模板源码(源码即扩展点)。
|
package/apps/client/src/app.tsx
CHANGED
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
import { lazy, Suspense } from 'react';
|
|
2
1
|
import BusinessApp from '@/business/App';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// - lazy 双动态 import 组装(SDK 页面 + 模板 registry/authClient 单例注入——
|
|
11
|
-
// authClient 含模板选项,不经预览页自建)。
|
|
12
|
-
const CARD_PREVIEW_PATH = '/_tbox/card-preview';
|
|
13
|
-
const DevCardPreview = import.meta.env.DEV || __TBOX_CARD_PREVIEW__
|
|
14
|
-
? lazy(async () => {
|
|
15
|
-
const [{ CardPreviewPage }, { CARD_REGISTRY }, { authClient }] = await Promise.all([
|
|
16
|
-
import('@tbox.cn/app-agent-sdk-client/client/card-preview'),
|
|
17
|
-
import('@/cards/registry'),
|
|
18
|
-
import('@/platform/agent-runtime'),
|
|
19
|
-
]);
|
|
20
|
-
return {
|
|
21
|
-
default: () => <CardPreviewPage registry={CARD_REGISTRY} authClient={authClient} />,
|
|
22
|
-
};
|
|
23
|
-
})
|
|
24
|
-
: null;
|
|
25
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 应用根组件(根 entry main.tsx 的唯一渲染点)。
|
|
5
|
+
* 平台页(/_tbox/card-preview)经 MPA 生成 entry(`.tbox-gen/card-preview.ts` → mountPage)
|
|
6
|
+
* 独立成文档服务——根 entry 不再做 pathname 分支(v6 统一文档形态:与 build 面单一装配路径)。
|
|
7
|
+
* 业务能力经 `npx --yes @tbox.cn/app-cli module add` 扩展。
|
|
8
|
+
*/
|
|
26
9
|
export default function App() {
|
|
27
|
-
if ((import.meta.env.DEV || __TBOX_CARD_PREVIEW__) && DevCardPreview && window.location.pathname === CARD_PREVIEW_PATH) {
|
|
28
|
-
return (
|
|
29
|
-
<Suspense fallback={<div>加载卡片预览…</div>}>
|
|
30
|
-
<DevCardPreview />
|
|
31
|
-
</Suspense>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
10
|
return <BusinessApp />;
|
|
35
11
|
}
|
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
业务能力经 `npx --yes @tbox.cn/app-cli module add` 扩展(shopping-guide/member/parking/promotion/alipay-activity),安装后自动装配进双端 `modules.ts`;联单节点是支付宝活动回执的支付笔数投影(mall-core 家页面),不从会话业务卡或本地默认值派生。生成完成后运行 `pnpm verify:generated`。
|
|
6
6
|
|
|
7
|
+
## 页面清单(v3.2 MPA 文档模式)
|
|
8
|
+
|
|
9
|
+
`routes.json` 是应用页面清单的唯一真源(在场 ⇔ 端到端文档模式;删除文件 = 回到单页 legacy):
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
[
|
|
13
|
+
{ "id": "index", "path": "/", "title": "AI 助手" },
|
|
14
|
+
{ "id": "orders", "path": "/orders", "title": "订单" }
|
|
15
|
+
]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- 每条路由物化一个物理 HTML 文档(`orders/index.html`)+ 独立 entry chunk——未知页面
|
|
19
|
+
404 是文件系统的自然结果;
|
|
20
|
+
- `path` 纯静态段(每段 `^[a-z0-9][a-z0-9-]*$`,禁点号/冒号/通配)——动态路由已按
|
|
21
|
+
方案裁决放弃,实体详情走 query 参数(`/order?id=`);
|
|
22
|
+
- 页面组件默认 `@/pages/<id>`(可 `page` 字段覆盖;根路由 `/` 禁用 page——恒走根 entry);
|
|
23
|
+
- `title`/`meta` 注入生成文档 `<head>`(dev 面沿用根骨架值);
|
|
24
|
+
- 首段不得落在保留命名空间(`api`/`ws`/`assets`/`_tbox`);
|
|
25
|
+
- 增删路由需重启 dev 进程(input 集会话期一次);修改既有页面 HMR 正常;
|
|
26
|
+
- 页面间跳转 = `<a href>` 整文档导航(跨页状态走 URL/localStorage/服务端会话)。
|
|
27
|
+
|
|
28
|
+
页面组件从 `pages/<id>/index.tsx` 开始写;共享视觉经共享组件显式组合(无嵌套布局)。
|
|
29
|
+
|
|
7
30
|
## 本地交互应用
|
|
8
31
|
|
|
9
32
|
当需求当前只涉及客户端本地行为时:
|
package/apps/client/src/main.tsx
CHANGED
|
@@ -1,47 +1,10 @@
|
|
|
1
1
|
import { StrictMode } from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import { configureRuntime, createLogger, installGlobalErrorReporting } from '@tbox.cn/app-agent-sdk-client';
|
|
4
3
|
import App from './app';
|
|
5
|
-
import {
|
|
6
|
-
import '@app/agent-ui-kit/theme/global.less';
|
|
7
|
-
// 品牌主题(出厂接线——theme-tbox 平台品牌资产包:素材/标题经本包承载,模块零品牌资产)。
|
|
8
|
-
// 换主题 = 替换三行(index.css + brand.js + applyTheme;叠加会致旧主题残留死重);
|
|
9
|
-
// 部署者轨迹见 cookbook·build-app-image「主题接线」。CLI 自由区,module sync 永不触碰。
|
|
10
|
-
import '@tbox.cn/app-theme-tbox/index.css';
|
|
11
|
-
import '@tbox.cn/app-theme-tbox/brand.js';
|
|
12
|
-
import { applyTheme } from '@app/agent-ui-kit/theme';
|
|
13
|
-
applyTheme('tbox');
|
|
14
|
-
// chat.json 构建期快照 → kit 静态配置 store(createRoot 前注入,首帧即快照值;
|
|
15
|
-
// HELLO_ACK settings 达后经 ChatPage 内水合覆盖)
|
|
16
|
-
import chatConfigJson from '../../../config/chat.json';
|
|
4
|
+
import { bootstrap } from './platform/bootstrap';
|
|
17
5
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// 壳→H5 接入契约观测:落页即打印 URL 参数(search + hash 双读源,全量加载仅一次)。
|
|
21
|
-
// 壳侧若把参数移进 hash,mall-scope-url 的 search-only 读源会静默失效——这里第一时间暴露。
|
|
22
|
-
// code/token 类值部分脱敏(前缀 + 长度,对齐 provider log-redact 惯例)。
|
|
23
|
-
const SENSITIVE_PARAM = /^(code|token|auth_code|visitortoken|session)$/i;
|
|
24
|
-
const collectParams = (source: string): Record<string, string> => {
|
|
25
|
-
const out: Record<string, string> = {};
|
|
26
|
-
new URLSearchParams(source).forEach((value, key) => {
|
|
27
|
-
out[key] = SENSITIVE_PARAM.test(key) ? `${value.slice(0, 6)}…(len=${value.length})` : value;
|
|
28
|
-
});
|
|
29
|
-
return out;
|
|
30
|
-
};
|
|
31
|
-
const hashQuery = window.location.hash.includes('?')
|
|
32
|
-
? window.location.hash.slice(window.location.hash.indexOf('?') + 1)
|
|
33
|
-
: '';
|
|
34
|
-
bootLogger.info(
|
|
35
|
-
`url params: ${JSON.stringify({ search: collectParams(window.location.search), hash: collectParams(hashQuery) })}`,
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
// H1:环境值注入点(SDK 零 Vite 依赖)——VITE_API_URL 空串 = 同源相对路径
|
|
39
|
-
configureRuntime({ apiBaseUrl: import.meta.env.VITE_API_URL as string | undefined });
|
|
40
|
-
|
|
41
|
-
// 全局错误兜底:未捕获异常/rejection → 统一日志行(本地落地;上报扩展点见 SDK client logger)
|
|
42
|
-
installGlobalErrorReporting();
|
|
43
|
-
|
|
44
|
-
configureChatConfigDefaults(chatConfigJson as Record<string, unknown>);
|
|
6
|
+
// 启动层(主题/运行时/错误兜底/chat 配置快照/壳参数观测)——与生成 entry(mount-page)共享
|
|
7
|
+
bootstrap();
|
|
45
8
|
|
|
46
9
|
const el = document.getElementById('root');
|
|
47
10
|
|
|
@@ -1,44 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
-
import { AdapterProvider, createPlatformAdapters, type AdapterContextValue } from '@tbox.cn/app-agent-sdk-client';
|
|
7
|
-
import type { TboxSessionData } from '@tbox.cn/app-contracts';
|
|
1
|
+
/**
|
|
2
|
+
* 平台默认的全栈对话运行时。普通本地应用无需读取或修改。
|
|
3
|
+
* 外壳(session/适配器)抽至 AppShell 共享——MPA 生成 entry 与本入口同一平台能力面。
|
|
4
|
+
*/
|
|
8
5
|
import IndexPage from '@/pages/index/index';
|
|
9
|
-
import {
|
|
6
|
+
import { AppShell } from './AppShell';
|
|
10
7
|
|
|
11
|
-
/** 平台默认的全栈对话运行时。普通本地应用无需读取或修改。 */
|
|
12
8
|
export default function AgentChatApp() {
|
|
13
|
-
const [session, setSession] = useState<TboxSessionData | null>(null);
|
|
14
|
-
// TTS 不依赖 session,恒可用且保持同一实例(播放状态不因会话刷新丢失)
|
|
15
|
-
const tts = useMemo(() => createPlatformAdapters().tts, []);
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
authClient
|
|
19
|
-
.ensureAuth()
|
|
20
|
-
// 会话 β 收口:身份恒取 token(服务端 401/403),userId 不再上行
|
|
21
|
-
.then(() => platformApi.getTboxSession())
|
|
22
|
-
.then(setSession)
|
|
23
|
-
.catch((err) => appLogger.error('tbox session init failed:', err));
|
|
24
|
-
}, []);
|
|
25
|
-
|
|
26
|
-
const refreshSession = useCallback(async (): Promise<AdapterContextValue> => {
|
|
27
|
-
platformApi.clearTboxSession();
|
|
28
|
-
await authClient.refreshAuth();
|
|
29
|
-
const data = await platformApi.getTboxSession(true);
|
|
30
|
-
setSession(data);
|
|
31
|
-
return { tts, ...createPlatformAdapters(data, { tts }), refreshSession };
|
|
32
|
-
}, [tts]);
|
|
33
|
-
|
|
34
|
-
const adapters = useMemo<AdapterContextValue>(() => {
|
|
35
|
-
if (!session) return { tts, refreshSession };
|
|
36
|
-
return { tts, ...createPlatformAdapters(session, { tts }), refreshSession };
|
|
37
|
-
}, [session, tts, refreshSession]);
|
|
38
|
-
|
|
39
9
|
return (
|
|
40
|
-
<
|
|
10
|
+
<AppShell>
|
|
41
11
|
<IndexPage />
|
|
42
|
-
</
|
|
12
|
+
</AppShell>
|
|
43
13
|
);
|
|
44
14
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 应用外壳(平台运行时供给层):session 引导 + 平台适配器(TTS 等)。
|
|
3
|
+
* 从 AgentChatApp 抽出的共享外壳——MPA 生成 entry(mount-page)与根 entry
|
|
4
|
+
* (AgentChatApp → BusinessApp)共用,保证任何页面的平台能力面一致。
|
|
5
|
+
*/
|
|
6
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { AdapterProvider, createPlatformAdapters, type AdapterContextValue } from '@tbox.cn/app-agent-sdk-client';
|
|
8
|
+
import type { TboxSessionData } from '@tbox.cn/app-contracts';
|
|
9
|
+
import { authClient, platformApi } from './agent-runtime';
|
|
10
|
+
import { createLogger } from '@tbox.cn/app-agent-sdk-client';
|
|
11
|
+
|
|
12
|
+
const appLogger = createLogger('AppShell');
|
|
13
|
+
|
|
14
|
+
export function AppShell({ children }: { children: React.ReactNode }) {
|
|
15
|
+
const [session, setSession] = useState<TboxSessionData | null>(null);
|
|
16
|
+
// TTS 不依赖 session,恒可用且保持同一实例(播放状态不因会话刷新丢失)
|
|
17
|
+
const tts = useMemo(() => createPlatformAdapters().tts, []);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
authClient
|
|
21
|
+
.ensureAuth()
|
|
22
|
+
// 会话 β 收口:身份恒取 token(服务端 401/403),userId 不再上行
|
|
23
|
+
.then(() => platformApi.getTboxSession())
|
|
24
|
+
.then(setSession)
|
|
25
|
+
.catch((err: unknown) => appLogger.error('tbox session init failed:', err));
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const refreshSession = useCallback(async (): Promise<AdapterContextValue> => {
|
|
29
|
+
platformApi.clearTboxSession();
|
|
30
|
+
await authClient.refreshAuth();
|
|
31
|
+
const data = await platformApi.getTboxSession(true);
|
|
32
|
+
setSession(data);
|
|
33
|
+
return { tts, ...createPlatformAdapters(data, { tts }), refreshSession };
|
|
34
|
+
}, [tts]);
|
|
35
|
+
|
|
36
|
+
const adapters = useMemo<AdapterContextValue>(() => {
|
|
37
|
+
if (!session) return { tts, refreshSession };
|
|
38
|
+
return { tts, ...createPlatformAdapters(session, { tts }), refreshSession };
|
|
39
|
+
}, [session, tts, refreshSession]);
|
|
40
|
+
|
|
41
|
+
return <AdapterProvider value={adapters}>{children}</AdapterProvider>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 客户端启动层(单一职责:一次进程级初始化,幂等)。
|
|
3
|
+
* 消费方 = 根 entry(main.tsx)与全部生成 entry(.tbox-gen/<id>.ts 经 mount-page)——
|
|
4
|
+
* 两侧共享同一实现,保证任何文档入口的启动语义一致(主题/运行时/错误兜底/chat 配置快照)。
|
|
5
|
+
* 约束:只做同步可完成的初始化;@config 别名根除相对深度耦合(vite.config + tsconfig 同步接线)。
|
|
6
|
+
*/
|
|
7
|
+
import { configureRuntime, createLogger, installGlobalErrorReporting } from '@tbox.cn/app-agent-sdk-client';
|
|
8
|
+
import { configureChatConfigDefaults } from '@app/agent-ui-kit';
|
|
9
|
+
import '@app/agent-ui-kit/theme/global.less';
|
|
10
|
+
// 品牌主题(出厂接线——theme-tbox 平台品牌资产包:素材/标题经本包承载,模块零品牌资产)。
|
|
11
|
+
// 换主题 = 替换三行(index.css + brand.js + applyTheme;叠加会致旧主题残留死重);
|
|
12
|
+
// 部署者轨迹见 cookbook·build-app-image「主题接线」。CLI 自由区,module sync 永不触碰。
|
|
13
|
+
import '@tbox.cn/app-theme-tbox/index.css';
|
|
14
|
+
import '@tbox.cn/app-theme-tbox/brand.js';
|
|
15
|
+
import { applyTheme } from '@app/agent-ui-kit/theme';
|
|
16
|
+
import chatConfigJson from '@config/chat.json';
|
|
17
|
+
|
|
18
|
+
const bootLogger = createLogger('BOOT');
|
|
19
|
+
|
|
20
|
+
let bootstrapped = false;
|
|
21
|
+
|
|
22
|
+
export function bootstrap(): void {
|
|
23
|
+
if (bootstrapped) return;
|
|
24
|
+
bootstrapped = true;
|
|
25
|
+
|
|
26
|
+
applyTheme('tbox');
|
|
27
|
+
|
|
28
|
+
// 壳→H5 接入契约观测:落页即打印 URL 参数(search + hash 双读源,全量加载仅一次)。
|
|
29
|
+
// 壳侧若把参数移进 hash,mall-scope-url 的 search-only 读源会静默失效——这里第一时间暴露。
|
|
30
|
+
// code/token 类值部分脱敏(前缀 + 长度,对齐 provider log-redact 惯例)。
|
|
31
|
+
const SENSITIVE_PARAM = /^(code|token|auth_code|visitortoken|session)$/i;
|
|
32
|
+
const collectParams = (source: string): Record<string, string> => {
|
|
33
|
+
const out: Record<string, string> = {};
|
|
34
|
+
new URLSearchParams(source).forEach((value, key) => {
|
|
35
|
+
out[key] = SENSITIVE_PARAM.test(key) ? `${value.slice(0, 6)}…(len=${value.length})` : value;
|
|
36
|
+
});
|
|
37
|
+
return out;
|
|
38
|
+
};
|
|
39
|
+
const hashQuery = window.location.hash.includes('?')
|
|
40
|
+
? window.location.hash.slice(window.location.hash.indexOf('?') + 1)
|
|
41
|
+
: '';
|
|
42
|
+
bootLogger.info(
|
|
43
|
+
`url params: ${JSON.stringify({ search: collectParams(window.location.search), hash: collectParams(hashQuery) })}`,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// H1:环境值注入点(SDK 零 Vite 依赖)——VITE_API_URL 空串 = 同源相对路径
|
|
47
|
+
configureRuntime({ apiBaseUrl: import.meta.env.VITE_API_URL as string | undefined });
|
|
48
|
+
|
|
49
|
+
// 全局错误兜底:未捕获异常/rejection → 统一日志行(本地落地;上报扩展点见 SDK client logger)
|
|
50
|
+
installGlobalErrorReporting();
|
|
51
|
+
|
|
52
|
+
// chat.json 构建期快照 → kit 静态配置 store(render 前注入,首帧即快照值;
|
|
53
|
+
// HELLO_ACK settings 达后经 ChatPage 内水合覆盖)
|
|
54
|
+
configureChatConfigDefaults(chatConfigJson as Record<string, unknown>);
|
|
55
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 卡片预览平台页(MPA 文档入口):static/生产面经平台文档表服务 dist/_tbox/card-preview.html;
|
|
3
|
+
* dev 面经 dev-runtime 平台表分支服务 entry 替换 shell——两面共用同一生成 entry
|
|
4
|
+
* (.tbox-gen/card-preview.ts → mountPage → 本模块,单一装配路径,HMR 完好)。
|
|
5
|
+
*/
|
|
6
|
+
import { CardPreviewPage } from '@tbox.cn/app-agent-sdk-client/client/card-preview';
|
|
7
|
+
import { CARD_REGISTRY } from '@/cards/registry';
|
|
8
|
+
import { authClient } from '@/platform/agent-runtime';
|
|
9
|
+
|
|
10
|
+
export default function CardPreviewRoute() {
|
|
11
|
+
return <CardPreviewPage registry={CARD_REGISTRY} authClient={authClient} />;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 生成 entry 的页面挂载点(跨包契约:mpa-build-plugin 生成的 .tbox-gen/<id>.ts 调用本模块)。
|
|
3
|
+
* bootstrap(幂等)+ AppShell(平台能力面)+ lazy 页面——与根 entry(main.tsx)同一启动语义。
|
|
4
|
+
*/
|
|
5
|
+
import { StrictMode } from 'react';
|
|
6
|
+
import { createRoot } from 'react-dom/client';
|
|
7
|
+
import { lazy, Suspense, type ComponentType } from 'react';
|
|
8
|
+
import { bootstrap } from './bootstrap';
|
|
9
|
+
import { AppShell } from './AppShell';
|
|
10
|
+
|
|
11
|
+
export function mountPage(load: () => Promise<{ default: ComponentType }>): void {
|
|
12
|
+
bootstrap();
|
|
13
|
+
const Page = lazy(load);
|
|
14
|
+
const el = document.getElementById('root');
|
|
15
|
+
if (!el) return;
|
|
16
|
+
createRoot(el).render(
|
|
17
|
+
<StrictMode>
|
|
18
|
+
<AppShell>
|
|
19
|
+
<Suspense fallback={<div>加载中…</div>}>
|
|
20
|
+
<Page />
|
|
21
|
+
</Suspense>
|
|
22
|
+
</AppShell>
|
|
23
|
+
</StrictMode>,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -4,8 +4,16 @@
|
|
|
4
4
|
"baseUrl": ".",
|
|
5
5
|
"jsx": "react-jsx",
|
|
6
6
|
"paths": {
|
|
7
|
-
"@/*": [
|
|
7
|
+
"@/*": [
|
|
8
|
+
"src/*"
|
|
9
|
+
],
|
|
10
|
+
"@config/*": [
|
|
11
|
+
"../../config/*"
|
|
12
|
+
]
|
|
8
13
|
}
|
|
9
14
|
},
|
|
10
|
-
"include": [
|
|
15
|
+
"include": [
|
|
16
|
+
"src",
|
|
17
|
+
"vite.config.ts"
|
|
18
|
+
]
|
|
11
19
|
}
|
|
@@ -27,6 +27,33 @@ const pxToRemPlugin = pxToRem({
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export default defineConfig(async ({ command }) => {
|
|
30
|
+
// 卡片预览能力(v3.2 文档模式 + v6 统一文档形态):serve 恒 true(dev 面平台 entry 与
|
|
31
|
+
// 业务路由同机制——entry src 替换,解耦 import.meta.env.DEV 的 NODE_ENV 敏感性);
|
|
32
|
+
// build 无 TBOX_DEV_TOKEN → false(零残留);build 有(沙箱 protected watch 构建)→ true +
|
|
33
|
+
// 平台文档输入(_tbox/card-preview.html)。能力开关 = 文档/entry 生成与否。
|
|
34
|
+
const previewCapability = !process.env.VITEST && (command === 'serve' || !!process.env.TBOX_DEV_TOKEN);
|
|
35
|
+
// MPA 多页构建插件(v3.2 文档模式):routes.json 在场 ⇔ 端到端文档模式;缺席零注册零变化。
|
|
36
|
+
// 动态 import(对齐 previewErrorReporter 惯例)——vitest 零加载 Node 端依赖;
|
|
37
|
+
// build + serve 双态装载(build 生成文档输入/输出事务;serve 生成 entry——含平台文档 entry,
|
|
38
|
+
// dev 面经 dev-runtime entry src 替换消费)。
|
|
39
|
+
let mpaPlugin: Plugin | null = null;
|
|
40
|
+
if (!process.env.VITEST) {
|
|
41
|
+
const { tboxMpaPlugin } = await import('@tbox.cn/app-agent-sdk-server/platform');
|
|
42
|
+
mpaPlugin = tboxMpaPlugin(
|
|
43
|
+
previewCapability
|
|
44
|
+
? {
|
|
45
|
+
extraDocuments: [
|
|
46
|
+
{
|
|
47
|
+
inputName: 'card-preview',
|
|
48
|
+
document: '_tbox/card-preview.html',
|
|
49
|
+
entry: '@/platform/card-preview-page',
|
|
50
|
+
title: '卡片预览',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
}
|
|
54
|
+
: {},
|
|
55
|
+
);
|
|
56
|
+
}
|
|
30
57
|
// tbox-app-dev dev 探测行(dev 探针常量;构件区在位时启用原地装配改指,缺席零行为变化。
|
|
31
58
|
// guard 断言本标记在场——重定位需同步 dev 探针(cli-dev)与 guard 两处)
|
|
32
59
|
// __dirname 基准 = apps/client:构件区在模板根(上一级×2)
|
|
@@ -48,17 +75,15 @@ export default defineConfig(async ({ command }) => {
|
|
|
48
75
|
react({
|
|
49
76
|
babel: { plugins: command === 'serve' ? [codeInspectPlugin] : [] },
|
|
50
77
|
}),
|
|
78
|
+
...(mpaPlugin ? [mpaPlugin] : []),
|
|
51
79
|
...devPlugins,
|
|
52
80
|
],
|
|
53
|
-
//
|
|
54
|
-
// build 无 TBOX_DEV_TOKEN → false(chunk 可摇除,生产零残留);build 有(沙箱 protected
|
|
55
|
-
// watch 构建)→ true(static 面 /_tbox/card-preview 可达)。guard-dev-probe 断言本标记。
|
|
56
|
-
define: {
|
|
57
|
-
__TBOX_CARD_PREVIEW__: command === 'build' && !!process.env.TBOX_DEV_TOKEN ? 'true' : 'false',
|
|
58
|
-
},
|
|
81
|
+
// 卡片预览面守卫已随 v6 统一文档形态退役(能力开关 = 平台文档/entry 生成与否)
|
|
59
82
|
resolve: {
|
|
60
83
|
alias: {
|
|
61
84
|
'@': resolve(__dirname, 'src'),
|
|
85
|
+
// 应用配置面锚(chat.json 等):根除 src 层级相对路径深度耦合(bootstrap 消费)
|
|
86
|
+
'@config': resolve(__dirname, '../../config'),
|
|
62
87
|
},
|
|
63
88
|
// dev 域 React 单实例(G1/G2 防线):双 dev 入口经本文件合并生效(middleware
|
|
64
89
|
// dev 加载本文件且 command==='serve');build 恒不继承——产物位稳定性。
|
package/apps/server/src/app.ts
CHANGED
|
@@ -305,8 +305,17 @@ app.get('/assets/deploy/:file', (req, res) => {
|
|
|
305
305
|
// 017:装配记忆时挂载 /api/memory 管理面(与引擎同源 store)
|
|
306
306
|
app.use('/api', createPlatformApiRouter({ ctx, auth, ...(memory.store ? { memory: memory.store } : {}) }));
|
|
307
307
|
|
|
308
|
-
// tbox dev 工具族(/_tbox:卡片预览 API +
|
|
309
|
-
//
|
|
308
|
+
// tbox dev 工具族(/_tbox:卡片预览 API + 页面族)——dev 入口显式装配(幂等闭包):
|
|
309
|
+
// dev.ts 在 gate/final 挂载前调用 setupTboxDev()(/_tbox/api 路由序恒胜);静态入口
|
|
310
|
+
// (index.ts → dist/index.js)永不调用——生产零挂载不依赖 NODE_ENV 自觉(SDK 侧
|
|
311
|
+
// production 守卫保留为双保险)。
|
|
312
|
+
let tboxDevInstalled = false;
|
|
313
|
+
export function setupTboxDev(): void {
|
|
314
|
+
if (tboxDevInstalled) return;
|
|
315
|
+
tboxDevInstalled = true;
|
|
316
|
+
installTboxDev(app, { ctx, auth });
|
|
317
|
+
}
|
|
318
|
+
|
|
310
319
|
// iframe 嵌入收紧(AI 构建面板 card-preview 预览):现状无该头 = 隐式全允许 → 显式三元组
|
|
311
320
|
// (用户裁决 2026-09-13:不存在其他 origin 嵌入既有 demo,行为收紧确认;'self' + 生产域 + 本地面板 dev 端口)
|
|
312
321
|
app.use((_req, res, next) => {
|
|
@@ -317,8 +326,6 @@ app.use((_req, res, next) => {
|
|
|
317
326
|
next();
|
|
318
327
|
});
|
|
319
328
|
|
|
320
|
-
installTboxDev(app, { ctx, auth });
|
|
321
|
-
|
|
322
329
|
// 从 ServerContext 构造 ChatEngine(自注册闭环组装端)
|
|
323
330
|
async function createEngine(
|
|
324
331
|
extra?: { cardActionAttacher: (payload: import('@tbox.cn/app-contracts').TboxCardPayload, sessionId: string) => Promise<import('@tbox.cn/app-contracts').TboxCardPayload> },
|
package/apps/server/src/dev.ts
CHANGED
|
@@ -20,10 +20,18 @@ import {
|
|
|
20
20
|
resolveDevTokenFromEnv,
|
|
21
21
|
} from '@tbox.cn/app-agent-sdk-server/platform';
|
|
22
22
|
import { createLogger } from '@tbox.cn/app-agent-sdk-server';
|
|
23
|
-
import { app, registerUpgradeDelegate, start } from './app.js';
|
|
23
|
+
import { app, registerUpgradeDelegate, setupTboxDev, start } from './app.js';
|
|
24
24
|
|
|
25
25
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
26
26
|
const serverLogger = createLogger('server');
|
|
27
|
+
|
|
28
|
+
// fail-closed:dev 入口与生产安全姿态互斥——NODE_ENV=production 下 SDK dev 面
|
|
29
|
+
// (dev-login/卡片预览 API)会静默降级,这里显式拒绝启动(生产走 dist/index.js)
|
|
30
|
+
if (process.env.NODE_ENV === 'production') {
|
|
31
|
+
serverLogger.error('dev 入口禁止 NODE_ENV=production——生产请使用 dist/index.js(pnpm start)');
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
const clientRoot = path.resolve(__dirname, '../../client');
|
|
28
36
|
const appRoot = path.resolve(__dirname, '../..');
|
|
29
37
|
|
|
@@ -89,8 +97,22 @@ const runtime = createTboxDevRuntime({
|
|
|
89
97
|
logger: serverLogger,
|
|
90
98
|
fsAllowNarrowed: protectedMode,
|
|
91
99
|
sseKeepaliveMs: process.env.TBOX_DEV_SSE_KEEPALIVE_MS ? Number(process.env.TBOX_DEV_SSE_KEEPALIVE_MS) : undefined,
|
|
100
|
+
// v3.2 严格文档模式(G8 模式开关):routes.json 在场 ⇔ strict(dev 面 entry 替换 +
|
|
101
|
+
// public 目录索引;static 面 dist 文件真源)。缺席 = legacy SPA fallback,零变化。
|
|
102
|
+
pagePolicy: {
|
|
103
|
+
routesModule: path.join(clientRoot, 'src/business/routes.json'),
|
|
104
|
+
// 卡片预览平台文档(static 面 = 构建产物在场;dev 面 = .tbox-gen/<inputName>.ts entry
|
|
105
|
+
// 替换——与业务路由同机制;能力关 = 文件不在 = 404)
|
|
106
|
+
platformPages: [
|
|
107
|
+
{ path: '/_tbox/card-preview', document: '_tbox/card-preview.html', inputName: 'card-preview' },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
92
110
|
});
|
|
93
111
|
|
|
112
|
+
// tbox dev 工具族装配(幂等;先于 gate/final——/_tbox/api 路由序恒胜)。静态入口
|
|
113
|
+
// (index.ts)不调用 → 生产零挂载。
|
|
114
|
+
setupTboxDev();
|
|
115
|
+
|
|
94
116
|
// 面裁决:dev 面 → vite middlewares;static 面 → next()(落 final 的 dist 静态)
|
|
95
117
|
app.use(runtime.gate);
|
|
96
118
|
|
|
@@ -107,15 +129,17 @@ app.use(runtime.final);
|
|
|
107
129
|
// token 校验,失败 401;未认领回落 app 路由——业务 /ws、根路径、fail-fast 语义不变)
|
|
108
130
|
registerUpgradeDelegate(runtime.handleUpgrade);
|
|
109
131
|
|
|
110
|
-
// protected 面构建通知:watch 增量构建 →
|
|
111
|
-
// fire-and-forget(不 await
|
|
112
|
-
// watch 启动 emptyOutDir 清空 dist
|
|
132
|
+
// protected 面构建通知:watch 增量构建 → BUNDLE_START(构建窗口标记:static 面 miss → 503
|
|
133
|
+
// 而非 404 抖动)→ BUNDLE_END → SSE 广播 → static 面 reload。fire-and-forget(不 await、
|
|
134
|
+
// 无显式 close——dev 会话生命周期即进程生命周期);watch 启动 emptyOutDir 清空 dist 为
|
|
135
|
+
// 已定价行为(首建完成前 strict static 面 503 等待页 / legacy 纯 404)。
|
|
113
136
|
if (protectedMode) {
|
|
114
137
|
viteBuild({ root: clientRoot, build: { watch: {}, sourcemap: false } })
|
|
115
138
|
.then((result) => {
|
|
116
139
|
const watcher = Array.isArray(result) ? result[0] : result;
|
|
117
140
|
if (!watcher || !('on' in watcher)) return;
|
|
118
141
|
watcher.on('event', (e) => {
|
|
142
|
+
if (e.code === 'BUNDLE_START') runtime.notifyBuildStart();
|
|
119
143
|
if (e.code === 'BUNDLE_END') runtime.notifyBuildEnd();
|
|
120
144
|
});
|
|
121
145
|
})
|
package/apps/server/src/index.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 静态入口(唯一 tsup entry → dist/index.js
|
|
2
|
+
* 静态入口(唯一 tsup entry → dist/index.js):按 routes.json 在场性选择供给形态(G8 模式开关)。
|
|
3
3
|
* dist 形态恒静态——vite dev 仅存在于 src/dev.ts(tsx 运行,禁入 tsup entry,
|
|
4
4
|
* tsup.config.ts forbid-vite 插件拦截)。NODE_ENV 只影响 SDK 安全姿态(dev-login/密钥链)。
|
|
5
|
+
*
|
|
6
|
+
* strict(routes.json 在场 ⇔ 构建期插件同源判定):dist 文件存在性 = 唯一路由真源,
|
|
7
|
+
* 未知页面 404 是文件系统的自然结果;平台文档表(卡片预览,能力开 = 构建产物在场);
|
|
8
|
+
* 统一 .html 文档管线 + 目录索引/301;dist 未就绪 503。
|
|
9
|
+
* legacy(routes.json 缺席):express.static + SPA catch-all——与历史行为字节等价。
|
|
10
|
+
* 镜像携带全量源码(docker/Dockerfile 全量 COPY),src/dist 平级锚点恒可探测。
|
|
5
11
|
*/
|
|
6
12
|
import path from 'path';
|
|
13
|
+
import express from 'express';
|
|
7
14
|
import { existsSync } from 'node:fs';
|
|
8
15
|
import { fileURLToPath } from 'url';
|
|
9
|
-
import express from 'express';
|
|
10
16
|
import { createLogger } from '@tbox.cn/app-agent-sdk-server';
|
|
17
|
+
import { createStrictStaticHandler } from '@tbox.cn/app-agent-sdk-server/platform';
|
|
11
18
|
import { app, start } from './app.js';
|
|
12
19
|
|
|
13
20
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -20,16 +27,33 @@ if (!existsSync(path.join(clientDistPath, 'index.html'))) {
|
|
|
20
27
|
);
|
|
21
28
|
}
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
app.
|
|
25
|
-
|
|
26
|
-
res.sendFile(path.join(clientDistPath, 'index.html'));
|
|
27
|
-
} else {
|
|
28
|
-
res.status(404).json({ error: 'Not Found' });
|
|
29
|
-
}
|
|
30
|
+
// 未知 /api/* 恒 JSON 404(不落文档面;对齐既有 catch-all 的 api 分支)
|
|
31
|
+
app.use('/api', (_req, res) => {
|
|
32
|
+
res.status(404).json({ error: 'Not Found' });
|
|
30
33
|
});
|
|
31
34
|
|
|
35
|
+
const routesModule = path.join(__dirname, '../../client/src/business/routes.json');
|
|
36
|
+
if (existsSync(routesModule)) {
|
|
37
|
+
serverLogger.info('page_mode', { mode: 'strict-pages' });
|
|
38
|
+
app.use(
|
|
39
|
+
createStrictStaticHandler({
|
|
40
|
+
distDir: clientDistPath,
|
|
41
|
+
platformPages: [
|
|
42
|
+
{ path: '/_tbox/card-preview', document: '_tbox/card-preview.html', inputName: 'card-preview' },
|
|
43
|
+
],
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
} else {
|
|
47
|
+
serverLogger.info('page_mode', { mode: 'legacy-spa' });
|
|
48
|
+
app.use(express.static(clientDistPath));
|
|
49
|
+
app.get('*', (req, res) => {
|
|
50
|
+
if (!req.path.startsWith('/api')) {
|
|
51
|
+
res.sendFile(path.join(clientDistPath, 'index.html'));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
32
56
|
start().catch((err) => {
|
|
33
57
|
serverLogger.error('Failed to start:', err);
|
|
34
58
|
process.exit(1);
|
|
35
|
-
});
|
|
59
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-template-agent",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.30",
|
|
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.
|
|
39
|
+
"@tbox.cn/app-sdk-server": "0.26.4"
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"publishConfig": {
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* configSchema 参数模板——见 `skills get provider-custom`「参数模板声明」);
|
|
8
8
|
* 2. 复制本文件为 `<你的服务>.ts`,替换 Port 类型与方法实现;
|
|
9
9
|
* 3. 在 index.ts register 中 `ctx.integrations?.registerAdapter('provider-custom', '<implementation>', factory)`;
|
|
10
|
-
* 4.
|
|
11
|
-
* `
|
|
10
|
+
* 4. 绑定并验证——按接入维度选层(完整三维度声明片段与剥离规则见
|
|
11
|
+
* `skills get integration`「声明落点」):服务 = `provider bind <slot> provider-custom`;
|
|
12
|
+
* 模块 = `provider use provider-custom --module <install id>`(owned 槽补 `{}` 激活节点,
|
|
13
|
+
* 既有槽级绑定须剥离)+ `pnpm smoke` + `npx --yes @tbox.cn/app-cli module doctor`。
|
|
12
14
|
*
|
|
13
15
|
* 本文件不注册、不声明槽位——零行为,仅作为可复制模板。
|
|
14
16
|
*/
|
package/pnpm-lock.template.yaml
CHANGED
|
@@ -13,11 +13,11 @@ catalogs:
|
|
|
13
13
|
specifier: 0.1.0
|
|
14
14
|
version: 0.1.0
|
|
15
15
|
'@tbox.cn/app-agent-sdk-client':
|
|
16
|
-
specifier: 0.2.
|
|
17
|
-
version: 0.2.
|
|
16
|
+
specifier: 0.2.2
|
|
17
|
+
version: 0.2.2
|
|
18
18
|
'@tbox.cn/app-agent-sdk-server':
|
|
19
|
-
specifier: 0.3.
|
|
20
|
-
version: 0.3.
|
|
19
|
+
specifier: 0.3.4
|
|
20
|
+
version: 0.3.4
|
|
21
21
|
'@tbox.cn/app-contracts':
|
|
22
22
|
specifier: 0.13.3
|
|
23
23
|
version: 0.13.3
|
|
@@ -25,11 +25,11 @@ catalogs:
|
|
|
25
25
|
specifier: 0.21.4
|
|
26
26
|
version: 0.21.4
|
|
27
27
|
'@tbox.cn/app-sdk-server':
|
|
28
|
-
specifier: 0.26.
|
|
29
|
-
version: 0.26.
|
|
28
|
+
specifier: 0.26.4
|
|
29
|
+
version: 0.26.4
|
|
30
30
|
'@tbox.cn/app-theme-tbox':
|
|
31
|
-
specifier: 0.1.
|
|
32
|
-
version: 0.1.
|
|
31
|
+
specifier: 0.1.6
|
|
32
|
+
version: 0.1.6
|
|
33
33
|
'@types/express':
|
|
34
34
|
specifier: 4.17.25
|
|
35
35
|
version: 4.17.25
|
|
@@ -103,7 +103,7 @@ importers:
|
|
|
103
103
|
devDependencies:
|
|
104
104
|
'@tbox.cn/app-sdk-server':
|
|
105
105
|
specifier: 'catalog:'
|
|
106
|
-
version: 0.26.
|
|
106
|
+
version: 0.26.4
|
|
107
107
|
eslint:
|
|
108
108
|
specifier: 'catalog:'
|
|
109
109
|
version: 9.39.5
|
|
@@ -133,13 +133,13 @@ importers:
|
|
|
133
133
|
version: link:../../packages/provider-custom
|
|
134
134
|
'@tbox.cn/app-agent-sdk-client':
|
|
135
135
|
specifier: 'catalog:'
|
|
136
|
-
version: 0.2.
|
|
136
|
+
version: 0.2.2(@types/react@18.3.31)
|
|
137
137
|
'@tbox.cn/app-contracts':
|
|
138
138
|
specifier: 'catalog:'
|
|
139
139
|
version: 0.13.3
|
|
140
140
|
'@tbox.cn/app-theme-tbox':
|
|
141
141
|
specifier: 'catalog:'
|
|
142
|
-
version: 0.1.
|
|
142
|
+
version: 0.1.6
|
|
143
143
|
react:
|
|
144
144
|
specifier: 'catalog:'
|
|
145
145
|
version: 18.3.1
|
|
@@ -152,7 +152,7 @@ importers:
|
|
|
152
152
|
devDependencies:
|
|
153
153
|
'@tbox.cn/app-agent-sdk-server':
|
|
154
154
|
specifier: 'catalog:'
|
|
155
|
-
version: 0.3.
|
|
155
|
+
version: 0.3.4(@tbox-dev-js/sdk@0.1.18)(rxjs@7.8.1)
|
|
156
156
|
'@types/node':
|
|
157
157
|
specifier: 'catalog:'
|
|
158
158
|
version: 24.13.3
|
|
@@ -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.
|
|
197
|
+
version: 0.26.4
|
|
198
198
|
typescript:
|
|
199
199
|
specifier: 'catalog:'
|
|
200
200
|
version: 5.9.3
|
|
@@ -221,7 +221,7 @@ importers:
|
|
|
221
221
|
version: 0.1.0(@mastra/core@1.59.0(ai@6.0.246(zod@3.25.76))(express@4.22.2)(rxjs@7.8.1)(zod@3.25.76))(@tbox-dev-js/sdk@0.1.18)(zod@3.25.76)
|
|
222
222
|
'@tbox.cn/app-agent-sdk-server':
|
|
223
223
|
specifier: 'catalog:'
|
|
224
|
-
version: 0.3.
|
|
224
|
+
version: 0.3.4(@tbox-dev-js/sdk@0.1.18)(rxjs@7.8.1)
|
|
225
225
|
'@tbox.cn/app-contracts':
|
|
226
226
|
specifier: 'catalog:'
|
|
227
227
|
version: 0.13.3
|
|
@@ -261,7 +261,7 @@ importers:
|
|
|
261
261
|
version: 2.1.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
|
262
262
|
'@tbox.cn/app-agent-sdk-client':
|
|
263
263
|
specifier: 'catalog:'
|
|
264
|
-
version: 0.2.
|
|
264
|
+
version: 0.2.2(@types/react@18.3.31)
|
|
265
265
|
'@tbox.cn/app-contracts':
|
|
266
266
|
specifier: 'catalog:'
|
|
267
267
|
version: 0.13.3
|
|
@@ -341,10 +341,10 @@ importers:
|
|
|
341
341
|
version: 2.1.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
|
342
342
|
'@tbox.cn/app-agent-sdk-client':
|
|
343
343
|
specifier: 'catalog:'
|
|
344
|
-
version: 0.2.
|
|
344
|
+
version: 0.2.2(@types/react@18.3.31)
|
|
345
345
|
'@tbox.cn/app-agent-sdk-server':
|
|
346
346
|
specifier: 'catalog:'
|
|
347
|
-
version: 0.3.
|
|
347
|
+
version: 0.3.4(@tbox-dev-js/sdk@0.1.18)(rxjs@7.8.1)
|
|
348
348
|
'@tbox.cn/app-contracts':
|
|
349
349
|
specifier: 'catalog:'
|
|
350
350
|
version: 0.13.3
|
|
@@ -384,10 +384,10 @@ importers:
|
|
|
384
384
|
dependencies:
|
|
385
385
|
'@tbox.cn/app-agent-sdk-client':
|
|
386
386
|
specifier: 'catalog:'
|
|
387
|
-
version: 0.2.
|
|
387
|
+
version: 0.2.2(@types/react@18.3.31)
|
|
388
388
|
'@tbox.cn/app-agent-sdk-server':
|
|
389
389
|
specifier: 'catalog:'
|
|
390
|
-
version: 0.3.
|
|
390
|
+
version: 0.3.4(@tbox-dev-js/sdk@0.1.18)(rxjs@7.8.1)
|
|
391
391
|
'@tbox.cn/app-contracts':
|
|
392
392
|
specifier: 'catalog:'
|
|
393
393
|
version: 0.13.3
|
|
@@ -1417,12 +1417,12 @@ packages:
|
|
|
1417
1417
|
'@tbox-dev-js/sdk': '>=0.1.18 <0.2.0'
|
|
1418
1418
|
zod: '>=3.24.0 <4.0.0'
|
|
1419
1419
|
|
|
1420
|
-
'@tbox.cn/app-agent-sdk-client@0.2.
|
|
1421
|
-
resolution: {integrity: sha512-
|
|
1420
|
+
'@tbox.cn/app-agent-sdk-client@0.2.2':
|
|
1421
|
+
resolution: {integrity: sha512-Ciu+g4yVy9Ftd9f0KP7D8VVhUy6C4nzzVNxw2ncv2x+VcMO7weobQYbf+SfXgCpKaF30J7tLDBuAs6fjCWg+ZQ==}
|
|
1422
1422
|
engines: {node: '>=20.0.0'}
|
|
1423
1423
|
|
|
1424
|
-
'@tbox.cn/app-agent-sdk-server@0.3.
|
|
1425
|
-
resolution: {integrity: sha512-
|
|
1424
|
+
'@tbox.cn/app-agent-sdk-server@0.3.4':
|
|
1425
|
+
resolution: {integrity: sha512-O7tr3At8vGbvUoItyaB4Ok9jERU5NY1X2+8CgksW+OQW3xf+5KlUZxXqFlfkoWb1eoXxwowIYlMoS4sBHWxWdw==}
|
|
1426
1426
|
engines: {node: '>=20.0.0'}
|
|
1427
1427
|
|
|
1428
1428
|
'@tbox.cn/app-contracts@0.13.2':
|
|
@@ -1441,25 +1441,16 @@ packages:
|
|
|
1441
1441
|
resolution: {integrity: sha512-HLLRg1y2jB32uJPL3/a387eABdNZUxrmkGoJwIv44XV9B94DXmTgb9vxYzbyBa0FazxXG0WudyzFnmH5eeqqrw==}
|
|
1442
1442
|
engines: {node: '>=20.0.0'}
|
|
1443
1443
|
|
|
1444
|
-
'@tbox.cn/app-sdk-server@0.26.
|
|
1445
|
-
resolution: {integrity: sha512-
|
|
1444
|
+
'@tbox.cn/app-sdk-server@0.26.4':
|
|
1445
|
+
resolution: {integrity: sha512-U5dxB6y8mkDB8dF01uU82+2Qbzi8MU+3ChxiFB++Rpef5YeJ7v9DcqklXS+uNwI1cSK4qFSd67jPR/qfosTbdQ==}
|
|
1446
1446
|
engines: {node: '>=20.0.0'}
|
|
1447
1447
|
hasBin: true
|
|
1448
1448
|
|
|
1449
|
-
'@tbox.cn/app-
|
|
1450
|
-
resolution: {integrity: sha512-
|
|
1451
|
-
engines: {node: '>=20.0.0'}
|
|
1452
|
-
hasBin: true
|
|
1453
|
-
|
|
1454
|
-
'@tbox.cn/app-theme-tbox@0.1.5':
|
|
1455
|
-
resolution: {integrity: sha512-NL3xmPQOuXBf7vWutU3dWLhvhCvQSA6cHGH76qcqBkPSAgUlKacE1G67jOFyWlC9rg5oMWVOdrkniXvhi5v/4w==}
|
|
1456
|
-
|
|
1457
|
-
'@tbox.cn/app-toolkit@0.8.3':
|
|
1458
|
-
resolution: {integrity: sha512-i+rz8tUwndygwCw/T5dp/59p2JKW+Xpfy2UznKOY8vuKbqbe2ANCUTDUuNf8IDuyfvy158Iw/+5H/hLVNAD/3w==}
|
|
1459
|
-
engines: {node: '>=20.0.0'}
|
|
1449
|
+
'@tbox.cn/app-theme-tbox@0.1.6':
|
|
1450
|
+
resolution: {integrity: sha512-u3CAWYYChTYCvqMF0bBxeIDhDSa/rfailxzIKnjRrumRgQYs6YS10t4kl3vgQpf6s8KTPFZoGKdJmrLtnMccnQ==}
|
|
1460
1451
|
|
|
1461
|
-
'@tbox.cn/app-toolkit@0.8.
|
|
1462
|
-
resolution: {integrity: sha512
|
|
1452
|
+
'@tbox.cn/app-toolkit@0.8.5':
|
|
1453
|
+
resolution: {integrity: sha512-WyFbaEr8N064PFeWknfZfg5MMinEYI4xExbG2KnE4QPbvcS01NazA1vImPTidrOSXZ411PRFr/JNArS/38nv/w==}
|
|
1463
1454
|
engines: {node: '>=20.0.0'}
|
|
1464
1455
|
|
|
1465
1456
|
'@types/babel__core@7.20.5':
|
|
@@ -4169,7 +4160,7 @@ snapshots:
|
|
|
4169
4160
|
'@tbox-dev-js/sdk': 0.1.18
|
|
4170
4161
|
zod: 3.25.76
|
|
4171
4162
|
|
|
4172
|
-
'@tbox.cn/app-agent-sdk-client@0.2.
|
|
4163
|
+
'@tbox.cn/app-agent-sdk-client@0.2.2(@types/react@18.3.31)':
|
|
4173
4164
|
dependencies:
|
|
4174
4165
|
'@phosphor-icons/react': 2.1.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
|
4175
4166
|
'@tbox.cn/app-contracts': 0.13.3
|
|
@@ -4182,7 +4173,7 @@ snapshots:
|
|
|
4182
4173
|
- '@types/react'
|
|
4183
4174
|
- immer
|
|
4184
4175
|
|
|
4185
|
-
'@tbox.cn/app-agent-sdk-server@0.3.
|
|
4176
|
+
'@tbox.cn/app-agent-sdk-server@0.3.4(@tbox-dev-js/sdk@0.1.18)(rxjs@7.8.1)':
|
|
4186
4177
|
dependencies:
|
|
4187
4178
|
'@ag-ui/core': 0.0.47
|
|
4188
4179
|
'@ai-sdk/openai-compatible': 2.0.68(zod@3.25.76)
|
|
@@ -4192,7 +4183,7 @@ snapshots:
|
|
|
4192
4183
|
'@tbox.cn/agent-plugin': 0.1.0(@mastra/core@1.59.0(ai@6.0.246(zod@3.25.76))(express@4.22.2)(rxjs@7.8.1)(zod@3.25.76))(@tbox-dev-js/sdk@0.1.18)(zod@3.25.76)
|
|
4193
4184
|
'@tbox.cn/app-contracts': 0.13.3
|
|
4194
4185
|
'@tbox.cn/app-sdk-core': 0.20.5
|
|
4195
|
-
'@tbox.cn/app-sdk-server': 0.26.
|
|
4186
|
+
'@tbox.cn/app-sdk-server': 0.26.4
|
|
4196
4187
|
ai: 6.0.246(zod@3.25.76)
|
|
4197
4188
|
express: 4.22.2
|
|
4198
4189
|
gray-matter: 4.0.3
|
|
@@ -4233,38 +4224,21 @@ snapshots:
|
|
|
4233
4224
|
dependencies:
|
|
4234
4225
|
'@tbox.cn/app-contracts': 0.13.2
|
|
4235
4226
|
|
|
4236
|
-
'@tbox.cn/app-sdk-server@0.26.
|
|
4227
|
+
'@tbox.cn/app-sdk-server@0.26.4':
|
|
4237
4228
|
dependencies:
|
|
4238
4229
|
'@ag-ui/core': 0.0.47
|
|
4239
4230
|
'@tbox.cn/app-contracts': 0.13.3
|
|
4240
4231
|
'@tbox.cn/app-sdk-core': 0.20.5
|
|
4241
|
-
'@tbox.cn/app-toolkit': 0.8.
|
|
4232
|
+
'@tbox.cn/app-toolkit': 0.8.5
|
|
4242
4233
|
express: 4.22.2
|
|
4243
4234
|
jose: 6.2.8
|
|
4244
4235
|
zod: 3.25.76
|
|
4245
4236
|
transitivePeerDependencies:
|
|
4246
4237
|
- supports-color
|
|
4247
4238
|
|
|
4248
|
-
'@tbox.cn/app-
|
|
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
|
-
|
|
4260
|
-
'@tbox.cn/app-theme-tbox@0.1.5': {}
|
|
4261
|
-
|
|
4262
|
-
'@tbox.cn/app-toolkit@0.8.3':
|
|
4263
|
-
dependencies:
|
|
4264
|
-
ajv: 8.20.0
|
|
4265
|
-
zod: 3.25.76
|
|
4239
|
+
'@tbox.cn/app-theme-tbox@0.1.6': {}
|
|
4266
4240
|
|
|
4267
|
-
'@tbox.cn/app-toolkit@0.8.
|
|
4241
|
+
'@tbox.cn/app-toolkit@0.8.5':
|
|
4268
4242
|
dependencies:
|
|
4269
4243
|
ajv: 8.20.0
|
|
4270
4244
|
zod: 3.25.76
|
|
@@ -40,12 +40,12 @@ 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.
|
|
44
|
-
"@tbox.cn/app-agent-sdk-server": 0.3.
|
|
45
|
-
"@tbox.cn/app-agent-sdk-client": 0.2.
|
|
43
|
+
"@tbox.cn/app-sdk-server": 0.26.4
|
|
44
|
+
"@tbox.cn/app-agent-sdk-server": 0.3.4
|
|
45
|
+
"@tbox.cn/app-agent-sdk-client": 0.2.2
|
|
46
46
|
"@tbox.cn/app-contracts": 0.13.3
|
|
47
47
|
"@tbox.cn/app-contracts-mall": 0.14.0
|
|
48
|
-
"@tbox.cn/app-theme-tbox": 0.1.
|
|
48
|
+
"@tbox.cn/app-theme-tbox": 0.1.6
|
|
49
49
|
zustand: 4.5.7
|
|
50
50
|
eslint: 9.39.5
|
|
51
51
|
typescript-eslint: 8.67.0
|