@annals/agent-mesh 0.17.4 → 0.17.6
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/index.js +37 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -50,7 +50,24 @@ function hasToken() {
|
|
|
50
50
|
// src/platform/ws-client.ts
|
|
51
51
|
import { EventEmitter } from "events";
|
|
52
52
|
import WebSocket from "ws";
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
// ../protocol/dist/errors.js
|
|
55
|
+
var BridgeErrorCode = {
|
|
56
|
+
TIMEOUT: "timeout",
|
|
57
|
+
ADAPTER_CRASH: "adapter_crash",
|
|
58
|
+
AGENT_BUSY: "agent_busy",
|
|
59
|
+
AUTH_FAILED: "auth_failed",
|
|
60
|
+
AGENT_OFFLINE: "agent_offline",
|
|
61
|
+
INVALID_MESSAGE: "invalid_message",
|
|
62
|
+
SESSION_NOT_FOUND: "session_not_found",
|
|
63
|
+
RATE_LIMITED: "rate_limited",
|
|
64
|
+
INTERNAL_ERROR: "internal_error"
|
|
65
|
+
};
|
|
66
|
+
var WS_CLOSE_REPLACED = 4001;
|
|
67
|
+
var WS_CLOSE_TOKEN_REVOKED = 4002;
|
|
68
|
+
|
|
69
|
+
// ../protocol/dist/version.js
|
|
70
|
+
var BRIDGE_PROTOCOL_VERSION = 2;
|
|
54
71
|
|
|
55
72
|
// src/utils/logger.ts
|
|
56
73
|
var RESET2 = "\x1B[0m";
|
|
@@ -266,9 +283,6 @@ var BridgeWSClient = class extends EventEmitter {
|
|
|
266
283
|
}
|
|
267
284
|
};
|
|
268
285
|
|
|
269
|
-
// src/bridge/manager.ts
|
|
270
|
-
import { BridgeErrorCode } from "@annals/bridge-protocol";
|
|
271
|
-
|
|
272
286
|
// src/utils/webrtc-transfer.ts
|
|
273
287
|
import { createHash } from "crypto";
|
|
274
288
|
import { createRequire } from "module";
|
|
@@ -1652,8 +1666,18 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
1652
1666
|
]);
|
|
1653
1667
|
async function collectRealFiles(dir, maxFiles = Infinity) {
|
|
1654
1668
|
const files = [];
|
|
1669
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1655
1670
|
const walk = async (d) => {
|
|
1656
1671
|
if (files.length >= maxFiles) return;
|
|
1672
|
+
let realDir;
|
|
1673
|
+
try {
|
|
1674
|
+
const { realpath } = await import("fs/promises");
|
|
1675
|
+
realDir = await realpath(d);
|
|
1676
|
+
} catch {
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
if (visited.has(realDir)) return;
|
|
1680
|
+
visited.add(realDir);
|
|
1657
1681
|
let entries;
|
|
1658
1682
|
try {
|
|
1659
1683
|
entries = await readdir(d, { withFileTypes: true });
|
|
@@ -1662,11 +1686,19 @@ async function collectRealFiles(dir, maxFiles = Infinity) {
|
|
|
1662
1686
|
}
|
|
1663
1687
|
for (const entry of entries) {
|
|
1664
1688
|
if (files.length >= maxFiles) return;
|
|
1665
|
-
if (entry.isSymbolicLink()) continue;
|
|
1666
1689
|
const fullPath = join5(d, entry.name);
|
|
1667
1690
|
if (entry.isDirectory()) {
|
|
1668
1691
|
if (SKIP_DIRS.has(entry.name)) continue;
|
|
1669
1692
|
await walk(fullPath);
|
|
1693
|
+
} else if (entry.isSymbolicLink()) {
|
|
1694
|
+
try {
|
|
1695
|
+
const s = await stat(fullPath);
|
|
1696
|
+
if (s.isDirectory()) {
|
|
1697
|
+
if (SKIP_DIRS.has(entry.name)) continue;
|
|
1698
|
+
await walk(fullPath);
|
|
1699
|
+
}
|
|
1700
|
+
} catch {
|
|
1701
|
+
}
|
|
1670
1702
|
} else if (entry.isFile()) {
|
|
1671
1703
|
files.push(fullPath);
|
|
1672
1704
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annals/agent-mesh",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.6",
|
|
4
4
|
"description": "CLI bridge connecting local AI agents to the Agents.Hot platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@annals/bridge-protocol": "^0.2.0",
|
|
12
11
|
"commander": "^13.0.0",
|
|
13
12
|
"node-datachannel": "^0.32.0",
|
|
14
|
-
"ws": "^8.18.0"
|
|
13
|
+
"ws": "^8.18.0",
|
|
14
|
+
"@annals/bridge-protocol": "^0.2.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/ws": "^8.5.0",
|