@masons/agent-network 0.6.4 → 0.6.5
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/platform-client.d.ts +5 -0
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/platform-client.js +58 -6
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +27 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,11 @@ export declare class PlatformApiError extends Error {
|
|
|
8
8
|
readonly code: string;
|
|
9
9
|
constructor(status: number, code: string, message: string);
|
|
10
10
|
}
|
|
11
|
+
export declare class PlatformNetworkError extends Error {
|
|
12
|
+
readonly code: "timeout" | "network";
|
|
13
|
+
readonly detail: string;
|
|
14
|
+
constructor(code: "timeout" | "network", detail: string);
|
|
15
|
+
}
|
|
11
16
|
export interface RequestConnectionResponse {
|
|
12
17
|
requestIds: string[];
|
|
13
18
|
status: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-client.d.ts","sourceRoot":"","sources":["../src/platform-client.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AASxD,eAAO,MAAM,qBAAqB,iDACc,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,qBAAa,gBAAiB,SAAQ,KAAK;aAEvB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;gBADZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM;CAKlB;AAMD,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAQD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,C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BAAoB,EACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAA;CAAE,GACvE,OAAO,CAAC,yBAAyB,CAAC,CAWpC;AAQD,wBAAsB,YAAY,CAChC,GAAG,EAAE,oBAAoB,EACzB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,oBAAoB,CAAC,CAc/B;AAOD,wBAAsB,aAAa,CACjC,GAAG,EAAE,oBAAoB,EACzB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAUhC;AAOD,wBAAsB,cAAc,CAClC,GAAG,EAAE,oBAAoB,EACzB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,sBAAsB,CAAC,CAUjC;AAQD,wBAAsB,aAAa,CACjC,GAAG,EAAE,oBAAoB,EACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,qBAAqB,CAAC,CAWhC;AAQD,wBAAsB,eAAe,CACnC,GAAG,EAAE,oBAAoB,EACzB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,uBAAuB,CAAC,CAMlC"}
|
package/dist/platform-client.js
CHANGED
|
@@ -10,6 +10,16 @@ export class PlatformApiError extends Error {
|
|
|
10
10
|
this.name = "PlatformApiError";
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
export class PlatformNetworkError extends Error {
|
|
14
|
+
code;
|
|
15
|
+
detail;
|
|
16
|
+
constructor(code, detail) {
|
|
17
|
+
super(`network ${code}: ${detail}`);
|
|
18
|
+
this.code = code;
|
|
19
|
+
this.detail = detail;
|
|
20
|
+
this.name = "PlatformNetworkError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
function baseUrl(cfg) {
|
|
14
24
|
const trimmed = cfg.apiHost.replace(/\/+$/, "");
|
|
15
25
|
const origin = /^https?:\/\//.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
@@ -21,8 +31,50 @@ async function handleError(res) {
|
|
|
21
31
|
const message = typeof body.message === "string" ? body.message : res.statusText;
|
|
22
32
|
throw new PlatformApiError(res.status, code, message);
|
|
23
33
|
}
|
|
34
|
+
const REQUEST_TIMEOUT_MS = 15_000;
|
|
35
|
+
function causeCode(cause) {
|
|
36
|
+
if (cause && typeof cause === "object" && "code" in cause) {
|
|
37
|
+
const code = cause.code;
|
|
38
|
+
if (typeof code === "string")
|
|
39
|
+
return code;
|
|
40
|
+
}
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
function isTimeoutCode(code) {
|
|
44
|
+
return (code === "ETIMEDOUT" ||
|
|
45
|
+
code === "UND_ERR_CONNECT_TIMEOUT" ||
|
|
46
|
+
code === "UND_ERR_HEADERS_TIMEOUT" ||
|
|
47
|
+
code === "UND_ERR_BODY_TIMEOUT");
|
|
48
|
+
}
|
|
49
|
+
function toNetworkError(err) {
|
|
50
|
+
if (err instanceof Error && err.name === "AbortError") {
|
|
51
|
+
return new PlatformNetworkError("timeout", `timed out after ${REQUEST_TIMEOUT_MS}ms`);
|
|
52
|
+
}
|
|
53
|
+
if (err instanceof TypeError && err.message === "fetch failed") {
|
|
54
|
+
const cause = err.cause;
|
|
55
|
+
const code = causeCode(cause);
|
|
56
|
+
const detail = cause instanceof Error && cause.message
|
|
57
|
+
? cause.message
|
|
58
|
+
: code || "fetch failed";
|
|
59
|
+
return new PlatformNetworkError(isTimeoutCode(code) ? "timeout" : "network", detail);
|
|
60
|
+
}
|
|
61
|
+
return err;
|
|
62
|
+
}
|
|
63
|
+
async function apiFetch(url, init = {}) {
|
|
64
|
+
const controller = new AbortController();
|
|
65
|
+
const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
66
|
+
try {
|
|
67
|
+
return await fetch(url, { ...init, signal: controller.signal });
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
throw toNetworkError(err);
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
clearTimeout(timer);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
24
76
|
export async function requestConnection(cfg, runtimeKey, params) {
|
|
25
|
-
const res = await
|
|
77
|
+
const res = await apiFetch(`${baseUrl(cfg)}/me/connections/requests`, {
|
|
26
78
|
method: "POST",
|
|
27
79
|
headers: {
|
|
28
80
|
"Content-Type": "application/json",
|
|
@@ -46,7 +98,7 @@ export async function listRequests(cfg, runtimeKey, params) {
|
|
|
46
98
|
query.set("limit", String(params.limit));
|
|
47
99
|
const qs = query.toString();
|
|
48
100
|
const url = `${baseUrl(cfg)}/me/connections/requests${qs ? `?${qs}` : ""}`;
|
|
49
|
-
const res = await
|
|
101
|
+
const res = await apiFetch(url, {
|
|
50
102
|
headers: { Authorization: `Bearer ${runtimeKey}` },
|
|
51
103
|
});
|
|
52
104
|
if (!res.ok)
|
|
@@ -54,7 +106,7 @@ export async function listRequests(cfg, runtimeKey, params) {
|
|
|
54
106
|
return (await res.json());
|
|
55
107
|
}
|
|
56
108
|
export async function acceptRequest(cfg, runtimeKey, requestId) {
|
|
57
|
-
const res = await
|
|
109
|
+
const res = await apiFetch(`${baseUrl(cfg)}/me/connections/requests/${encodeURIComponent(requestId)}/accept`, {
|
|
58
110
|
method: "POST",
|
|
59
111
|
headers: { Authorization: `Bearer ${runtimeKey}` },
|
|
60
112
|
});
|
|
@@ -63,7 +115,7 @@ export async function acceptRequest(cfg, runtimeKey, requestId) {
|
|
|
63
115
|
return (await res.json());
|
|
64
116
|
}
|
|
65
117
|
export async function declineRequest(cfg, runtimeKey, requestId) {
|
|
66
|
-
const res = await
|
|
118
|
+
const res = await apiFetch(`${baseUrl(cfg)}/me/connections/requests/${encodeURIComponent(requestId)}/decline`, {
|
|
67
119
|
method: "POST",
|
|
68
120
|
headers: { Authorization: `Bearer ${runtimeKey}` },
|
|
69
121
|
});
|
|
@@ -72,7 +124,7 @@ export async function declineRequest(cfg, runtimeKey, requestId) {
|
|
|
72
124
|
return (await res.json());
|
|
73
125
|
}
|
|
74
126
|
export async function updateProfile(cfg, runtimeKey, params) {
|
|
75
|
-
const res = await
|
|
127
|
+
const res = await apiFetch(`${baseUrl(cfg)}/me/profile`, {
|
|
76
128
|
method: "PATCH",
|
|
77
129
|
headers: {
|
|
78
130
|
"Content-Type": "application/json",
|
|
@@ -85,7 +137,7 @@ export async function updateProfile(cfg, runtimeKey, params) {
|
|
|
85
137
|
return (await res.json());
|
|
86
138
|
}
|
|
87
139
|
export async function listConnections(cfg, runtimeKey) {
|
|
88
|
-
const res = await
|
|
140
|
+
const res = await apiFetch(`${baseUrl(cfg)}/me/connections`, {
|
|
89
141
|
headers: { Authorization: `Bearer ${runtimeKey}` },
|
|
90
142
|
});
|
|
91
143
|
if (!res.ok)
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAsEA,UAAU,WAAW;IACnB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CACP,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3B;AAED,UAAU,WAAW;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,KAAK,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3E,UAAU,OAAO;IACf,YAAY,CACV,IAAI,EAAE,cAAc,GAAG,WAAW,EAClC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,IAAI,CAAC;CACT;AAoDD,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAwSD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CA01BhD"}
|
package/dist/tools.js
CHANGED
|
@@ -4,7 +4,7 @@ import { _resetChannelSetupForTesting, consumeChannelSetupStatus, getDefaultChan
|
|
|
4
4
|
import { clearTargetHandle, extractNetworkConfig, getDmScope, getPendingTarget, isProfileNeeded, markProfileComplete, removeIdentityLinks, requireApiKey, requireConversationManager, requirePlatformConfig, writeIdentityLinks, } from "./config.js";
|
|
5
5
|
import { getOwnerHandle } from "./environment-context.js";
|
|
6
6
|
import { ownerNotesQueue } from "./owner-notes.js";
|
|
7
|
-
import { acceptRequest, declineRequest, listConnections, listRequests, PlatformApiError, requestConnection, updateProfile, } from "./platform-client.js";
|
|
7
|
+
import { acceptRequest, declineRequest, listConnections, listRequests, PlatformApiError, PlatformNetworkError, requestConnection, updateProfile, } from "./platform-client.js";
|
|
8
8
|
import { sentMessageBuffer } from "./sent-message-buffer.js";
|
|
9
9
|
import { getCurrentTurnChannelId, getCurrentTurnIsOwnerNonConsuming, getCurrentTurnOwnerSignal, } from "./turn-context.js";
|
|
10
10
|
import { getLatestPublishedVersion, getPluginVersion, getUpdateInfo, } from "./update-check.js";
|
|
@@ -21,6 +21,14 @@ export function _resetToolsForTesting() {
|
|
|
21
21
|
function textResult(text) {
|
|
22
22
|
return { content: [{ type: "text", text }] };
|
|
23
23
|
}
|
|
24
|
+
function networkErrorText(err) {
|
|
25
|
+
const lead = err.code === "timeout"
|
|
26
|
+
? "The request to the MASONS network timed out"
|
|
27
|
+
: "Couldn't reach the MASONS network";
|
|
28
|
+
return (`${lead} (${err.detail}). The request did not reach the server, so this ` +
|
|
29
|
+
"is a connectivity failure, not an empty result. Retry shortly; if it " +
|
|
30
|
+
"persists, check network access to the API host.");
|
|
31
|
+
}
|
|
24
32
|
let updateNoticeShown = false;
|
|
25
33
|
function maybeAppendUpdateNotice(result) {
|
|
26
34
|
const info = getUpdateInfo();
|
|
@@ -297,6 +305,9 @@ export function registerTools(api) {
|
|
|
297
305
|
return textResult(`Validation error: ${err.message}`);
|
|
298
306
|
}
|
|
299
307
|
}
|
|
308
|
+
if (err instanceof PlatformNetworkError) {
|
|
309
|
+
return textResult(networkErrorText(err));
|
|
310
|
+
}
|
|
300
311
|
throw err;
|
|
301
312
|
}
|
|
302
313
|
if (result.profile) {
|
|
@@ -368,6 +379,9 @@ export function registerTools(api) {
|
|
|
368
379
|
}
|
|
369
380
|
return textResult(`Connection request failed: ${err.message}`);
|
|
370
381
|
}
|
|
382
|
+
if (err instanceof PlatformNetworkError) {
|
|
383
|
+
return textResult(networkErrorText(err));
|
|
384
|
+
}
|
|
371
385
|
throw err;
|
|
372
386
|
}
|
|
373
387
|
if (getPendingTarget()) {
|
|
@@ -407,6 +421,9 @@ export function registerTools(api) {
|
|
|
407
421
|
}
|
|
408
422
|
return textResult(`Failed to list requests: ${err.message}`);
|
|
409
423
|
}
|
|
424
|
+
if (err instanceof PlatformNetworkError) {
|
|
425
|
+
return textResult(networkErrorText(err));
|
|
426
|
+
}
|
|
410
427
|
throw err;
|
|
411
428
|
}
|
|
412
429
|
if (result.total === 0) {
|
|
@@ -479,6 +496,9 @@ export function registerTools(api) {
|
|
|
479
496
|
if (err instanceof PlatformApiError && err.status === 404) {
|
|
480
497
|
return textResult("Request not found or already processed. Use masons_list_requests to see current requests.");
|
|
481
498
|
}
|
|
499
|
+
if (err instanceof PlatformNetworkError) {
|
|
500
|
+
return textResult(networkErrorText(err));
|
|
501
|
+
}
|
|
482
502
|
throw err;
|
|
483
503
|
}
|
|
484
504
|
}),
|
|
@@ -503,6 +523,9 @@ export function registerTools(api) {
|
|
|
503
523
|
if (err instanceof PlatformApiError && err.status === 404) {
|
|
504
524
|
return textResult("Request not found or already processed. Use masons_list_requests to see current requests.");
|
|
505
525
|
}
|
|
526
|
+
if (err instanceof PlatformNetworkError) {
|
|
527
|
+
return textResult(networkErrorText(err));
|
|
528
|
+
}
|
|
506
529
|
throw err;
|
|
507
530
|
}
|
|
508
531
|
}),
|
|
@@ -525,6 +548,9 @@ export function registerTools(api) {
|
|
|
525
548
|
}
|
|
526
549
|
return textResult(`Failed to list connections: ${err.message}`);
|
|
527
550
|
}
|
|
551
|
+
if (err instanceof PlatformNetworkError) {
|
|
552
|
+
return textResult(networkErrorText(err));
|
|
553
|
+
}
|
|
528
554
|
throw err;
|
|
529
555
|
}
|
|
530
556
|
if (result.total === 0) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export declare const PLUGIN_VERSION = "0.6.5";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export const PLUGIN_VERSION = "0.6.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masons/agent-network",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "MASONS Agent Network — OpenClaw channel plugin for connecting agent runtimes to the Agent Network over MSTP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MASONS.ai <hello@masons.ai> (https://masons.ai)",
|