@burdenoff/mcp-libs 2026.1026.1 → 2026.1028.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-S2DM4KCX.js → chunk-GTKSADBI.js} +3 -3
- package/dist/{chunk-S2DM4KCX.js.map → chunk-GTKSADBI.js.map} +1 -1
- package/dist/{chunk-FHXCNP2U.js → chunk-J74ZKEXL.js} +75 -7
- package/dist/chunk-J74ZKEXL.js.map +1 -0
- package/dist/core/index.cjs +74 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/server.d.ts +3 -0
- package/dist/core/tool-governance.d.ts +11 -0
- package/dist/index.cjs +65 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/adaptercloud/index.cjs +1 -0
- package/dist/modules/adaptercloud/index.cjs.map +1 -1
- package/dist/modules/adaptercloud/index.js +1 -1
- package/dist/modules/artistrybase/index.cjs +1 -0
- package/dist/modules/artistrybase/index.cjs.map +1 -1
- package/dist/modules/artistrybase/index.js +1 -1
- package/dist/modules/assethandler/index.cjs +1 -0
- package/dist/modules/assethandler/index.cjs.map +1 -1
- package/dist/modules/assethandler/index.js +1 -1
- package/dist/modules/atheletebridge/index.cjs +1 -0
- package/dist/modules/atheletebridge/index.cjs.map +1 -1
- package/dist/modules/atheletebridge/index.js +1 -1
- package/dist/modules/auth/index.cjs +1 -0
- package/dist/modules/auth/index.cjs.map +1 -1
- package/dist/modules/auth/index.js +3 -3
- package/dist/modules/billing/index.cjs +1 -0
- package/dist/modules/billing/index.cjs.map +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/brainyrich/index.cjs +1 -0
- package/dist/modules/brainyrich/index.cjs.map +1 -1
- package/dist/modules/brainyrich/index.js +1 -1
- package/dist/modules/buildmyiq/index.cjs +1 -0
- package/dist/modules/buildmyiq/index.cjs.map +1 -1
- package/dist/modules/buildmyiq/index.js +1 -1
- package/dist/modules/channels/index.cjs +1 -0
- package/dist/modules/channels/index.cjs.map +1 -1
- package/dist/modules/channels/index.js +1 -1
- package/dist/modules/collabkin/index.cjs +1 -0
- package/dist/modules/collabkin/index.cjs.map +1 -1
- package/dist/modules/collabkin/index.js +1 -1
- package/dist/modules/comradecircle/index.cjs +1 -0
- package/dist/modules/comradecircle/index.cjs.map +1 -1
- package/dist/modules/comradecircle/index.js +1 -1
- package/dist/modules/conversations/index.cjs +1 -0
- package/dist/modules/conversations/index.cjs.map +1 -1
- package/dist/modules/conversations/index.js +1 -1
- package/dist/modules/coolandlovely/index.cjs +1 -0
- package/dist/modules/coolandlovely/index.cjs.map +1 -1
- package/dist/modules/coolandlovely/index.js +1 -1
- package/dist/modules/cosmicintersection/index.cjs +1 -0
- package/dist/modules/cosmicintersection/index.cjs.map +1 -1
- package/dist/modules/cosmicintersection/index.js +1 -1
- package/dist/modules/crewfoundry/index.cjs +1 -0
- package/dist/modules/crewfoundry/index.cjs.map +1 -1
- package/dist/modules/crewfoundry/index.js +1 -1
- package/dist/modules/devportal/index.cjs +1 -0
- package/dist/modules/devportal/index.cjs.map +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/ecoimpacthub/index.cjs +1 -0
- package/dist/modules/ecoimpacthub/index.cjs.map +1 -1
- package/dist/modules/ecoimpacthub/index.js +1 -1
- package/dist/modules/eventfullymanaged/index.cjs +1 -0
- package/dist/modules/eventfullymanaged/index.cjs.map +1 -1
- package/dist/modules/eventfullymanaged/index.js +1 -1
- package/dist/modules/export/index.cjs +1 -0
- package/dist/modules/export/index.cjs.map +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs +1 -0
- package/dist/modules/files/index.cjs.map +1 -1
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/fluidgrids/index.cjs +1 -0
- package/dist/modules/fluidgrids/index.cjs.map +1 -1
- package/dist/modules/fluidgrids/index.js +1 -1
- package/dist/modules/ggnomad/index.cjs +1 -0
- package/dist/modules/ggnomad/index.cjs.map +1 -1
- package/dist/modules/ggnomad/index.js +1 -1
- package/dist/modules/govcitizenhub/index.cjs +1 -0
- package/dist/modules/govcitizenhub/index.cjs.map +1 -1
- package/dist/modules/govcitizenhub/index.js +1 -1
- package/dist/modules/groups/index.cjs +1 -0
- package/dist/modules/groups/index.cjs.map +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/headshotmarketing/index.cjs +1 -0
- package/dist/modules/headshotmarketing/index.cjs.map +1 -1
- package/dist/modules/headshotmarketing/index.js +1 -1
- package/dist/modules/health/index.cjs +1 -0
- package/dist/modules/health/index.cjs.map +1 -1
- package/dist/modules/health/index.js +1 -1
- package/dist/modules/healthybowl/index.cjs +1 -0
- package/dist/modules/healthybowl/index.cjs.map +1 -1
- package/dist/modules/healthybowl/index.js +1 -1
- package/dist/modules/hookmovies/index.cjs +1 -0
- package/dist/modules/hookmovies/index.cjs.map +1 -1
- package/dist/modules/hookmovies/index.js +1 -1
- package/dist/modules/housingvista/index.cjs +1 -0
- package/dist/modules/housingvista/index.cjs.map +1 -1
- package/dist/modules/housingvista/index.js +1 -1
- package/dist/modules/integrations/index.cjs +1 -0
- package/dist/modules/integrations/index.cjs.map +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/intelwatchtower/index.cjs +1 -0
- package/dist/modules/intelwatchtower/index.cjs.map +1 -1
- package/dist/modules/intelwatchtower/index.js +1 -1
- package/dist/modules/kadaikodi/index.cjs +1 -0
- package/dist/modules/kadaikodi/index.cjs.map +1 -1
- package/dist/modules/kadaikodi/index.js +1 -1
- package/dist/modules/labsofscience/index.cjs +1 -0
- package/dist/modules/labsofscience/index.cjs.map +1 -1
- package/dist/modules/labsofscience/index.js +1 -1
- package/dist/modules/manufacturedops/index.cjs +1 -0
- package/dist/modules/manufacturedops/index.cjs.map +1 -1
- package/dist/modules/manufacturedops/index.js +1 -1
- package/dist/modules/movethewheels/index.cjs +1 -0
- package/dist/modules/movethewheels/index.cjs.map +1 -1
- package/dist/modules/movethewheels/index.js +1 -1
- package/dist/modules/mybodyshield/index.cjs +1 -0
- package/dist/modules/mybodyshield/index.cjs.map +1 -1
- package/dist/modules/mybodyshield/index.js +1 -1
- package/dist/modules/notifications/index.cjs +1 -0
- package/dist/modules/notifications/index.cjs.map +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +1 -0
- package/dist/modules/organizations/index.cjs.map +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 -0
- package/dist/modules/products/index.cjs.map +1 -1
- package/dist/modules/products/index.js +1 -1
- package/dist/modules/proserviceworld/index.cjs +1 -0
- package/dist/modules/proserviceworld/index.cjs.map +1 -1
- package/dist/modules/proserviceworld/index.js +1 -1
- package/dist/modules/rbac/index.cjs +1 -0
- package/dist/modules/rbac/index.cjs.map +1 -1
- package/dist/modules/rbac/index.js +1 -1
- package/dist/modules/sandbox/index.cjs +1 -0
- package/dist/modules/sandbox/index.cjs.map +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +1 -0
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/security/index.cjs +1 -0
- package/dist/modules/security/index.cjs.map +1 -1
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/semanticfed/index.cjs +1 -0
- package/dist/modules/semanticfed/index.cjs.map +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/store/index.cjs +1 -0
- package/dist/modules/store/index.cjs.map +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/subscriberbot/index.cjs +1 -0
- package/dist/modules/subscriberbot/index.cjs.map +1 -1
- package/dist/modules/subscriberbot/index.js +1 -1
- package/dist/modules/support/index.cjs +1 -0
- package/dist/modules/support/index.cjs.map +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs +1 -0
- package/dist/modules/tags/index.cjs.map +1 -1
- package/dist/modules/tags/index.js +1 -1
- package/dist/modules/technospam/index.cjs +1 -0
- package/dist/modules/technospam/index.cjs.map +1 -1
- package/dist/modules/technospam/index.js +1 -1
- package/dist/modules/theculturepost/index.cjs +1 -0
- package/dist/modules/theculturepost/index.cjs.map +1 -1
- package/dist/modules/theculturepost/index.js +1 -1
- package/dist/modules/theglobalfuel/index.cjs +1 -0
- package/dist/modules/theglobalfuel/index.cjs.map +1 -1
- package/dist/modules/theglobalfuel/index.js +1 -1
- package/dist/modules/timecampus/index.cjs +1 -0
- package/dist/modules/timecampus/index.cjs.map +1 -1
- package/dist/modules/timecampus/index.js +1 -1
- package/dist/modules/tours/index.cjs +1 -0
- package/dist/modules/tours/index.cjs.map +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs +1 -0
- package/dist/modules/vibecontrols/index.cjs.map +1 -1
- package/dist/modules/vibecontrols/index.js +2 -2
- package/dist/modules/workspaces/index.cjs +1 -0
- package/dist/modules/workspaces/index.cjs.map +1 -1
- package/dist/modules/workspaces/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-FHXCNP2U.js.map +0 -1
package/dist/core/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ var graphqlRequest = require('graphql-request');
|
|
|
7
7
|
var fetch = require('cross-fetch');
|
|
8
8
|
var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
9
9
|
var types_js = require('@modelcontextprotocol/sdk/types.js');
|
|
10
|
+
var crypto = require('crypto');
|
|
10
11
|
var zod = require('zod');
|
|
11
12
|
|
|
12
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -815,6 +816,63 @@ function inferReadOnlyHint(toolName) {
|
|
|
815
816
|
}
|
|
816
817
|
|
|
817
818
|
// src/core/tool-governance.ts
|
|
819
|
+
function scopeToolFilter(scopes) {
|
|
820
|
+
if (scopes.includes("mcp:*")) return () => true;
|
|
821
|
+
const allowed = new Set(
|
|
822
|
+
scopes.filter((scope) => scope.startsWith("mcp:tool:")).map((scope) => scope.slice("mcp:tool:".length))
|
|
823
|
+
);
|
|
824
|
+
return (toolName) => allowed.has(toolName);
|
|
825
|
+
}
|
|
826
|
+
function canonicalJson(value, seen = /* @__PURE__ */ new Set()) {
|
|
827
|
+
if (value === null || value === void 0) return "null";
|
|
828
|
+
if (typeof value === "number") return Number.isFinite(value) ? JSON.stringify(value) : "null";
|
|
829
|
+
if (typeof value === "string" || typeof value === "boolean") return JSON.stringify(value);
|
|
830
|
+
if (typeof value === "bigint") return JSON.stringify(value.toString());
|
|
831
|
+
if (typeof value !== "object") return "null";
|
|
832
|
+
if (seen.has(value)) return "null";
|
|
833
|
+
seen.add(value);
|
|
834
|
+
try {
|
|
835
|
+
if (Array.isArray(value))
|
|
836
|
+
return `[${value.map((item) => canonicalJson(item, seen)).join(",")}]`;
|
|
837
|
+
const record = value;
|
|
838
|
+
const members = Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key], seen)}`);
|
|
839
|
+
return `{${members.join(",")}}`;
|
|
840
|
+
} finally {
|
|
841
|
+
seen.delete(value);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function toolArgsSha256(args) {
|
|
845
|
+
return crypto.createHash("sha256").update(canonicalJson(args), "utf8").digest("hex");
|
|
846
|
+
}
|
|
847
|
+
function isErrorResult(result) {
|
|
848
|
+
return typeof result === "object" && result !== null && result.isError === true;
|
|
849
|
+
}
|
|
850
|
+
function wrapAuditedHandler(name, handler, onToolCall) {
|
|
851
|
+
return async (...callbackArgs) => {
|
|
852
|
+
const started = Date.now();
|
|
853
|
+
const args = callbackArgs.length === 2 ? callbackArgs[0] : {};
|
|
854
|
+
const report = (status, error) => {
|
|
855
|
+
try {
|
|
856
|
+
onToolCall({
|
|
857
|
+
name,
|
|
858
|
+
argsSha256: toolArgsSha256(args),
|
|
859
|
+
status,
|
|
860
|
+
durationMs: Date.now() - started,
|
|
861
|
+
...error ? { error } : {}
|
|
862
|
+
});
|
|
863
|
+
} catch {
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
try {
|
|
867
|
+
const result = await handler(...callbackArgs);
|
|
868
|
+
report(isErrorResult(result) ? "error" : "ok");
|
|
869
|
+
return result;
|
|
870
|
+
} catch (error) {
|
|
871
|
+
report("error", error instanceof Error ? error.message : String(error));
|
|
872
|
+
throw error;
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
}
|
|
818
876
|
var CONFIRM_FIELD_DESCRIPTION = "Must be true to execute this destructive tool. The call is rejected (no changes made) if omitted or false.";
|
|
819
877
|
function resolveAnnotations(name, declared) {
|
|
820
878
|
const destructiveHint = declared?.destructiveHint ?? inferDestructiveHint(name);
|
|
@@ -849,10 +907,11 @@ function wrapServerWithToolGovernance(server, options = {}) {
|
|
|
849
907
|
const enforceConfirmation = options.enforceDestructiveConfirmation ?? false;
|
|
850
908
|
const target = server;
|
|
851
909
|
const originalRegisterTool = target.registerTool.bind(target);
|
|
852
|
-
|
|
910
|
+
const register = (name, config, handler) => {
|
|
853
911
|
const annotations = resolveAnnotations(name, config.annotations);
|
|
912
|
+
const audited = options.onToolCall ? wrapAuditedHandler(name, handler, options.onToolCall) : handler;
|
|
854
913
|
if (!enforceConfirmation || !annotations.destructiveHint) {
|
|
855
|
-
return originalRegisterTool(name, { ...config, annotations },
|
|
914
|
+
return originalRegisterTool(name, { ...config, annotations }, audited);
|
|
856
915
|
}
|
|
857
916
|
const gatedInputSchema = {
|
|
858
917
|
...config.inputSchema ?? {},
|
|
@@ -861,9 +920,16 @@ function wrapServerWithToolGovernance(server, options = {}) {
|
|
|
861
920
|
return originalRegisterTool(
|
|
862
921
|
name,
|
|
863
922
|
{ ...config, inputSchema: gatedInputSchema, annotations },
|
|
864
|
-
wrapDestructiveHandler(name,
|
|
923
|
+
wrapDestructiveHandler(name, audited)
|
|
865
924
|
);
|
|
866
925
|
};
|
|
926
|
+
target.registerTool = (name, config, handler) => {
|
|
927
|
+
const registered = register(name, config, handler);
|
|
928
|
+
if (options.toolFilter && !options.toolFilter(name)) {
|
|
929
|
+
registered?.disable?.();
|
|
930
|
+
}
|
|
931
|
+
return registered;
|
|
932
|
+
};
|
|
867
933
|
return server;
|
|
868
934
|
}
|
|
869
935
|
function withToolAnnotations(server, resolve, register) {
|
|
@@ -905,7 +971,9 @@ function createMcpServer(ctx, modules, opts) {
|
|
|
905
971
|
{ capabilities: toServerCapabilities(capabilities) }
|
|
906
972
|
);
|
|
907
973
|
wrapServerWithToolGovernance(server, {
|
|
908
|
-
enforceDestructiveConfirmation: opts.enforceDestructiveConfirmation
|
|
974
|
+
enforceDestructiveConfirmation: opts.enforceDestructiveConfirmation,
|
|
975
|
+
toolFilter: opts.toolFilter,
|
|
976
|
+
onToolCall: opts.onToolCall
|
|
909
977
|
});
|
|
910
978
|
ctx._internal.serverRef.current = server;
|
|
911
979
|
const inner = server.server ?? server;
|
|
@@ -1061,10 +1129,12 @@ exports.mcpResourceUri = mcpResourceUri;
|
|
|
1061
1129
|
exports.mcpToolName = mcpToolName;
|
|
1062
1130
|
exports.pollDeviceTokenOnce = pollDeviceTokenOnce;
|
|
1063
1131
|
exports.registerTool = registerTool;
|
|
1132
|
+
exports.scopeToolFilter = scopeToolFilter;
|
|
1064
1133
|
exports.sortModules = sortModules;
|
|
1065
1134
|
exports.startDeviceCodeFlow = startDeviceCodeFlow;
|
|
1066
1135
|
exports.textResult = textResult;
|
|
1067
1136
|
exports.toServerCapabilities = toServerCapabilities;
|
|
1137
|
+
exports.toolArgsSha256 = toolArgsSha256;
|
|
1068
1138
|
exports.unionCapabilities = unionCapabilities;
|
|
1069
1139
|
exports.withToolAnnotations = withToolAnnotations;
|
|
1070
1140
|
exports.wrapServerWithToolGovernance = wrapServerWithToolGovernance;
|