@bolloon/bolloon-agent 0.4.10 → 0.4.11

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.
@@ -36,6 +36,8 @@
36
36
  </div>
37
37
  <div class="section-label">MCP 工具 (触控调用)</div>
38
38
  <div class="list" id="mcp-tools"></div>
39
+ <div class="section-label">A2UI 动态面板 (智能体生成)</div>
40
+ <div id="a2ui-root"></div>
39
41
  </section>
40
42
 
41
43
  <!-- 我 tab -->
@@ -68,5 +70,7 @@
68
70
  </div>
69
71
 
70
72
  <script src="./mobile.js"></script>
73
+ <!-- 2026-08-12: A2UI 渲染器 (智能体生成动态 UI, 挂载 #a2ui-root) -->
74
+ <script src="./a2ui-client.js"></script>
71
75
  </body>
72
76
  </html>
@@ -2808,6 +2808,16 @@ ${goalDesc}
2808
2808
  console.warn('[ui-tools] UI 广播注入失败 (非致命):', e?.message?.slice(0, 120));
2809
2809
  }
2810
2810
  })();
2811
+ // 2026-08-12: A2UI (Agent to UI) — 把 broadcast 注入 a2ui 模块, agent 调 a2ui_* 工具时广播 {type:'a2ui'} 给前端 SSE
2812
+ (async () => {
2813
+ try {
2814
+ const { setA2uiBroadcast } = await import('../pi-ecosystem-a2ui/index.js');
2815
+ setA2uiBroadcast(broadcast);
2816
+ }
2817
+ catch (e) {
2818
+ console.warn('[a2ui] 广播注入失败 (非致命):', e?.message?.slice(0, 120));
2819
+ }
2820
+ })();
2811
2821
  app.get('/api/health', (_req, res) => {
2812
2822
  res.json(healthCheck(getPackageVersion()));
2813
2823
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolloon/bolloon-agent",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "description": "P2P AI Document Agent - 全局安装后执行 `bolloon` 启动产品",
6
6
  "main": "dist/cli-entry.js",
@@ -55,6 +55,8 @@
55
55
  "src/constraint-runtime"
56
56
  ],
57
57
  "dependencies": {
58
+ "@a2ui/react": "^0.10.2",
59
+ "@a2ui/web_core": "^0.10.6",
58
60
  "@bolloon/constraint-runtime": "0.1.0",
59
61
  "@capacitor/android": "^8.5.0",
60
62
  "@capacitor/core": "^8.5.0",
@@ -91,6 +91,21 @@ async function main() {
91
91
  bundle: true,
92
92
  });
93
93
 
94
+ // 2026-08-12: 编译 A2UI 前端渲染器 (a2ui-client.tsx → a2ui-client.js)
95
+ // react + @a2ui/react + @a2ui/web_core 全部打包进 bundle (手机端 webview 无 CDN)
96
+ console.log('[build-web] 编译 a2ui-client.tsx...');
97
+ await esbuild.build({
98
+ entryPoints: [path.join(ROOT, 'src/web/a2ui-client.tsx')],
99
+ outfile: path.join(DIST_WEB, 'a2ui-client.js'),
100
+ format: 'iife',
101
+ target: 'es2022',
102
+ platform: 'browser',
103
+ minify: false,
104
+ bundle: true,
105
+ jsx: 'automatic',
106
+ loader: { '.tsx': 'tsx' },
107
+ });
108
+
94
109
  // 复制静态文件
95
110
  console.log('[build-web] 复制静态文件...');
96
111
  await fs.copyFile(path.join(ROOT, 'src/web/index.html'), path.join(DIST_WEB, 'index.html'));