yungle-mcp 0.3.1 → 0.3.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/README.md +2 -2
- package/dist/index.mjs +1 -1
- package/dist/server.mjs +24 -16
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ can put that in the message of a transfer they send you. So:
|
|
|
91
91
|
## Not reachable
|
|
92
92
|
|
|
93
93
|
Your vault and end-to-end encrypted transfers: their keys are derived in the browser and never
|
|
94
|
-
sent to Yungle. See <https://yungle.co/
|
|
94
|
+
sent to Yungle. See <https://docs.yungle.co/unsupported>.
|
|
95
95
|
|
|
96
|
-
Docs: <https://yungle.co/
|
|
96
|
+
Docs: <https://docs.yungle.co/mcp-server?ref=npm> · Source:
|
|
97
97
|
<https://github.com/heindewilde/yungle-clients> · MIT
|
package/dist/index.mjs
CHANGED
|
@@ -121,7 +121,7 @@ async function fetchTo(url, dest, size, doFetch) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// src/server.ts
|
|
124
|
-
var MCP_VERSION = true ? "0.3.
|
|
124
|
+
var MCP_VERSION = true ? "0.3.2" : "dev";
|
|
125
125
|
function createServer(client, opts = { canWrite: false, canEmail: false, local: false }) {
|
|
126
126
|
const server = new McpServer(
|
|
127
127
|
{ name: "yungle", version: MCP_VERSION },
|
package/dist/server.mjs
CHANGED
|
@@ -222,7 +222,7 @@ function pageQuery(page, extra = {}) {
|
|
|
222
222
|
const q = params.toString();
|
|
223
223
|
return q ? `?${q}` : "";
|
|
224
224
|
}
|
|
225
|
-
var CLIENT_VERSION = true ? "0.3.
|
|
225
|
+
var CLIENT_VERSION = true ? "0.3.2" : "dev";
|
|
226
226
|
var YungleClient = class {
|
|
227
227
|
baseUrl;
|
|
228
228
|
apiKey;
|
|
@@ -510,22 +510,31 @@ var YungleClient = class {
|
|
|
510
510
|
const safe = method === "GET" || method === "DELETE" || idempotencyKey !== void 0 || opts?.idempotent === true;
|
|
511
511
|
let attempt = 0;
|
|
512
512
|
for (; ; ) {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
513
|
+
let res;
|
|
514
|
+
try {
|
|
515
|
+
res = await this.doFetch(`${this.baseUrl}${path}`, {
|
|
516
|
+
method,
|
|
517
|
+
headers: {
|
|
518
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
519
|
+
Accept: "application/json",
|
|
520
|
+
"User-Agent": this.userAgent,
|
|
521
|
+
...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {},
|
|
522
|
+
...body === void 0 ? {} : { "Content-Type": "application/json" }
|
|
523
|
+
},
|
|
524
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
525
|
+
});
|
|
526
|
+
} catch (err) {
|
|
527
|
+
const aborted = err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError");
|
|
528
|
+
if (aborted || !safe || attempt >= this.maxRetries) throw err;
|
|
529
|
+
await sleep(backoffMs(attempt, null));
|
|
530
|
+
attempt++;
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
524
533
|
if (res.ok) return await res.json();
|
|
525
534
|
const error = await toError(res);
|
|
526
535
|
const mayRetry = error.status === 429 || safe && error.retryable;
|
|
527
536
|
if (!mayRetry || attempt >= this.maxRetries) throw error;
|
|
528
|
-
await sleep(backoffMs(attempt, error));
|
|
537
|
+
await sleep(backoffMs(attempt, error.retryAfterSeconds));
|
|
529
538
|
attempt++;
|
|
530
539
|
}
|
|
531
540
|
}
|
|
@@ -561,8 +570,7 @@ function parseRetryAfter(value, now = Date.now()) {
|
|
|
561
570
|
const seconds = Math.ceil((at - now) / 1e3);
|
|
562
571
|
return seconds >= 0 ? seconds : null;
|
|
563
572
|
}
|
|
564
|
-
function backoffMs(attempt,
|
|
565
|
-
const stated = error.retryAfterSeconds;
|
|
573
|
+
function backoffMs(attempt, stated) {
|
|
566
574
|
if (stated !== null) return stated * 1e3;
|
|
567
575
|
return Math.min(2 ** attempt * 500, 8e3) + Math.floor(Math.random() * 250);
|
|
568
576
|
}
|
|
@@ -690,7 +698,7 @@ async function fetchTo(url, dest, size, doFetch) {
|
|
|
690
698
|
}
|
|
691
699
|
|
|
692
700
|
// src/server.ts
|
|
693
|
-
var MCP_VERSION = true ? "0.3.
|
|
701
|
+
var MCP_VERSION = true ? "0.3.2" : "dev";
|
|
694
702
|
function createServer(client, opts = { canWrite: false, canEmail: false, local: false }) {
|
|
695
703
|
const server = new McpServer(
|
|
696
704
|
{ name: "yungle", version: MCP_VERSION },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yungle-mcp",
|
|
3
3
|
"mcpName": "co.yungle/yungle",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP server for Yungle: let Claude, Cursor or any MCP client read your file transfers, share files and send them, with your approval.",
|
|
7
7
|
"bin": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
17
17
|
"zod": "^3.24.1",
|
|
18
|
-
"yungle-client": "^0.3.
|
|
18
|
+
"yungle-client": "^0.3.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.10.5",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"type": "git",
|
|
44
44
|
"url": "git+https://github.com/heindewilde/yungle-clients.git"
|
|
45
45
|
},
|
|
46
|
-
"homepage": "https://yungle.co/
|
|
46
|
+
"homepage": "https://docs.yungle.co/mcp-server?ref=npm",
|
|
47
47
|
"bugs": {
|
|
48
48
|
"url": "https://github.com/heindewilde/yungle-clients/issues"
|
|
49
49
|
},
|