@bolloon/bolloon-agent 0.1.12 → 0.1.14

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.
Files changed (77) hide show
  1. package/dist/agents/p2p-chat-tools.js +321 -0
  2. package/dist/agents/p2p-document-tools.js +121 -1
  3. package/dist/agents/pi-sdk.js +185 -0
  4. package/dist/agents/shell-guard.js +354 -0
  5. package/dist/agents/shell-tool.js +83 -0
  6. package/dist/agents/skill-loader.js +174 -0
  7. package/dist/agents/workflow-pivot-loop.js +4 -4
  8. package/dist/bollharness-integration/context-chain-router.js +3 -3
  9. package/dist/bollharness-integration/context-router.js +1 -1
  10. package/dist/cli-entry.js +1 -1
  11. package/dist/documents/reader.js +5 -0
  12. package/dist/documents/store.js +1 -1
  13. package/dist/heartbeat/Watchdog.js +7 -5
  14. package/dist/heartbeat/index.js +1 -0
  15. package/dist/heartbeat/self-improve-bus.js +85 -0
  16. package/dist/llm/pi-ai.js +6 -5
  17. package/dist/network/iroh-discovery.js +2 -1
  18. package/dist/network/iroh-transport.js +15 -2
  19. package/dist/network/p2p.js +9 -8
  20. package/dist/network/storage/adapters/json-adapter.js +16 -1
  21. package/dist/network/storage/index.js +2 -1
  22. package/dist/pi-ecosystem-judgment/index.js +42 -115
  23. package/dist/social/channels/channel-heartbeat-agent.js +1 -1
  24. package/dist/utils/auto-update.js +44 -12
  25. package/dist/web/client.js +839 -103
  26. package/dist/web/index.html +100 -8
  27. package/dist/web/server.js +568 -98
  28. package/dist/web/style.css +506 -9
  29. package/package.json +2 -2
  30. package/scripts/build-cli.js +11 -1
  31. package/scripts/build-web.ts +1 -1
  32. package/src/agents/p2p-chat-tools.ts +383 -0
  33. package/src/agents/p2p-document-tools.ts +151 -1
  34. package/src/agents/pi-sdk.ts +196 -0
  35. package/src/agents/shell-guard.ts +417 -0
  36. package/src/agents/shell-tool.ts +103 -0
  37. package/src/agents/skill-loader.ts +202 -0
  38. package/src/agents/workflow-pivot-loop.ts +13 -12
  39. package/src/bollharness-integration/channel-judgment-engine.ts +1 -1
  40. package/src/bollharness-integration/context-chain-router.ts +3 -3
  41. package/src/bollharness-integration/context-router.ts +1 -1
  42. package/src/documents/reader.ts +5 -0
  43. package/src/documents/store.ts +1 -1
  44. package/src/heartbeat/Watchdog.ts +7 -5
  45. package/src/heartbeat/index.ts +1 -0
  46. package/src/heartbeat/self-improve-bus.ts +110 -0
  47. package/src/llm/pi-ai.ts +6 -5
  48. package/src/network/iroh-discovery.ts +2 -1
  49. package/src/network/iroh-transport.ts +15 -2
  50. package/src/network/p2p.ts +9 -8
  51. package/src/network/storage/adapters/json-adapter.ts +17 -2
  52. package/src/network/storage/index.ts +19 -3
  53. package/src/social/channels/channel-heartbeat-agent.ts +1 -1
  54. package/src/types.d.ts +12 -0
  55. package/src/utils/auto-update.ts +45 -14
  56. package/src/web/client.js +839 -103
  57. package/src/web/index.html +88 -8
  58. package/src/web/server.ts +577 -102
  59. package/src/web/style.css +506 -9
  60. package/tsconfig.electron.json +1 -1
  61. package/tsconfig.json +1 -1
  62. package/dist/bollharness-integration/bollharness-integration/context-router-judgment.d.ts +0 -48
  63. package/dist/bollharness-integration/bollharness-integration/context-router-judgment.js +0 -261
  64. package/dist/bollharness-integration/bollharness-integration/context-router.d.ts +0 -110
  65. package/dist/bollharness-integration/bollharness-integration/context-router.js +0 -542
  66. package/dist/bollharness-integration/bollharness-integration/gate-state-machine.d.ts +0 -87
  67. package/dist/bollharness-integration/bollharness-integration/gate-state-machine.js +0 -231
  68. package/dist/bollharness-integration/bollharness-integration/gate-transition-hooks.d.ts +0 -30
  69. package/dist/bollharness-integration/bollharness-integration/gate-transition-hooks.js +0 -91
  70. package/dist/bollharness-integration/bollharness-integration/guard-checker.d.ts +0 -105
  71. package/dist/bollharness-integration/bollharness-integration/guard-checker.js +0 -353
  72. package/dist/bollharness-integration/bollharness-integration/index.d.ts +0 -66
  73. package/dist/bollharness-integration/bollharness-integration/index.js +0 -32
  74. package/dist/bollharness-integration/bollharness-integration/integration.d.ts +0 -219
  75. package/dist/bollharness-integration/bollharness-integration/integration.js +0 -420
  76. package/dist/bollharness-integration/bollharness-integration/skill-adapter.d.ts +0 -151
  77. package/dist/bollharness-integration/bollharness-integration/skill-adapter.js +0 -518
