@bolloon/bolloon-agent 0.4.2 → 0.4.3
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/documents/reader.js +9 -4
- package/dist/web/client.js +22 -16
- package/package.json +37 -38
package/dist/documents/reader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs/promises';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
-
import
|
|
3
|
+
import { PDFParse } from 'pdf-parse';
|
|
4
4
|
import mammoth from 'mammoth';
|
|
5
5
|
export class DocumentReader {
|
|
6
6
|
async read(filePath) {
|
|
@@ -55,9 +55,14 @@ export class DocumentReader {
|
|
|
55
55
|
}
|
|
56
56
|
async readPdf(filePath) {
|
|
57
57
|
const dataBuffer = await fs.readFile(filePath);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const parser = new PDFParse({ data: dataBuffer });
|
|
59
|
+
try {
|
|
60
|
+
const result = await parser.getText();
|
|
61
|
+
return result.text;
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
await parser.destroy();
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
async readDocx(filePath) {
|
|
63
68
|
const result = await mammoth.extractRawText({ path: filePath });
|
package/dist/web/client.js
CHANGED
|
@@ -10,8 +10,13 @@
|
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
12
|
});
|
|
13
|
-
var __esm = (fn, res) => function __init() {
|
|
14
|
-
|
|
13
|
+
var __esm = (fn, res, err) => function __init() {
|
|
14
|
+
if (err) throw err[0];
|
|
15
|
+
try {
|
|
16
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw err = [e], e;
|
|
19
|
+
}
|
|
15
20
|
};
|
|
16
21
|
var __export = (target, all) => {
|
|
17
22
|
for (var name in all)
|
|
@@ -379,10 +384,11 @@
|
|
|
379
384
|
if (!content) return null;
|
|
380
385
|
const strippedContent = content.replace(/<think[\s\S]*?<\/think/g, "");
|
|
381
386
|
try {
|
|
382
|
-
const result = /* @__PURE__ */ function _diagProbe() {
|
|
387
|
+
const result = /* @__PURE__ */ (function _diagProbe() {
|
|
383
388
|
return null;
|
|
384
|
-
}();
|
|
385
|
-
|
|
389
|
+
})();
|
|
390
|
+
void result;
|
|
391
|
+
const probe = (function _doParse() {
|
|
386
392
|
const m1 = strippedContent.match(/<invoke\s+name=["']([\w]+)["']/);
|
|
387
393
|
if (m1) {
|
|
388
394
|
return { name: m1[1], args: { __probe_invoketag: "1" } };
|
|
@@ -396,7 +402,7 @@
|
|
|
396
402
|
return { name: m3[1], args: { __probe_json_name: "1" } };
|
|
397
403
|
}
|
|
398
404
|
return null;
|
|
399
|
-
}();
|
|
405
|
+
})();
|
|
400
406
|
console.warn(
|
|
401
407
|
"[parseToolCall diag] rawLen=" + content.length + " strippedLen=" + strippedContent.length + " probeName=" + (probe?.name ?? "null") + " rawHead=" + JSON.stringify(content.slice(0, 500))
|
|
402
408
|
);
|
|
@@ -1609,22 +1615,22 @@
|
|
|
1609
1615
|
var lastSeenMsgIds = /* @__PURE__ */ new Map();
|
|
1610
1616
|
var COLLAPSED_PEERS_KEY = "bolloon.p2p.collapsedPeers";
|
|
1611
1617
|
var SEEN_PEERS_KEY = "bolloon.p2p.seenPeers";
|
|
1612
|
-
var collapsedPeers = function loadCollapsed() {
|
|
1618
|
+
var collapsedPeers = (function loadCollapsed() {
|
|
1613
1619
|
try {
|
|
1614
1620
|
const raw = localStorage.getItem(COLLAPSED_PEERS_KEY);
|
|
1615
1621
|
return new Set(raw ? JSON.parse(raw) : []);
|
|
1616
1622
|
} catch {
|
|
1617
1623
|
return /* @__PURE__ */ new Set();
|
|
1618
1624
|
}
|
|
1619
|
-
}();
|
|
1620
|
-
var seenPeers = function loadSeen() {
|
|
1625
|
+
})();
|
|
1626
|
+
var seenPeers = (function loadSeen() {
|
|
1621
1627
|
try {
|
|
1622
1628
|
const raw = localStorage.getItem(SEEN_PEERS_KEY);
|
|
1623
1629
|
return new Set(raw ? JSON.parse(raw) : []);
|
|
1624
1630
|
} catch {
|
|
1625
1631
|
return /* @__PURE__ */ new Set();
|
|
1626
1632
|
}
|
|
1627
|
-
}();
|
|
1633
|
+
})();
|
|
1628
1634
|
function saveCollapsedPeers() {
|
|
1629
1635
|
try {
|
|
1630
1636
|
localStorage.setItem(COLLAPSED_PEERS_KEY, JSON.stringify([...collapsedPeers]));
|
|
@@ -5845,7 +5851,7 @@ ${m.content}`, "user", false, log);
|
|
|
5845
5851
|
}
|
|
5846
5852
|
var p2pToggleAllBtn = document.getElementById("p2p-toggle-all-btn");
|
|
5847
5853
|
if (p2pToggleAllBtn) {
|
|
5848
|
-
let
|
|
5854
|
+
let syncToggleAllBtn2 = function() {
|
|
5849
5855
|
const allPks = /* @__PURE__ */ new Set([
|
|
5850
5856
|
...knownPeers.map((p) => p.publicKey),
|
|
5851
5857
|
...remoteChannels.map((g) => g.peerId)
|
|
@@ -5866,7 +5872,7 @@ ${m.content}`, "user", false, log);
|
|
|
5866
5872
|
p2pToggleAllBtn.title = "\u70B9\u51FB\u6298\u53E0\u6240\u6709 P2P \u597D\u53CB";
|
|
5867
5873
|
}
|
|
5868
5874
|
};
|
|
5869
|
-
|
|
5875
|
+
syncToggleAllBtn = syncToggleAllBtn2;
|
|
5870
5876
|
p2pToggleAllBtn.addEventListener("click", (e) => {
|
|
5871
5877
|
e.stopPropagation();
|
|
5872
5878
|
const allPks = /* @__PURE__ */ new Set([
|
|
@@ -5882,12 +5888,12 @@ ${m.content}`, "user", false, log);
|
|
|
5882
5888
|
} else {
|
|
5883
5889
|
collapseAllPeers();
|
|
5884
5890
|
}
|
|
5885
|
-
|
|
5891
|
+
syncToggleAllBtn2();
|
|
5886
5892
|
});
|
|
5887
|
-
window.__syncP2PToggleAllBtn =
|
|
5888
|
-
|
|
5893
|
+
window.__syncP2PToggleAllBtn = syncToggleAllBtn2;
|
|
5894
|
+
syncToggleAllBtn2();
|
|
5889
5895
|
}
|
|
5890
|
-
var
|
|
5896
|
+
var syncToggleAllBtn;
|
|
5891
5897
|
var refreshSharedBtn = document.getElementById("refresh-shared-btn");
|
|
5892
5898
|
if (refreshSharedBtn) {
|
|
5893
5899
|
refreshSharedBtn.addEventListener("click", async (e) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "@bolloon/bolloon-agent",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "P2P AI Document Agent - 全局安装后执行 `bolloon` 启动产品",
|
|
6
6
|
"main": "dist/cli-entry.js",
|
|
@@ -55,11 +55,10 @@
|
|
|
55
55
|
"src/constraint-runtime"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@bolloon/bolloon-agent": "^0.3.22",
|
|
59
58
|
"@bolloon/constraint-runtime": "0.1.0",
|
|
60
|
-
"@capacitor/android": "^8.
|
|
61
|
-
"@capacitor/core": "^8.
|
|
62
|
-
"@capacitor/ios": "^8.
|
|
59
|
+
"@capacitor/android": "^8.5.0",
|
|
60
|
+
"@capacitor/core": "^8.5.0",
|
|
61
|
+
"@capacitor/ios": "^8.5.0",
|
|
63
62
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
64
63
|
"@chainsafe/libp2p-yamux": "^8.0.1",
|
|
65
64
|
"@diap/sdk": "^0.2.4",
|
|
@@ -72,57 +71,57 @@
|
|
|
72
71
|
"@libp2p/tcp": "^11.0.20",
|
|
73
72
|
"@libp2p/upnp-nat": "^4.0.20",
|
|
74
73
|
"@multiformats/multiaddr": "^13.0.3",
|
|
75
|
-
"@noble/hashes": "^
|
|
74
|
+
"@noble/hashes": "^2.3.0",
|
|
76
75
|
"@orbitdb/core": "^4.0.0",
|
|
77
|
-
"@polymarket/client": "^0.
|
|
76
|
+
"@polymarket/client": "^0.5.0",
|
|
78
77
|
"@rayhanadev/iroh": "^0.1.1",
|
|
79
|
-
"@x402/aptos": "^2.
|
|
80
|
-
"@x402/avm": "^2.
|
|
81
|
-
"@x402/axios": "^2.
|
|
82
|
-
"@x402/core": "^2.
|
|
83
|
-
"@x402/evm": "^2.
|
|
84
|
-
"@x402/express": "^2.
|
|
85
|
-
"@x402/extensions": "^2.
|
|
86
|
-
"@x402/fastify": "^2.
|
|
87
|
-
"@x402/fetch": "^2.
|
|
88
|
-
"@x402/hedera": "^2.
|
|
89
|
-
"@x402/hono": "^2.
|
|
90
|
-
"@x402/keeta": "^2.
|
|
91
|
-
"@x402/mcp": "^2.
|
|
92
|
-
"@x402/next": "^2.
|
|
93
|
-
"@x402/paywall": "^2.
|
|
94
|
-
"@x402/stellar": "^2.
|
|
95
|
-
"@x402/svm": "^2.
|
|
96
|
-
"@x402/tvm": "^2.
|
|
78
|
+
"@x402/aptos": "^2.21.0",
|
|
79
|
+
"@x402/avm": "^2.21.0",
|
|
80
|
+
"@x402/axios": "^2.21.0",
|
|
81
|
+
"@x402/core": "^2.21.0",
|
|
82
|
+
"@x402/evm": "^2.21.0",
|
|
83
|
+
"@x402/express": "^2.21.0",
|
|
84
|
+
"@x402/extensions": "^2.21.0",
|
|
85
|
+
"@x402/fastify": "^2.21.0",
|
|
86
|
+
"@x402/fetch": "^2.21.0",
|
|
87
|
+
"@x402/hedera": "^2.21.0",
|
|
88
|
+
"@x402/hono": "^2.21.0",
|
|
89
|
+
"@x402/keeta": "^2.21.0",
|
|
90
|
+
"@x402/mcp": "^2.21.0",
|
|
91
|
+
"@x402/next": "^2.21.0",
|
|
92
|
+
"@x402/paywall": "^2.21.0",
|
|
93
|
+
"@x402/stellar": "^2.21.0",
|
|
94
|
+
"@x402/svm": "^2.21.0",
|
|
95
|
+
"@x402/tvm": "^2.21.0",
|
|
97
96
|
"b4a": "^1.8.1",
|
|
98
97
|
"dotenv": "^17.4.2",
|
|
99
|
-
"esbuild": "^0.24.0",
|
|
100
98
|
"express": "^5.2.1",
|
|
101
99
|
"helia": "^7.1.3",
|
|
102
100
|
"ink": "^7.1.1",
|
|
103
101
|
"ink-text-input": "^6.0.0",
|
|
104
|
-
"libp2p": "^3.3.
|
|
105
|
-
"mammoth": "^1.
|
|
106
|
-
"pdf-parse": "^
|
|
102
|
+
"libp2p": "^3.3.8",
|
|
103
|
+
"mammoth": "^1.12.1",
|
|
104
|
+
"pdf-parse": "^2.4.5",
|
|
107
105
|
"platform": "^1.3.6",
|
|
108
106
|
"react": "^19.2.8",
|
|
109
107
|
"react-dom": "^19.2.8",
|
|
110
|
-
"viem": "^2.
|
|
108
|
+
"viem": "^2.55.13"
|
|
111
109
|
},
|
|
112
110
|
"devDependencies": {
|
|
113
|
-
"@capacitor/cli": "^8.
|
|
114
|
-
"@playwright/test": "^1.
|
|
111
|
+
"@capacitor/cli": "^8.5.0",
|
|
112
|
+
"@playwright/test": "^1.62.1",
|
|
115
113
|
"@types/express": "^5.0.6",
|
|
116
114
|
"@types/node": "^25.9.1",
|
|
117
115
|
"@types/pdf-parse": "^1.1.5",
|
|
118
116
|
"@types/react": "^19.2.18",
|
|
119
117
|
"@types/react-dom": "^19.2.4",
|
|
120
|
-
"concurrently": "^
|
|
121
|
-
"electron": "^
|
|
122
|
-
"electron-builder": "^26.15.
|
|
118
|
+
"concurrently": "^10.0.4",
|
|
119
|
+
"electron": "^43.3.0",
|
|
120
|
+
"electron-builder": "^26.15.7",
|
|
121
|
+
"esbuild": "^0.28.2",
|
|
123
122
|
"lefthook": "^2.1.9",
|
|
124
|
-
"playwright": "^1.
|
|
125
|
-
"tsx": "^4.
|
|
123
|
+
"playwright": "^1.62.1",
|
|
124
|
+
"tsx": "^4.23.12",
|
|
126
125
|
"typescript": "^5.0.0",
|
|
127
126
|
"vitest": "^4.1.6"
|
|
128
127
|
},
|