@bolloon/bolloon-agent 0.2.0 → 0.2.2
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/judgment-protocol.js +479 -0
- package/dist/agents/pi-sdk.js +269 -1
- package/dist/electron/config.js +9 -14
- package/dist/electron/dialogs.js +16 -53
- package/dist/electron/first-run.js +24 -65
- package/dist/electron/ipc.js +10 -14
- package/dist/electron/logger.js +7 -44
- package/dist/electron/main.js +38 -41
- package/dist/electron/menu.js +13 -18
- package/dist/electron/paths.js +12 -54
- package/dist/electron/server.js +18 -56
- package/dist/electron/tray.js +15 -53
- package/dist/electron/window.js +22 -61
- package/dist/security/tool-gate.js +4 -0
- package/dist/web/client.js +3767 -2873
- package/dist/web/components/p2p/P2PModal.js +188 -0
- package/dist/web/components/p2p/index.js +264 -226
- package/dist/web/components/p2p/p2p-modal.js +657 -0
- package/dist/web/components/p2p/p2p-tools.js +248 -0
- package/dist/web/ui/message-renderer.js +442 -326
- package/dist/web/ui/step-timeline.js +351 -255
- package/ios/App/App/AppDelegate.swift +49 -0
- package/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
- package/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/ios/App/App/Assets.xcassets/Contents.json +6 -0
- package/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
- package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
- package/ios/App/App/Base.lproj/Main.storyboard +19 -0
- package/ios/App/App/Info.plist +88 -0
- package/ios/App/App.xcodeproj/project.pbxproj +376 -0
- package/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/App/CapApp-SPM/Package.swift +25 -0
- package/ios/App/CapApp-SPM/README.md +5 -0
- package/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift +1 -0
- package/ios/debug.xcconfig +1 -0
- package/package.json +14 -3
- package/scripts/build-app-bundle.cjs +170 -0
- package/.comm/README.md +0 -21
- package/.comm/default/2026-06-17T08-23-00-017Z-8a735de8.md +0 -7
package/dist/electron/window.js
CHANGED
|
@@ -1,60 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getMainWindow = getMainWindow;
|
|
37
|
-
exports.createMainWindow = createMainWindow;
|
|
38
|
-
exports.focusMainWindow = focusMainWindow;
|
|
39
1
|
/**
|
|
40
2
|
* 主窗口工厂 — preload 路径解析 + dev/prod loadURL + 外部链接走系统浏览器
|
|
41
3
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
4
|
+
import { BrowserWindow, shell } from 'electron';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { log } from './logger';
|
|
7
|
+
import { isDev, MAIN_WINDOW_DEFAULT, MAIN_WINDOW_MIN, preferredPort } from './config';
|
|
8
|
+
import { startWebServer } from './server';
|
|
47
9
|
let mainWindow = null;
|
|
48
|
-
function getMainWindow() {
|
|
10
|
+
export function getMainWindow() {
|
|
49
11
|
return mainWindow;
|
|
50
12
|
}
|
|
51
|
-
async function createMainWindow() {
|
|
52
|
-
|
|
53
|
-
mainWindow = new
|
|
54
|
-
width:
|
|
55
|
-
height:
|
|
56
|
-
minWidth:
|
|
57
|
-
minHeight:
|
|
13
|
+
export async function createMainWindow() {
|
|
14
|
+
log('创建主窗口...');
|
|
15
|
+
mainWindow = new BrowserWindow({
|
|
16
|
+
width: MAIN_WINDOW_DEFAULT.width,
|
|
17
|
+
height: MAIN_WINDOW_DEFAULT.height,
|
|
18
|
+
minWidth: MAIN_WINDOW_MIN.width,
|
|
19
|
+
minHeight: MAIN_WINDOW_MIN.height,
|
|
58
20
|
title: 'Bolloon Agent',
|
|
59
21
|
webPreferences: {
|
|
60
22
|
nodeIntegration: false,
|
|
@@ -64,40 +26,40 @@ async function createMainWindow() {
|
|
|
64
26
|
},
|
|
65
27
|
show: false,
|
|
66
28
|
});
|
|
67
|
-
if (
|
|
29
|
+
if (isDev) {
|
|
68
30
|
// dev:web 用 tsx 起 server, 端口固定 preferredPort, 不会 EADDRINUSE 自增
|
|
69
|
-
const port =
|
|
31
|
+
const port = preferredPort();
|
|
70
32
|
mainWindow.loadURL(`http://localhost:${port}`);
|
|
71
33
|
mainWindow.webContents.openDevTools();
|
|
72
34
|
}
|
|
73
35
|
else {
|
|
74
36
|
try {
|
|
75
|
-
|
|
76
|
-
const { port: actualPort } = await
|
|
37
|
+
log('启动内置 Web 服务器...');
|
|
38
|
+
const { port: actualPort } = await startWebServer(preferredPort());
|
|
77
39
|
mainWindow.loadURL(`http://localhost:${actualPort}`);
|
|
78
40
|
}
|
|
79
41
|
catch (err) {
|
|
80
|
-
|
|
42
|
+
log(`启动服务器失败: ${err.message}`, 'error');
|
|
81
43
|
console.error('启动服务器失败:', err);
|
|
82
44
|
}
|
|
83
45
|
}
|
|
84
46
|
mainWindow.once('ready-to-show', () => {
|
|
85
47
|
mainWindow?.show();
|
|
86
|
-
|
|
48
|
+
log('窗口已显示');
|
|
87
49
|
});
|
|
88
50
|
// 外部链接走系统浏览器, 不在 app 内开新窗口
|
|
89
51
|
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
|
90
52
|
if (url.startsWith('http://') || url.startsWith('https://')) {
|
|
91
|
-
|
|
53
|
+
shell.openExternal(url);
|
|
92
54
|
}
|
|
93
55
|
return { action: 'deny' };
|
|
94
56
|
});
|
|
95
57
|
mainWindow.on('closed', () => {
|
|
96
58
|
mainWindow = null;
|
|
97
59
|
});
|
|
98
|
-
|
|
60
|
+
log('窗口创建完成');
|
|
99
61
|
}
|
|
100
|
-
function focusMainWindow() {
|
|
62
|
+
export function focusMainWindow() {
|
|
101
63
|
if (!mainWindow)
|
|
102
64
|
return;
|
|
103
65
|
if (mainWindow.isMinimized())
|
|
@@ -105,4 +67,3 @@ function focusMainWindow() {
|
|
|
105
67
|
mainWindow.show();
|
|
106
68
|
mainWindow.focus();
|
|
107
69
|
}
|
|
108
|
-
//# sourceMappingURL=window.js.map
|
|
@@ -32,6 +32,10 @@ const TOOL_WHITELIST = new Set([
|
|
|
32
32
|
'vitest_run', 'tsc_check',
|
|
33
33
|
// 2026-06-19: Agent Mesh 通信工具 (跟 pi-sdk.ts registerTools 同步)
|
|
34
34
|
'check_inbox', 'send_to_peer', 'p2p_broadcast', 'send_to_local_agent', 'list_local_agents', 'agent_call',
|
|
35
|
+
// 2026-06-24: Wallet + Polymarket + Safe 工具 (跟 pi-sdk.ts _registerWalletTools 同步)
|
|
36
|
+
'wallet_create', 'wallet_import', 'wallet_get_balance', 'wallet_sign_message', 'wallet_send_tx', 'wallet_transfer_token', 'wallet_autopay',
|
|
37
|
+
'polymarket_list_markets', 'polymarket_get_market', 'polymarket_get_orders', 'polymarket_create_order', 'polymarket_cancel_order',
|
|
38
|
+
'safe_deploy',
|
|
35
39
|
// MCP 注册的工具
|
|
36
40
|
'mcp_tool',
|
|
37
41
|
]);
|