@@ -4,6 +4,18 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Bolloon Agent</title>
7
+
8
+ <!-- Favicon -->
9
+ <link rel="icon" type="image/x-icon" href="/icons/favicon.ico">
10
+ <link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
11
+ <link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
12
+
13
+ <!-- Apple Touch Icon -->
14
+ <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
15
+
16
+ <!-- PWA Manifest -->
17
+ <link rel="manifest" href="/manifest.json">
18
+
7
19
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
20
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
21
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600&display=swap" rel="stylesheet">
@@ -34,14 +46,20 @@
34
46
 
35
47
  <div class="sidebar-section">
36
48
  <div class="section-header">
37
- <span class="section-title">频道</span>
49
+ <span class="section-title">智能体</span>
50
+ <button id="catalog-add-btn" class="section-header-action" title="添加智能体">
51
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
52
+ <line x1="12" y1="5" x2="12" y2="19"></line>
53
+ <line x1="5" y1="12" x2="19" y2="12"></line>
54
+ </svg>
55
+ </button>
38
56
  </div>
39
- <button id="new-channel-btn" class="section-action" title="新建频道">
57
+ <button id="new-channel-btn" class="section-action" title="新建智能体">
40
58
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
41
59
  <line x1="12" y1="5" x2="12" y2="19"></line>
42
60
  <line x1="5" y1="12" x2="19" y2="12"></line>
43
61
  </svg>
44
- <span>新建</span>
62
+ <span>新建智能体</span>
45
63
  </button>
46
64
  <ul class="channel-list" id="channel-list"></ul>
47
65
  </div>
@@ -61,11 +79,6 @@
61
79
  <h1 id="channel-name">Bolloon Agent</h1>
62
80
  </div>
63
81
  <div class="header-right">
64
- <button id="new-session-btn" class="header-action" title="新会话">
65
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
66
- <path d="M12 5v14M5 12h14"></path>
67
- </svg>
68
- </button>
69
82
  <button id="theme-toggle" class="theme-toggle" title="切换主题">
70
83
  <svg class="sun-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
71
84
  <circle cx="12" cy="12" r="5"></circle>
@@ -97,6 +110,14 @@
97
110
  <line x1="12" y1="8" x2="19" y2="16"></line>
98
111
  </svg>
99
112
  </button>
113
+ <button id="wallet-btn" class="header-action" title="钱包管理">
114
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
115
+ <path d="M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-3"></path>
116
+ <circle cx="17" cy="12" r="1.5" fill="currentColor"></circle>
117
+ <path d="M3 7l3-3h12l3 3"></path>
118
+ </svg>
119
+ <span id="wallet-badge" class="task-badge" style="display:none;">0</span>
120
+ </button>
100
121
  <button id="task-queue-btn" class="header-action" title="任务队列">
101
122
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
102
123
  <path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"></path>
