@annals/agent-mesh 0.18.0 → 0.18.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/dist/index.js +15 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1661,10 +1661,10 @@ var BridgeManager = class {
|
|
|
1661
1661
|
this.pendingUploads.delete(offer.transfer_id);
|
|
1662
1662
|
const workspaceDir = this.resolveUploadWorkspace(_sessionId);
|
|
1663
1663
|
try {
|
|
1664
|
-
const { mkdirSync:
|
|
1664
|
+
const { mkdirSync: mkdirSync7, writeFileSync: writeFileSync4 } = __require("fs");
|
|
1665
1665
|
const { join: join13 } = __require("path");
|
|
1666
1666
|
const { execSync: execSync6 } = __require("child_process");
|
|
1667
|
-
|
|
1667
|
+
mkdirSync7(workspaceDir, { recursive: true });
|
|
1668
1668
|
const zipPath = join13(workspaceDir, ".upload.zip");
|
|
1669
1669
|
writeFileSync4(zipPath, zipBuffer);
|
|
1670
1670
|
try {
|
|
@@ -3854,7 +3854,7 @@ function registerAgentsCommand(program2) {
|
|
|
3854
3854
|
|
|
3855
3855
|
// src/commands/chat.ts
|
|
3856
3856
|
import { createInterface as createInterface4 } from "readline";
|
|
3857
|
-
import { existsSync as existsSync7, readFileSync as readFileSync2 } from "fs";
|
|
3857
|
+
import { existsSync as existsSync7, readFileSync as readFileSync2, mkdirSync as mkdirSync5, copyFileSync as copyFileSync2 } from "fs";
|
|
3858
3858
|
import { basename as basename2, join as join9 } from "path";
|
|
3859
3859
|
import { execSync as execSync4 } from "child_process";
|
|
3860
3860
|
import { createHash as createHash2, randomUUID } from "crypto";
|
|
@@ -3884,10 +3884,8 @@ var DEFAULT_BASE_URL3 = "https://agents.hot";
|
|
|
3884
3884
|
function prepareUploadFile(filePath) {
|
|
3885
3885
|
const fileName = basename2(filePath);
|
|
3886
3886
|
const tempDir = join9(tmpdir(), `chat-upload-${Date.now()}`);
|
|
3887
|
-
|
|
3888
|
-
mkdirSync6(tempDir, { recursive: true });
|
|
3887
|
+
mkdirSync5(tempDir, { recursive: true });
|
|
3889
3888
|
const tempFile = join9(tempDir, fileName);
|
|
3890
|
-
const { copyFileSync: copyFileSync2 } = __require("fs");
|
|
3891
3889
|
copyFileSync2(filePath, tempFile);
|
|
3892
3890
|
const zipPath = join9(tempDir, "upload.zip");
|
|
3893
3891
|
execSync4(`cd "${tempDir}" && zip -q "${zipPath}" "${fileName}"`);
|
|
@@ -5092,9 +5090,11 @@ function registerDiscoverCommand(program2) {
|
|
|
5092
5090
|
}
|
|
5093
5091
|
|
|
5094
5092
|
// src/commands/call.ts
|
|
5095
|
-
import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as
|
|
5093
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync6, copyFileSync as copyFileSync3 } from "fs";
|
|
5096
5094
|
import { execSync as execSync5 } from "child_process";
|
|
5097
|
-
import {
|
|
5095
|
+
import { createHash as createHash3, randomUUID as randomUUID2 } from "crypto";
|
|
5096
|
+
import { join as join12, basename as basename3 } from "path";
|
|
5097
|
+
import { tmpdir as tmpdir2 } from "os";
|
|
5098
5098
|
var DEFAULT_BASE_URL4 = "https://agents.hot";
|
|
5099
5099
|
async function submitRating(baseUrl, token, agentId, callId, rating) {
|
|
5100
5100
|
const res = await fetch(`${baseUrl}/api/agents/${agentId}/rate`, {
|
|
@@ -5187,7 +5187,7 @@ async function webrtcDownload(agentId, offer, token, outputDir, json) {
|
|
|
5187
5187
|
receiver.waitForCompletion(3e4),
|
|
5188
5188
|
poll()
|
|
5189
5189
|
]);
|
|
5190
|
-
|
|
5190
|
+
mkdirSync6(outputDir, { recursive: true });
|
|
5191
5191
|
const zipPath = join12(outputDir, ".transfer.zip");
|
|
5192
5192
|
writeFileSync3(zipPath, zipBuffer);
|
|
5193
5193
|
try {
|
|
@@ -5223,27 +5223,20 @@ async function webrtcDownload(agentId, offer, token, outputDir, json) {
|
|
|
5223
5223
|
}
|
|
5224
5224
|
}
|
|
5225
5225
|
function prepareFileForUpload(filePath) {
|
|
5226
|
-
const { readFileSync: _readFileSync } = __require("fs");
|
|
5227
|
-
const { basename: basename3 } = __require("path");
|
|
5228
|
-
const { execSync: _execSync } = __require("child_process");
|
|
5229
|
-
const { createHash: createHash3 } = __require("crypto");
|
|
5230
|
-
const { tmpdir: tmpdir2 } = __require("os");
|
|
5231
5226
|
const fileName = basename3(filePath);
|
|
5232
5227
|
const tempDir = join12(tmpdir2(), `upload-${Date.now()}`);
|
|
5233
|
-
|
|
5234
|
-
_mkdirSync(tempDir, { recursive: true });
|
|
5228
|
+
mkdirSync6(tempDir, { recursive: true });
|
|
5235
5229
|
const tempFile = join12(tempDir, fileName);
|
|
5236
|
-
|
|
5237
|
-
_copyFileSync(filePath, tempFile);
|
|
5230
|
+
copyFileSync3(filePath, tempFile);
|
|
5238
5231
|
const zipPath = join12(tempDir, "upload.zip");
|
|
5239
|
-
|
|
5240
|
-
const zipBuffer =
|
|
5232
|
+
execSync5(`cd "${tempDir}" && zip -q "${zipPath}" "${fileName}"`);
|
|
5233
|
+
const zipBuffer = readFileSync3(zipPath);
|
|
5241
5234
|
try {
|
|
5242
|
-
|
|
5235
|
+
execSync5(`rm -rf "${tempDir}"`);
|
|
5243
5236
|
} catch {
|
|
5244
5237
|
}
|
|
5245
5238
|
const zipSha256 = createHash3("sha256").update(zipBuffer).digest("hex");
|
|
5246
|
-
const transferId =
|
|
5239
|
+
const transferId = randomUUID2();
|
|
5247
5240
|
return {
|
|
5248
5241
|
offer: {
|
|
5249
5242
|
transfer_id: transferId,
|