@bolloon/bolloon-agent 0.3.34 → 0.3.36
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/dist/agents/pi-sdk-tools.js +34 -5
- package/dist/agents/pi-sdk.js +98 -12
- package/dist/bootstrap/context-manager.js +166 -0
- package/dist/bootstrap/memory-compressor.js +26 -16
- package/dist/bootstrap/snip-collapse.js +39 -35
- package/dist/cli/ink-app.js +44 -1
- package/dist/cli/loading-tui.js +4 -3
- package/dist/cli/mention-data.js +23 -0
- package/dist/cli-entry.js +113 -6
- package/dist/index.js +494 -18
- package/dist/web/client.js +33 -0
- package/dist/web/index.html +11 -11
- package/dist/web/server.js +26 -0
- package/package.json +3 -2
package/dist/web/server.js
CHANGED
|
@@ -1644,6 +1644,20 @@ export async function createWebServer(port = 3000, options = {}) {
|
|
|
1644
1644
|
console.warn('[ipfs] Kubo 自动安装失败 (非致命):', e?.message?.slice(0, 120));
|
|
1645
1645
|
}
|
|
1646
1646
|
})();
|
|
1647
|
+
// 2026-08-06: ContextManager 事件 → SSE broadcast (CLI/Web 状态栏实时同步)
|
|
1648
|
+
try {
|
|
1649
|
+
const { getContextManager } = await import('../bootstrap/context-manager.js');
|
|
1650
|
+
getContextManager().onEvent((evt) => {
|
|
1651
|
+
try {
|
|
1652
|
+
broadcast({ type: 'context_event', evt }, undefined);
|
|
1653
|
+
}
|
|
1654
|
+
catch { /* 广播失败静默 */ }
|
|
1655
|
+
});
|
|
1656
|
+
console.log('[context] ContextManager 事件已接入 SSE (context_event)');
|
|
1657
|
+
}
|
|
1658
|
+
catch (e) {
|
|
1659
|
+
console.warn('[context] ContextManager 事件接入失败 (非致命):', e?.message?.slice(0, 120));
|
|
1660
|
+
}
|
|
1647
1661
|
// 2026-08-03: 初始化 MCP 适配器 (读 ~/.mcp.json, 自动握手发现工具).
|
|
1648
1662
|
// 后台异步: 不阻塞启动, 失败静默 (agent 调 mcp_list_tools 时再触发).
|
|
1649
1663
|
(async () => {
|
|
@@ -5745,6 +5759,18 @@ ${goalDesc}
|
|
|
5745
5759
|
res.status(500).json({ error: err.message });
|
|
5746
5760
|
}
|
|
5747
5761
|
});
|
|
5762
|
+
// 2026-08-06: Context OS 资源管理 API — 上下文用量 + 最近一次压缩快照 (Web UI 同步)
|
|
5763
|
+
app.get('/api/context/usage', async (_req, res) => {
|
|
5764
|
+
try {
|
|
5765
|
+
const { getContextManager, loadLatestSnapshot } = await import('../bootstrap/context-manager.js');
|
|
5766
|
+
const usage = getContextManager().getUsage();
|
|
5767
|
+
const latest = await loadLatestSnapshot();
|
|
5768
|
+
res.json({ ok: true, usage, latestSnapshot: latest });
|
|
5769
|
+
}
|
|
5770
|
+
catch (err) {
|
|
5771
|
+
res.status(500).json({ error: err.message });
|
|
5772
|
+
}
|
|
5773
|
+
});
|
|
5748
5774
|
app.get('/api/iroh/info', async (_req, res) => {
|
|
5749
5775
|
if (!irohInitialized || !irohNodeInfo) {
|
|
5750
5776
|
res.json({ initialized: false });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bolloon/bolloon-agent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.36",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "P2P AI Document Agent - 全局安装后执行 `bolloon` 启动产品",
|
|
6
6
|
"main": "dist/cli-entry.js",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"test": "vitest run",
|
|
47
47
|
"test:watch": "vitest",
|
|
48
48
|
"test:pi-sdk": "tsx src/test/pi-sdk.test.ts",
|
|
49
|
-
"postinstall": "node scripts/postinstall.js"
|
|
49
|
+
"postinstall": "node scripts/postinstall.js",
|
|
50
|
+
"verify:ipns": "tsx scripts/verify-ipns-pipeline.ts"
|
|
50
51
|
},
|
|
51
52
|
"workspaces": [
|
|
52
53
|
"src/constraint-runtime"
|