@burdenoff/mcp-libs 2026.1031.2 → 2026.1101.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/{chunk-FVLIANOQ.js → chunk-LUXDBCVJ.js} +3 -3
- package/dist/{chunk-FVLIANOQ.js.map → chunk-LUXDBCVJ.js.map} +1 -1
- package/dist/{chunk-76RGHRRS.js → chunk-WYCRYHHY.js} +83 -33
- package/dist/chunk-WYCRYHHY.js.map +1 -0
- package/dist/core/auth/store.d.ts +1 -0
- package/dist/core/gql/client.d.ts +6 -0
- package/dist/core/index.cjs +83 -30
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +80 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/adaptercloud/index.js +1 -1
- package/dist/modules/artistrybase/index.js +1 -1
- package/dist/modules/assethandler/index.js +1 -1
- package/dist/modules/atheletebridge/index.js +1 -1
- package/dist/modules/auth/index.cjs +1 -1
- package/dist/modules/auth/index.cjs.map +1 -1
- package/dist/modules/auth/index.js +4 -4
- package/dist/modules/auth/index.js.map +1 -1
- package/dist/modules/auth/operations.d.ts +2 -2
- package/dist/modules/billing/index.cjs +45 -19
- package/dist/modules/billing/index.cjs.map +1 -1
- package/dist/modules/billing/index.js +46 -20
- package/dist/modules/billing/index.js.map +1 -1
- package/dist/modules/billing/operations.d.ts +4 -4
- package/dist/modules/brainyrich/index.js +1 -1
- package/dist/modules/buildmyiq/index.js +1 -1
- package/dist/modules/channels/index.cjs +0 -35
- package/dist/modules/channels/index.cjs.map +1 -1
- package/dist/modules/channels/index.js +1 -36
- package/dist/modules/channels/index.js.map +1 -1
- package/dist/modules/channels/operations.d.ts +0 -1
- package/dist/modules/collabkin/index.js +1 -1
- package/dist/modules/comradecircle/index.js +1 -1
- package/dist/modules/conversations/index.cjs +6 -6
- package/dist/modules/conversations/index.cjs.map +1 -1
- package/dist/modules/conversations/index.js +7 -7
- package/dist/modules/conversations/index.js.map +1 -1
- package/dist/modules/conversations/operations.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +1 -1
- package/dist/modules/cosmicintersection/index.js +1 -1
- package/dist/modules/crewfoundry/index.js +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/ecoimpacthub/index.js +1 -1
- package/dist/modules/eventfullymanaged/index.js +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs +421 -101
- package/dist/modules/files/index.cjs.map +1 -1
- package/dist/modules/files/index.js +412 -97
- package/dist/modules/files/index.js.map +1 -1
- package/dist/modules/files/operations.d.ts +9 -8
- package/dist/modules/files/tools.d.ts +2 -0
- package/dist/modules/fluidgrids/index.js +1 -1
- package/dist/modules/ggnomad/index.js +1 -1
- package/dist/modules/govcitizenhub/index.js +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/headshotmarketing/index.js +1 -1
- package/dist/modules/health/index.js +1 -1
- package/dist/modules/healthybowl/index.js +1 -1
- package/dist/modules/hookmovies/index.js +1 -1
- package/dist/modules/housingvista/index.js +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/intelwatchtower/index.js +1 -1
- package/dist/modules/kadaikodi/index.js +1 -1
- package/dist/modules/labsofscience/index.js +1 -1
- package/dist/modules/manufacturedops/index.js +1 -1
- package/dist/modules/movethewheels/index.js +1 -1
- package/dist/modules/mybodyshield/index.js +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.js +1 -1
- package/dist/modules/products/index.cjs +1 -1
- package/dist/modules/products/index.cjs.map +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/products/index.js.map +1 -1
- package/dist/modules/products/operations.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +1 -1
- package/dist/modules/rbac/index.cjs +0 -64
- package/dist/modules/rbac/index.cjs.map +1 -1
- package/dist/modules/rbac/index.js +1 -65
- package/dist/modules/rbac/index.js.map +1 -1
- package/dist/modules/rbac/operations.d.ts +0 -2
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +4 -4
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +5 -5
- package/dist/modules/scheduler/index.js.map +1 -1
- package/dist/modules/scheduler/operations.d.ts +3 -3
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/subscriberbot/index.js +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs +454 -48
- package/dist/modules/tags/index.cjs.map +1 -1
- package/dist/modules/tags/index.js +443 -42
- package/dist/modules/tags/index.js.map +1 -1
- package/dist/modules/tags/operations.d.ts +10 -6
- package/dist/modules/tags/tools.d.ts +1 -1
- package/dist/modules/technospam/index.js +1 -1
- package/dist/modules/theculturepost/index.js +1 -1
- package/dist/modules/theglobalfuel/index.js +1 -1
- package/dist/modules/timecampus/index.js +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs +8 -8
- package/dist/modules/vibecontrols/index.cjs.map +1 -1
- package/dist/modules/vibecontrols/index.js +10 -10
- package/dist/modules/vibecontrols/index.js.map +1 -1
- package/dist/modules/workspaces/index.cjs +235 -5
- package/dist/modules/workspaces/index.cjs.map +1 -1
- package/dist/modules/workspaces/index.js +224 -6
- package/dist/modules/workspaces/index.js.map +1 -1
- package/dist/modules/workspaces/operations.d.ts +2 -2
- package/dist/modules/workspaces/prompts.d.ts +3 -0
- package/dist/modules/workspaces/resources.d.ts +4 -0
- package/package.json +1 -1
- package/dist/chunk-76RGHRRS.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -18,6 +18,31 @@ var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
|
18
18
|
|
|
19
19
|
// src/core/auth/store.ts
|
|
20
20
|
var TOKEN_BUFFER_MS = 5 * 60 * 1e3;
|
|
21
|
+
function decodeJwtPayload(token) {
|
|
22
|
+
if (!token) return null;
|
|
23
|
+
const parts = token.split(".");
|
|
24
|
+
if (parts.length !== 3) return null;
|
|
25
|
+
try {
|
|
26
|
+
const payload = JSON.parse(
|
|
27
|
+
Buffer.from(parts[1].replace(/-/g, "+").replace(/_/g, "/"), "base64").toString("utf8")
|
|
28
|
+
);
|
|
29
|
+
return payload && typeof payload === "object" ? payload : null;
|
|
30
|
+
} catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function jwtExpiryMs(token) {
|
|
35
|
+
const exp = decodeJwtPayload(token)?.exp;
|
|
36
|
+
return typeof exp === "number" && Number.isFinite(exp) ? exp * 1e3 : null;
|
|
37
|
+
}
|
|
38
|
+
function accessTokenExpiry(auth) {
|
|
39
|
+
if (!auth) return null;
|
|
40
|
+
return auth.expiresAt ?? jwtExpiryMs(auth.accessToken);
|
|
41
|
+
}
|
|
42
|
+
function workspaceTokenExpiry(auth) {
|
|
43
|
+
if (!auth?.workspaceToken) return auth?.workspaceTokenExpiresAt ?? null;
|
|
44
|
+
return auth.workspaceTokenExpiresAt ?? jwtExpiryMs(auth.workspaceToken);
|
|
45
|
+
}
|
|
21
46
|
function createAuthStore(configDir, authFileName2 = "auth.json") {
|
|
22
47
|
const authFile = path.join(configDir, authFileName2);
|
|
23
48
|
function ensureConfigDir() {
|
|
@@ -49,24 +74,24 @@ function createAuthStore(configDir, authFileName2 = "auth.json") {
|
|
|
49
74
|
}
|
|
50
75
|
}
|
|
51
76
|
function isTokenExpired() {
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
return Date.now() >=
|
|
77
|
+
const expiresAt = accessTokenExpiry(read());
|
|
78
|
+
if (!expiresAt) return false;
|
|
79
|
+
return Date.now() >= expiresAt;
|
|
55
80
|
}
|
|
56
81
|
function isTokenExpiringSoon() {
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
return Date.now() + TOKEN_BUFFER_MS >=
|
|
82
|
+
const expiresAt = accessTokenExpiry(read());
|
|
83
|
+
if (!expiresAt) return false;
|
|
84
|
+
return Date.now() + TOKEN_BUFFER_MS >= expiresAt;
|
|
60
85
|
}
|
|
61
86
|
function isWorkspaceTokenExpired() {
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
return Date.now() >=
|
|
87
|
+
const expiresAt = workspaceTokenExpiry(read());
|
|
88
|
+
if (!expiresAt) return false;
|
|
89
|
+
return Date.now() >= expiresAt;
|
|
65
90
|
}
|
|
66
91
|
function isWorkspaceTokenExpiringSoon() {
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
return Date.now() + TOKEN_BUFFER_MS >=
|
|
92
|
+
const expiresAt = workspaceTokenExpiry(read());
|
|
93
|
+
if (!expiresAt) return false;
|
|
94
|
+
return Date.now() + TOKEN_BUFFER_MS >= expiresAt;
|
|
70
95
|
}
|
|
71
96
|
function isAuthenticated() {
|
|
72
97
|
const auth = read();
|
|
@@ -75,19 +100,8 @@ function createAuthStore(configDir, authFileName2 = "auth.json") {
|
|
|
75
100
|
return !isTokenExpired();
|
|
76
101
|
}
|
|
77
102
|
function getActorUserId() {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
if (!token) return null;
|
|
81
|
-
const parts = token.split(".");
|
|
82
|
-
if (parts.length !== 3) return null;
|
|
83
|
-
try {
|
|
84
|
-
const payload = JSON.parse(
|
|
85
|
-
Buffer.from(parts[1].replace(/-/g, "+").replace(/_/g, "/"), "base64").toString("utf8")
|
|
86
|
-
);
|
|
87
|
-
return typeof payload.sub === "string" ? payload.sub : null;
|
|
88
|
-
} catch {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
103
|
+
const sub = decodeJwtPayload(read()?.accessToken)?.sub;
|
|
104
|
+
return typeof sub === "string" ? sub : null;
|
|
91
105
|
}
|
|
92
106
|
return {
|
|
93
107
|
read,
|
|
@@ -258,6 +272,30 @@ function isNetworkOrServerError(error) {
|
|
|
258
272
|
}
|
|
259
273
|
return false;
|
|
260
274
|
}
|
|
275
|
+
var GqlRequestError = class extends Error {
|
|
276
|
+
status;
|
|
277
|
+
authFailure;
|
|
278
|
+
constructor(message, status, authFailure) {
|
|
279
|
+
super(message);
|
|
280
|
+
this.name = "GqlRequestError";
|
|
281
|
+
this.status = status;
|
|
282
|
+
this.authFailure = authFailure;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
function toGqlRequestError(error) {
|
|
286
|
+
let status;
|
|
287
|
+
let authFailure;
|
|
288
|
+
if (error && typeof error === "object" && "response" in error) {
|
|
289
|
+
const resp = error.response;
|
|
290
|
+
if (typeof resp?.status === "number") status = resp.status;
|
|
291
|
+
const failure = resp?.errors?.find((e) => typeof e.extensions?.authFailure === "string")?.extensions?.authFailure;
|
|
292
|
+
if (typeof failure === "string") authFailure = failure;
|
|
293
|
+
}
|
|
294
|
+
return new GqlRequestError(extractGqlErrorMessage(error), status, authFailure);
|
|
295
|
+
}
|
|
296
|
+
function isExpiredCredentialError(error) {
|
|
297
|
+
return error instanceof GqlRequestError && error.authFailure === "CREDENTIAL_EXPIRED";
|
|
298
|
+
}
|
|
261
299
|
function extractGqlErrorMessage(error) {
|
|
262
300
|
if (error && typeof error === "object" && "response" in error) {
|
|
263
301
|
const resp = error;
|
|
@@ -310,7 +348,7 @@ async function executeWithRetry(client, document, variables) {
|
|
|
310
348
|
break;
|
|
311
349
|
}
|
|
312
350
|
}
|
|
313
|
-
throw
|
|
351
|
+
throw toGqlRequestError(lastError);
|
|
314
352
|
}
|
|
315
353
|
function createGqlClients(config, authStore) {
|
|
316
354
|
let workspaceClient = null;
|
|
@@ -372,7 +410,7 @@ function createGqlClients(config, authStore) {
|
|
|
372
410
|
}
|
|
373
411
|
async function refreshWorkspaceToken() {
|
|
374
412
|
const auth = authStore.read();
|
|
375
|
-
if (!auth?.accessToken || !auth.workspaceId || !auth.organizationId) return;
|
|
413
|
+
if (!auth?.accessToken || !auth.workspaceId || !auth.organizationId) return false;
|
|
376
414
|
const cfg = config.read();
|
|
377
415
|
try {
|
|
378
416
|
const result = await issueWorkspaceToken(
|
|
@@ -387,7 +425,9 @@ function createGqlClients(config, authStore) {
|
|
|
387
425
|
workspaceTokenExpiresAt: new Date(result.expiresAt).getTime()
|
|
388
426
|
});
|
|
389
427
|
workspaceClient = null;
|
|
428
|
+
return true;
|
|
390
429
|
} catch {
|
|
430
|
+
return false;
|
|
391
431
|
}
|
|
392
432
|
}
|
|
393
433
|
async function ensureFreshTokens() {
|
|
@@ -400,12 +440,22 @@ function createGqlClients(config, authStore) {
|
|
|
400
440
|
await refreshWorkspaceToken();
|
|
401
441
|
}
|
|
402
442
|
}
|
|
443
|
+
async function requestWorkspace(document, variables) {
|
|
444
|
+
const { workspace: ws } = workspaceClient ? { workspace: workspaceClient } : init();
|
|
445
|
+
ws.setHeaders(getWorkspaceHeaders(authStore.read()));
|
|
446
|
+
return executeWithRetry(ws, document, variables);
|
|
447
|
+
}
|
|
403
448
|
const workspace = {
|
|
404
449
|
async request(document, variables) {
|
|
405
450
|
await ensureFreshTokens();
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
451
|
+
try {
|
|
452
|
+
return await requestWorkspace(document, variables);
|
|
453
|
+
} catch (error) {
|
|
454
|
+
if (!isExpiredCredentialError(error) || authStore.read()?.apiKey) throw error;
|
|
455
|
+
if (authStore.isTokenExpiringSoon()) await refreshPlatformToken();
|
|
456
|
+
if (!await refreshWorkspaceToken()) throw error;
|
|
457
|
+
return requestWorkspace(document, variables);
|
|
458
|
+
}
|
|
409
459
|
}
|
|
410
460
|
};
|
|
411
461
|
const global = {
|