agentbnb 3.1.6 → 4.0.1
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/README.md +117 -86
- package/dist/{card-IE5UV5QX.js → card-4XH4AOTE.js} +11 -4
- package/dist/chunk-3MJT4PZG.js +50 -0
- package/dist/{conduct-IEQ567ET.js → chunk-3UKAVIMC.js} +70 -31
- package/dist/chunk-5AH3CMOX.js +62 -0
- package/dist/{chunk-IZZ4FP45.js → chunk-6K5WUVF3.js} +33 -166
- package/dist/chunk-75OC6E4F.js +33 -0
- package/dist/chunk-DVAS2443.js +63 -0
- package/dist/{chunk-XA63SD4T.js → chunk-FNKBHBYK.js} +3 -0
- package/dist/{websocket-client-5TIQDYQ4.js → chunk-JOY533UH.js} +38 -4
- package/dist/chunk-KJG2UJV5.js +83 -0
- package/dist/chunk-M3G5NR2Z.js +90 -0
- package/dist/{chunk-7OACGAFD.js → chunk-MQKYGY5I.js} +63 -24
- package/dist/chunk-ODBGCCEH.js +358 -0
- package/dist/{chunk-QSPWE5AE.js → chunk-Q7HRI666.js} +9 -6
- package/dist/chunk-QJEOCKVF.js +148 -0
- package/dist/{chunk-3Y36WQDV.js → chunk-QT7TEVNV.js} +14 -2
- package/dist/{chunk-UOGDK2S2.js → chunk-TLU7ALCZ.js} +1 -1
- package/dist/{chunk-QHQPXO67.js → chunk-XQHN6ITI.js} +1 -58
- package/dist/cli/index.js +2734 -850
- package/dist/client-BTPIFY7E.js +10 -0
- package/dist/conduct-CW62HBPT.js +52 -0
- package/dist/conduct-FXLVGKD5.js +19 -0
- package/dist/{conductor-mode-IO45PWMI.js → conductor-mode-3JS4VWCR.js} +16 -7
- package/dist/execute-EXOITLHN.js +10 -0
- package/dist/index.d.ts +1005 -916
- package/dist/index.js +516 -120
- package/dist/{peers-G36URZYB.js → peers-K7FSHPN3.js} +2 -1
- package/dist/request-CNZ3XIVX.js +196 -0
- package/dist/serve-skill-SUOGUM7N.js +104 -0
- package/dist/server-2LWHL24P.js +295 -0
- package/dist/types-FGBUZ3QV.js +18 -0
- package/dist/websocket-client-6IIDGXKB.js +7 -0
- package/package.json +4 -1
- package/dist/chunk-BEI5MTNZ.js +0 -91
- package/dist/cli/index.d.ts +0 -1
- package/dist/execute-SWWEHV2K.js +0 -9
package/dist/chunk-BEI5MTNZ.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// src/cli/peers.ts
|
|
2
|
-
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
3
|
-
import { join as join2 } from "path";
|
|
4
|
-
|
|
5
|
-
// src/cli/config.ts
|
|
6
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
|
|
7
|
-
import { homedir } from "os";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
function getConfigDir() {
|
|
10
|
-
return process.env["AGENTBNB_DIR"] ?? join(homedir(), ".agentbnb");
|
|
11
|
-
}
|
|
12
|
-
function getConfigPath() {
|
|
13
|
-
return join(getConfigDir(), "config.json");
|
|
14
|
-
}
|
|
15
|
-
function loadConfig() {
|
|
16
|
-
const configPath = getConfigPath();
|
|
17
|
-
if (!existsSync(configPath)) return null;
|
|
18
|
-
try {
|
|
19
|
-
const raw = readFileSync(configPath, "utf-8");
|
|
20
|
-
return JSON.parse(raw);
|
|
21
|
-
} catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function saveConfig(config) {
|
|
26
|
-
const dir = getConfigDir();
|
|
27
|
-
if (!existsSync(dir)) {
|
|
28
|
-
mkdirSync(dir, { recursive: true });
|
|
29
|
-
}
|
|
30
|
-
writeFileSync(getConfigPath(), JSON.stringify(config, null, 2), "utf-8");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// src/cli/peers.ts
|
|
34
|
-
function getPeersPath() {
|
|
35
|
-
return join2(getConfigDir(), "peers.json");
|
|
36
|
-
}
|
|
37
|
-
function loadPeers() {
|
|
38
|
-
const peersPath = getPeersPath();
|
|
39
|
-
if (!existsSync2(peersPath)) {
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
try {
|
|
43
|
-
const raw = readFileSync2(peersPath, "utf-8");
|
|
44
|
-
return JSON.parse(raw);
|
|
45
|
-
} catch {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function writePeers(peers) {
|
|
50
|
-
const dir = getConfigDir();
|
|
51
|
-
if (!existsSync2(dir)) {
|
|
52
|
-
mkdirSync2(dir, { recursive: true });
|
|
53
|
-
}
|
|
54
|
-
writeFileSync2(getPeersPath(), JSON.stringify(peers, null, 2), "utf-8");
|
|
55
|
-
}
|
|
56
|
-
function savePeer(peer) {
|
|
57
|
-
const peers = loadPeers();
|
|
58
|
-
const lowerName = peer.name.toLowerCase();
|
|
59
|
-
const existing = peers.findIndex((p) => p.name.toLowerCase() === lowerName);
|
|
60
|
-
if (existing >= 0) {
|
|
61
|
-
peers[existing] = peer;
|
|
62
|
-
} else {
|
|
63
|
-
peers.push(peer);
|
|
64
|
-
}
|
|
65
|
-
writePeers(peers);
|
|
66
|
-
}
|
|
67
|
-
function removePeer(name) {
|
|
68
|
-
const peers = loadPeers();
|
|
69
|
-
const lowerName = name.toLowerCase();
|
|
70
|
-
const filtered = peers.filter((p) => p.name.toLowerCase() !== lowerName);
|
|
71
|
-
if (filtered.length === peers.length) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
writePeers(filtered);
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
function findPeer(name) {
|
|
78
|
-
const peers = loadPeers();
|
|
79
|
-
const lowerName = name.toLowerCase();
|
|
80
|
-
return peers.find((p) => p.name.toLowerCase() === lowerName) ?? null;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
getConfigDir,
|
|
85
|
-
loadConfig,
|
|
86
|
-
saveConfig,
|
|
87
|
-
loadPeers,
|
|
88
|
-
savePeer,
|
|
89
|
-
removePeer,
|
|
90
|
-
findPeer
|
|
91
|
-
};
|
package/dist/cli/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|