@@ -169,6 +190,77 @@
169
190
  </div>
170
191
  </div>
171
192
 
193
+ <!-- Agent Add / Wallet / Auto-tool Modal -->
194
+ <div id="agent-add-modal" class="modal">
195
+ <div class="modal-content">
196
+ <div class="modal-header">
197
+ <h2 id="agent-add-title">添加智能体</h2>
198
+ <button id="agent-add-modal-close" class="modal-close">&times;</button>
199
+ </div>
200
+ <div class="modal-body">
201
+ <div class="form-group">
202
+ <label>智能体名称</label>
203
+ <input type="text" id="agent-add-name" placeholder="例如: 交易助手">
204
+ </div>
205
+ <div class="form-group">
206
+ <label>加密钱包地址 (EVM 0x... 或 Solana/Sui 等)</label>
207
+ <div style="display:flex;gap:8px;">
208
+ <input type="text" id="agent-add-wallet" placeholder="0x... (留空则不绑定)" style="flex:1;">
209
+ <button type="button" id="agent-generate-wallet-btn" class="btn-secondary btn-sm" title="本地生成新钱包">生成</button>
210
+ </div>
211
+ <small class="form-hint">本地生成的钱包仅在浏览器内存, 服务端只保存公链地址, 不会上传私钥。</small>
212
+ </div>
213
+ <div class="form-group">
214
+ <label class="checkbox-label">
215
+ <input type="checkbox" id="agent-add-auto-tools" checked>
216
+ <span>启用自动工具调用 (LLM 决定调用受信任工具时, agent 自动执行)</span>
217
+ </label>
218
+ </div>
219
+ <div id="agent-add-wallet-info" class="form-info" style="display:none;"></div>
220
+ <div class="btn-group">
221
+ <button id="agent-add-cancel-btn" class="btn-secondary">取消</button>
222
+ <button id="agent-add-confirm-btn" class="btn-primary">创建</button>
223
+ </div>
224
+ </div>
225
+ </div>
226
+ </div>
227
+
228
+ <!-- Wallet Manager Modal (header 钱包按钮入口) -->
229
+ <div id="wallet-modal" class="modal">
230
+ <div class="modal-content modal-wide">
231
+ <div class="modal-header">
232
+ <h2>钱包管理</h2>
233
+ <button id="wallet-modal-close" class="modal-close">&times;</button>
234
+ </div>
235
+ <div class="modal-body">
236
+ <div class="form-group">
237
+ <label>为当前智能体绑定加密钱包</label>
238
+ <div style="display:flex;gap:8px;">
239
+ <input type="text" id="wallet-bind-address" placeholder="0x... / Solana / Sui" style="flex:1;">
240
+ <button type="button" id="wallet-generate-btn" class="btn-secondary btn-sm" title="本地生成新钱包">生成</button>
241
+ </div>
242
+ <small class="form-hint">仅当前激活智能体会使用此钱包; 服务端只保存公链地址, 私钥仅在浏览器内存。</small>
243
+ </div>
244
+ <div class="form-group">
245
+ <label class="checkbox-label">
246
+ <input type="checkbox" id="wallet-auto-tools" checked>
247
+ <span>启用自动工具调用 (LLM 决定调用受信任工具时, agent 自动执行)</span>
248
+ </label>
249
+ </div>
250
+ <div id="wallet-new-info" class="form-info" style="display:none;"></div>
251
+ <div class="btn-group">
252
+ <button id="wallet-bind-btn" class="btn-primary">绑定到当前智能体</button>
253
+ <button id="wallet-unbind-btn" class="btn-secondary">解绑当前智能体</button>
254
+ </div>
255
+
256
+ <h3 style="margin-top:24px;font-size:14px;font-weight:600;">所有已绑定钱包</h3>
257
+ <div id="wallet-list" class="wallet-list">
258
+ <div class="wallet-empty">暂未绑定钱包</div>
259
+ </div>
260
+ </div>
261
+ </div>
262
+ </div>
263
+
172
264
  <div class="messages" id="messages">
173
265
  <div class="message message-ai">
174
266
  <div class="bubble bubble-ai">