@topolo/mcp 0.7.1 → 0.7.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/dist/dispatch.js +1 -6
- package/dist/http.js +8 -13
- package/dist/index.js +21 -6
- package/package.json +2 -2
package/dist/dispatch.js
CHANGED
|
@@ -216,13 +216,8 @@ var TOOLS = [
|
|
|
216
216
|
if (input !== void 0 && (!input || typeof input !== "object" || Array.isArray(input))) {
|
|
217
217
|
throw new Error("input must be an object.");
|
|
218
218
|
}
|
|
219
|
-
const action = await topolo.client.getAction(actionId);
|
|
220
|
-
const agentAccess = action.agentAccess ?? (action.destructive ? "off" : action.readOnly && !action.requiresConfirmation ? "auto" : "confirm");
|
|
221
|
-
if (action.method !== "GET" || !action.readOnly || action.destructive || action.requiresConfirmation || agentAccess !== "auto") {
|
|
222
|
-
throw new Error(`Action "${actionId}" is not an automatic read-only action. Use topolo_call_action with confirmation.`);
|
|
223
|
-
}
|
|
224
219
|
const resource = optionalResourceContext(args);
|
|
225
|
-
return topolo.client.
|
|
220
|
+
return topolo.client.readAction(
|
|
226
221
|
actionId,
|
|
227
222
|
input ?? {},
|
|
228
223
|
resource ? { resource } : {}
|
package/dist/http.js
CHANGED
|
@@ -3098,9 +3098,9 @@ var require_data = __commonJS({
|
|
|
3098
3098
|
}
|
|
3099
3099
|
});
|
|
3100
3100
|
|
|
3101
|
-
// ../../node_modules/.pnpm/fast-uri@3.1.
|
|
3101
|
+
// ../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js
|
|
3102
3102
|
var require_utils = __commonJS({
|
|
3103
|
-
"../../node_modules/.pnpm/fast-uri@3.1.
|
|
3103
|
+
"../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
3104
3104
|
"use strict";
|
|
3105
3105
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
3106
3106
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
@@ -3411,9 +3411,9 @@ var require_utils = __commonJS({
|
|
|
3411
3411
|
}
|
|
3412
3412
|
});
|
|
3413
3413
|
|
|
3414
|
-
// ../../node_modules/.pnpm/fast-uri@3.1.
|
|
3414
|
+
// ../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js
|
|
3415
3415
|
var require_schemes = __commonJS({
|
|
3416
|
-
"../../node_modules/.pnpm/fast-uri@3.1.
|
|
3416
|
+
"../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
3417
3417
|
"use strict";
|
|
3418
3418
|
var { isUUID } = require_utils();
|
|
3419
3419
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
@@ -3621,9 +3621,9 @@ var require_schemes = __commonJS({
|
|
|
3621
3621
|
}
|
|
3622
3622
|
});
|
|
3623
3623
|
|
|
3624
|
-
// ../../node_modules/.pnpm/fast-uri@3.1.
|
|
3624
|
+
// ../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js
|
|
3625
3625
|
var require_fast_uri = __commonJS({
|
|
3626
|
-
"../../node_modules/.pnpm/fast-uri@3.1.
|
|
3626
|
+
"../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js"(exports, module) {
|
|
3627
3627
|
"use strict";
|
|
3628
3628
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3629
3629
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
@@ -3836,7 +3836,7 @@ var require_fast_uri = __commonJS({
|
|
|
3836
3836
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
3837
3837
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
3838
3838
|
try {
|
|
3839
|
-
parsed.host =
|
|
3839
|
+
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
3840
3840
|
} catch (e) {
|
|
3841
3841
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
3842
3842
|
}
|
|
@@ -16024,13 +16024,8 @@ var TOOLS = [
|
|
|
16024
16024
|
if (input !== void 0 && (!input || typeof input !== "object" || Array.isArray(input))) {
|
|
16025
16025
|
throw new Error("input must be an object.");
|
|
16026
16026
|
}
|
|
16027
|
-
const action = await topolo.client.getAction(actionId);
|
|
16028
|
-
const agentAccess = action.agentAccess ?? (action.destructive ? "off" : action.readOnly && !action.requiresConfirmation ? "auto" : "confirm");
|
|
16029
|
-
if (action.method !== "GET" || !action.readOnly || action.destructive || action.requiresConfirmation || agentAccess !== "auto") {
|
|
16030
|
-
throw new Error(`Action "${actionId}" is not an automatic read-only action. Use topolo_call_action with confirmation.`);
|
|
16031
|
-
}
|
|
16032
16027
|
const resource = optionalResourceContext(args);
|
|
16033
|
-
return topolo.client.
|
|
16028
|
+
return topolo.client.readAction(
|
|
16034
16029
|
actionId,
|
|
16035
16030
|
input ?? {},
|
|
16036
16031
|
resource ? { resource } : {}
|
package/dist/index.js
CHANGED
|
@@ -2537,7 +2537,21 @@ var TopoloClient = class _TopoloClient {
|
|
|
2537
2537
|
return match;
|
|
2538
2538
|
}
|
|
2539
2539
|
async callAction(action, input = {}, options = {}) {
|
|
2540
|
+
const entry = await this.getAction(action);
|
|
2541
|
+
return this.executeResolvedAction(entry, input, options);
|
|
2542
|
+
}
|
|
2543
|
+
async readAction(action, input = {}, options = {}) {
|
|
2540
2544
|
const entry = await this.getAction(action);
|
|
2545
|
+
const agentAccess = entry.agentAccess ?? (entry.destructive ? "off" : entry.readOnly && !entry.requiresConfirmation ? "auto" : "confirm");
|
|
2546
|
+
if (entry.method !== "GET" || !entry.readOnly || entry.destructive || entry.requiresConfirmation || agentAccess !== "auto") {
|
|
2547
|
+
throw new TopoloPermissionError(
|
|
2548
|
+
`Topolo action "${entry.actionId}" is not an automatic read-only action.`,
|
|
2549
|
+
entry.requiredPermission ? [entry.requiredPermission] : []
|
|
2550
|
+
);
|
|
2551
|
+
}
|
|
2552
|
+
return this.executeResolvedAction(entry, input, options);
|
|
2553
|
+
}
|
|
2554
|
+
async executeResolvedAction(entry, input, options) {
|
|
2541
2555
|
const agentAccess = entry.agentAccess ?? (entry.destructive ? "off" : entry.readOnly && !entry.requiresConfirmation ? "auto" : "confirm");
|
|
2542
2556
|
if (agentAccess === "off") {
|
|
2543
2557
|
throw new TopoloPermissionError(
|
|
@@ -2609,6 +2623,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2609
2623
|
const kind = payload.credentialType === "api_key" ? "api_key" : "access_token";
|
|
2610
2624
|
return {
|
|
2611
2625
|
kind,
|
|
2626
|
+
authorizationMode: normalizeCredentialAuthorizationMode(payload.authorizationMode, kind),
|
|
2612
2627
|
user: {
|
|
2613
2628
|
id: user.id,
|
|
2614
2629
|
email: user.email,
|
|
@@ -2871,6 +2886,11 @@ function objectToQuery(value) {
|
|
|
2871
2886
|
}
|
|
2872
2887
|
return Object.keys(query).length > 0 ? query : void 0;
|
|
2873
2888
|
}
|
|
2889
|
+
function normalizeCredentialAuthorizationMode(value, kind) {
|
|
2890
|
+
if (kind === "api_key") return "api_key";
|
|
2891
|
+
if (value === "context_rbac" || value === "oauth_scopes" || value === "session_rbac") return value;
|
|
2892
|
+
return "unknown";
|
|
2893
|
+
}
|
|
2874
2894
|
function describeError(body, fallback) {
|
|
2875
2895
|
if (body && typeof body === "object") {
|
|
2876
2896
|
const maybe = body;
|
|
@@ -3543,13 +3563,8 @@ var TOOLS = [
|
|
|
3543
3563
|
if (input !== void 0 && (!input || typeof input !== "object" || Array.isArray(input))) {
|
|
3544
3564
|
throw new Error("input must be an object.");
|
|
3545
3565
|
}
|
|
3546
|
-
const action = await topolo.client.getAction(actionId);
|
|
3547
|
-
const agentAccess = action.agentAccess ?? (action.destructive ? "off" : action.readOnly && !action.requiresConfirmation ? "auto" : "confirm");
|
|
3548
|
-
if (action.method !== "GET" || !action.readOnly || action.destructive || action.requiresConfirmation || agentAccess !== "auto") {
|
|
3549
|
-
throw new Error(`Action "${actionId}" is not an automatic read-only action. Use topolo_call_action with confirmation.`);
|
|
3550
|
-
}
|
|
3551
3566
|
const resource = optionalResourceContext(args);
|
|
3552
|
-
return topolo.client.
|
|
3567
|
+
return topolo.client.readAction(
|
|
3553
3568
|
actionId,
|
|
3554
3569
|
input ?? {},
|
|
3555
3570
|
resource ? { resource } : {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Model Context Protocol server for the Topolo platform. Exposes scope-gated tools that third-party agents (Claude, Codex, etc.) can call natively.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@topolo/sdk": "^0.8.
|
|
39
|
+
"@topolo/sdk": "^0.8.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@topolo/sdk": "file:../topolo-sdk",
|