@bolloon/bolloon-agent 0.4.23 → 0.4.24

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.
@@ -183,6 +183,17 @@ export async function unlockWallet(id, pass) {
183
183
  return { address: w.address };
184
184
  }
185
185
  export function lockWallet(id) { unlockedKeys.delete(id); }
186
+ /** 导出钱包 (需已解锁): 地址 + 私钥 hex */
187
+ export async function exportWallet(id) {
188
+ const list = await loadWallets();
189
+ const rec = list.find((w) => w.id === id);
190
+ if (!rec)
191
+ throw new Error('钱包不存在');
192
+ const priv = unlockedKeys.get(id);
193
+ if (!priv)
194
+ throw new Error('钱包已锁定, 请先解锁');
195
+ return { address: rec.address, privateKey: '0x' + bytesToHex(priv) };
196
+ }
186
197
  export async function grantWallet(id, agentId, allow) {
187
198
  const list = await loadWallets();
188
199
  const w = list.find((x) => x.id === id);
@@ -664,3 +664,27 @@ body {
664
664
  .list-icon .ico { width: 21px; height: 21px; }
665
665
 
666
666
  .icon-btn .ico { width: 20px; height: 20px; }
667
+
668
+ /* 供应商选择: 芯片式 (API 配置页, 2026-09-14) */
669
+ .provider-chips {
670
+ display: flex;
671
+ flex-wrap: wrap;
672
+ gap: 8px;
673
+ }
674
+ .provider-chip {
675
+ padding: 8px 14px;
676
+ border: 1px solid var(--border);
677
+ border-radius: 999px;
678
+ background: var(--bg-hover);
679
+ color: var(--text-secondary);
680
+ font-size: 13px;
681
+ line-height: 1.2;
682
+ -webkit-tap-highlight-color: transparent;
683
+ }
684
+ .provider-chip:active { transform: scale(.96); }
685
+ .provider-chip.active {
686
+ border-color: var(--accent);
687
+ background: var(--accent);
688
+ color: var(--bg);
689
+ font-weight: 600;
690
+ }
@@ -34,9 +34,10 @@
34
34
  <div id="app" class="app">
35
35
  <!-- 顶部导航 -->
36
36
  <header class="topbar">
37
+ <button class="icon-btn" id="btn-index" title="索引"><svg class="ico" viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16"/></svg></button>
37
38
  <div class="topbar-title" id="topbar-title">首页</div>
38
39
  <div class="topbar-actions" id="topbar-actions">
39
- <button class="icon-btn" id="btn-refresh" title="刷新"><svg class="ico" viewBox="0 0 24 24"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v4.5h-4.5"/></svg></button>
40
+ <button class="icon-btn" id="btn-search" title="搜索"><svg class="ico" viewBox="0 0 24 24"><circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/></svg></button>
40
41
  <button class="icon-btn" id="btn-add" title="添加会话"><svg class="ico" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg></button>
41
42
  </div>
42
43
  </header>
@@ -60,31 +61,43 @@
60
61
  <div class="detail-body" id="detail-body"></div>
61
62
  </div>
62
63
  </main>
63
-
64
- <!-- 网络 tab -->
65
- <section class="page" id="page-network" data-tab="network" hidden>
64
+ <!-- 好友 tab: 好友与 P2P (原来散在网络页, 现已归拢; 网络页不再重复这些) -->
65
+ <section class="page" id="page-friends" data-tab="friends" hidden>
66
66
  <div class="list">
67
- <div class="list-item" id="item-join-net"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><path d="M3.5 9.5a13 13 0 0 1 17 0M6.5 13a8.5 8.5 0 0 1 11 0M9.6 16.3a4 4 0 0 1 4.8 0"/><circle cx="12" cy="19.5" r="1.1" fill="currentColor" stroke="none"/></svg></span><span>加入网络</span></div>
68
- <div class="list-item" id="item-scan-net"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><path d="M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2"/><path d="M4 12h16"/></svg></span><span>扫码入网</span></div>
67
+ <div class="list-item" id="item-add-friend"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3.2"/><path d="M3.5 19c.8-3 3-4.6 5.5-4.6S13.7 16 14.5 19"/><path d="M17 8v6M14 11h6"/></svg></span><span>连接好友</span><span class="list-arrow">›</span></div>
68
+ <div class="list-item" id="item-nearby"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><path d="M4 12a8 8 0 0 1 16 0"/><path d="M7.5 12a4.5 4.5 0 0 1 9 0"/><circle cx="12" cy="12" r="1.4"/><path d="M12 13.6V19"/></svg></span><span>附近设备</span><span class="list-arrow">›</span></div>
69
+ <div class="list-item" id="item-scan-net"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><path d="M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2"/><path d="M4 12h16"/></svg></span><span>扫码入网 / 加好友</span></div>
69
70
  </div>
70
71
  <input type="file" id="qr-scan-input" accept="image/*" capture="environment" style="display:none">
71
- <div class="section-label">P2P 连接</div>
72
- <div class="list" id="p2p-status"></div>
73
- <div class="section-label">Agent 网络</div>
74
- <div class="list" id="net-members"></div>
75
72
  <div class="list">
76
73
  <div class="list-item" id="item-p2p"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17"/><path d="M12 3.5c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5c-2.3-2.3-3.5-5.3-3.5-8.5S9.7 5.8 12 3.5z"/></svg></span><span>P2P 好友</span></div>
77
74
  <div class="list-item" id="item-p2p-id"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="5.5" width="18" height="13" rx="2.5"/><circle cx="8.5" cy="11" r="2"/><path d="M5.6 15.8a3.2 3.2 0 0 1 5.8 0M13.5 10h5M13.5 13.5h5"/></svg></span><span>我的 P2P ID</span></div>
78
75
  </div>
76
+ <div class="section-label">P2P 连接</div>
77
+ <div class="list" id="p2p-status"></div>
78
+ <div class="section-label">好友列表</div>
79
+ <div class="list" id="contacts-list"></div>
80
+ </section>
81
+
82
+ </main>
83
+
84
+ <!-- 网络 tab -->
85
+ <section class="page" id="page-network" data-tab="network" hidden>
86
+ <div class="list">
87
+ <div class="list-item" id="item-join-global"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17"/><path d="M12 3.5c2.7 2.6 2.7 14.4 0 17M12 3.5c-2.7 2.6-2.7 14.4 0 17"/><circle cx="12" cy="12" r="1.2" fill="currentColor" stroke="none"/></svg></span><span>一键入网 · 全球智能体网络</span><span class="list-arrow">›</span></div>
88
+ <div class="list-item" id="item-join-net"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><path d="M3.5 9.5a13 13 0 0 1 17 0M6.5 13a8.5 8.5 0 0 1 11 0M9.6 16.3a4 4 0 0 1 4.8 0"/><circle cx="12" cy="19.5" r="1.1" fill="currentColor" stroke="none"/></svg></span><span>加入网络</span><span class="list-arrow">›</span></div>
89
+ </div>
90
+ <div class="section-label">Agent 网络</div>
91
+ <div class="list" id="net-members"></div>
79
92
  <div class="section-label">Agent 服务 (协议自动发现)</div>
80
93
  <div class="list" id="agent-services"></div>
81
94
  <div class="list">
82
95
  <div class="list-item" id="item-trade"><span class="list-icon"><svg class="ico" viewBox="0 0 24 24"><path d="M4 7h16M4 12h10M4 17h7"/><path d="M17.5 14.5l2.5 2.5-2.5 2.5"/></svg></span><span style="flex:1">资源交易</span><span class="list-arrow">›</span></div>
83
96
  </div>
84
- <div class="section-label">P2P 好友列表</div>
85
- <div class="list" id="contacts-list"></div>
86
- <div class="section-label">MCP 工具 (触控调用)</div>
87
- <div class="list" id="mcp-tools"></div>
97
+ <div class="section-label">微信息 (微支付)</div>
98
+ <div class="list" id="x402-info-list"></div>
99
+ <div class="section-label">智能体控制 (MCP / Skills)</div>
100
+ <div class="list" id="agent-control"></div>
88
101
  <div class="section-label">待人工审批支付</div>
89
102
  <div class="list" id="approval-list"></div>
90
103
  <div class="section-label">A2UI 动态面板 (智能体生成)</div>
@@ -117,6 +130,7 @@
117
130
  <!-- 底部 tab -->
118
131
  <nav class="tabbar" id="tabbar">
119
132
  <button class="tab active" data-tab="main"><span class="tab-icon"><svg class="ico" viewBox="0 0 24 24"><rect x="3.5" y="3.5" width="7" height="7" rx="1.6"/><rect x="13.5" y="3.5" width="7" height="7" rx="1.6"/><rect x="3.5" y="13.5" width="7" height="7" rx="1.6"/><rect x="13.5" y="13.5" width="7" height="7" rx="1.6"/></svg></span><span>首页</span></button>
133
+ <button class="tab" data-tab="friends"><span class="tab-icon"><svg class="ico" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3.2"/><path d="M3.5 19c.8-3 3-4.6 5.5-4.6S13.7 16 14.5 19"/><path d="M17 8v6M14 11h6"/></svg></span><span>好友</span></button>
120
134
  <button class="tab" data-tab="network"><span class="tab-icon"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17"/><path d="M12 3.5c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5c-2.3-2.3-3.5-5.3-3.5-8.5S9.7 5.8 12 3.5z"/></svg></span><span>网络</span></button>
121
135
  <button class="tab" data-tab="me"><span class="tab-icon"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="8.5" r="4"/><path d="M4.5 20.5a7.5 7.5 0 0 1 15 0"/></svg></span><span>我</span></button>
122
136
  </nav>
@@ -132,15 +146,58 @@
132
146
  </div>
133
147
  </div>
134
148
 
135
- <!-- 添加好友: 底部滑出选择 sheet -->
149
+ <!-- 添加好友: 底部滑出选择 sheet (点按式: 扫码 / 附近 / 待处理申请 / 手动) -->
136
150
  <div class="sheet" id="addfriend-sheet" hidden>
137
151
  <div class="sheet-inner sheet-inner-choices">
138
- <div class="sheet-title">添加 P2P 好友</div>
152
+ <div class="sheet-title">连接好友</div>
153
+ <button class="sheet-choice" id="choice-nearby"><svg class="ico" viewBox="0 0 24 24"><path d="M4 12a8 8 0 0 1 16 0"/><path d="M7.5 12a4.5 4.5 0 0 1 9 0"/><circle cx="12" cy="12" r="1.4"/><path d="M12 13.6V19"/></svg> 附近的设备</button>
139
154
  <button class="sheet-choice" id="choice-scan"><svg class="ico" viewBox="0 0 24 24"><path d="M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2"/><path d="M4 12h16"/></svg> 扫码添加</button>
140
- <button class="sheet-choice" id="choice-manual"><svg class="ico" viewBox="0 0 24 24"><path d="M10.5 13.5a3.5 3.5 0 0 1 0-5l2-2a3.5 3.5 0 0 1 5 5l-1 1"/><path d="M13.5 10.5a3.5 3.5 0 0 1 0 5l-2 2a3.5 3.5 0 0 1-5-5l1-1"/></svg> 手动输入地址</button>
155
+ <button class="sheet-choice" id="choice-requests"><svg class="ico" viewBox="0 0 24 24"><path d="M6 4h9l4 4v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z"/><path d="M9 12h6M9 16h4"/></svg> 待处理申请</button>
156
+ <button class="sheet-choice sheet-cancel" id="choice-manual">⌨️ 手动输入地址 (兜底)</button>
141
157
  <button class="sheet-choice sheet-cancel" id="choice-cancel">取消</button>
142
158
  </div>
143
159
  </div>
160
+
161
+ <!-- 加入网络: 点按式 sheet (扫一扫 / 附近设备 / 手动粘贴兜底) -->
162
+ <div class="sheet" id="network-sheet" hidden>
163
+ <div class="sheet-inner sheet-inner-choices">
164
+ <div class="sheet-title">加入网络</div>
165
+ <button class="sheet-choice" id="choice-join-nearby"><svg class="ico" viewBox="0 0 24 24"><path d="M4 12a8 8 0 0 1 16 0"/><path d="M7.5 12a4.5 4.5 0 0 1 9 0"/><circle cx="12" cy="12" r="1.4"/><path d="M12 13.6V19"/></svg> 附近的电脑 / 设备</button>
166
+ <button class="sheet-choice" id="choice-join-scan"><svg class="ico" viewBox="0 0 24 24"><path d="M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2"/><path d="M4 12h16"/></svg> 扫电脑上的二维码</button>
167
+ <button class="sheet-choice sheet-cancel" id="choice-join-manual">🔗 粘贴入网链接 (兜底)</button>
168
+ <button class="sheet-choice sheet-cancel" id="choice-join-cancel">取消</button>
169
+ </div>
170
+ </div>
171
+
172
+ <!-- 附近设备: 点按列表 (点一条即连接 / 建立好友) -->
173
+ <div class="sheet" id="nearby-sheet" hidden>
174
+ <div class="sheet-inner">
175
+ <div class="sheet-title" id="nearby-title">附近设备</div>
176
+ <div class="sheet-text" id="nearby-hint">正在查找...</div>
177
+ <div class="list" id="nearby-list" style="width:100%;max-height:46vh;overflow-y:auto"></div>
178
+ <button class="sheet-choice" id="nearby-refresh">↻ 刷新</button>
179
+ <button class="sheet-choice sheet-cancel" id="nearby-close">关闭</button>
180
+ </div>
181
+ </div>
182
+ <!-- 微信息 (x402 付费信息): 点一条看详情 → 购买并验真 / 只看元数据 -->
183
+ <div class="sheet" id="x402-sheet" hidden>
184
+ <div class="sheet-inner">
185
+ <div class="sheet-title" id="x402-title">微信息</div>
186
+ <div class="sheet-text" id="x402-body" style="width:100%;max-height:46vh;overflow-y:auto;text-align:left;white-space:pre-wrap;word-break:break-word"></div>
187
+ <button class="sheet-choice" id="x402-buy">购买并验真</button>
188
+ <button class="sheet-choice" id="x402-verify">只看元数据 (离线验真)</button>
189
+ <button class="sheet-choice sheet-cancel" id="x402-close">关闭</button>
190
+ </div>
191
+ </div>
192
+
193
+ <!-- 微信息结果: 内容 + 验真分档 (verified / self-attested / content-only / unverified) -->
194
+ <div class="sheet" id="x402-result-sheet" hidden>
195
+ <div class="sheet-inner">
196
+ <div class="sheet-title" id="x402-result-title">验真结果</div>
197
+ <div class="sheet-text" id="x402-result-body" style="width:100%;max-height:56vh;overflow-y:auto;text-align:left;white-space:pre-wrap;word-break:break-word"></div>
198
+ <button class="sheet-choice sheet-cancel" id="x402-result-close">关闭</button>
199
+ </div>
200
+ </div>
144
201
  </div>
145
202
 
146
203
  <!-- 2026-08-14: 手机端内化内核 (IndexedDB 数据 + 本地身份 + 支付审批 + Agent). 必须最先加载 -->