@topolo/mcp 0.11.10 → 0.11.11
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/index.js +36 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1540,7 +1540,9 @@ var TopoloClient = class _TopoloClient {
|
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
1542
1542
|
planResolvedAction(entry, input, options) {
|
|
1543
|
-
const
|
|
1543
|
+
const inputValidation = validateTopoloActionInput(entry.inputSchema, input);
|
|
1544
|
+
const resourceIssue = validateActionResource(entry, options.resource);
|
|
1545
|
+
const validation = resourceIssue ? { valid: false, errors: [...inputValidation.errors, resourceIssue] } : inputValidation;
|
|
1544
1546
|
const agentAccess = entry.agentAccess ?? (entry.destructive ? "off" : entry.readOnly && !entry.requiresConfirmation ? "auto" : "confirm");
|
|
1545
1547
|
const confirmationRequired = agentAccess === "confirm" || entry.requiresConfirmation || entry.destructive;
|
|
1546
1548
|
let request = null;
|
|
@@ -1599,6 +1601,13 @@ var TopoloClient = class _TopoloClient {
|
|
|
1599
1601
|
`Topolo action "${entry.actionId}" input is invalid: ${validation.errors.map((issue) => `${issue.path} ${issue.message}`).join("; ")}`
|
|
1600
1602
|
);
|
|
1601
1603
|
}
|
|
1604
|
+
const resourceIssue = validateActionResource(entry, options.resource);
|
|
1605
|
+
if (resourceIssue) {
|
|
1606
|
+
throw new TopoloSdkError(
|
|
1607
|
+
"invalid_action_resource",
|
|
1608
|
+
`Topolo action "${entry.actionId}" resource context is invalid: ${resourceIssue.message}`
|
|
1609
|
+
);
|
|
1610
|
+
}
|
|
1602
1611
|
const mapped = mapActionInput(entry, input);
|
|
1603
1612
|
const service = entry.appSlug || entry.appId;
|
|
1604
1613
|
const result = await this.request({
|
|
@@ -1661,6 +1670,32 @@ var TopoloClient = class _TopoloClient {
|
|
|
1661
1670
|
};
|
|
1662
1671
|
}
|
|
1663
1672
|
};
|
|
1673
|
+
function validateActionResource(entry, resource) {
|
|
1674
|
+
const permissionName = entry.permissionName || entry.requiredPermission.split(".").at(-1) || "";
|
|
1675
|
+
if (!permissionName.startsWith("workspace:")) return null;
|
|
1676
|
+
if (!resource) {
|
|
1677
|
+
return {
|
|
1678
|
+
path: "$.resource",
|
|
1679
|
+
code: "required",
|
|
1680
|
+
message: "Select a workspace with the application resource catalog before planning or calling this action."
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
if (resource.resourceType !== "workspace") {
|
|
1684
|
+
return {
|
|
1685
|
+
path: "$.resource.resourceType",
|
|
1686
|
+
code: "const",
|
|
1687
|
+
message: 'This action requires resourceType "workspace".'
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
if (!resource.resourceId.trim()) {
|
|
1691
|
+
return {
|
|
1692
|
+
path: "$.resource.resourceId",
|
|
1693
|
+
code: "required",
|
|
1694
|
+
message: "This action requires a workspace resourceId."
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
return null;
|
|
1698
|
+
}
|
|
1664
1699
|
function resolveConfiguredAppId(slug, appIds) {
|
|
1665
1700
|
for (const serviceKey of serviceKeyCandidates2(slug)) {
|
|
1666
1701
|
const configured = appIds?.[serviceKey];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/mcp",
|
|
3
|
-
"version": "0.11.
|
|
4
|
-
"topoloPublishedVersion": "0.11.
|
|
3
|
+
"version": "0.11.11",
|
|
4
|
+
"topoloPublishedVersion": "0.11.11",
|
|
5
5
|
"description": "Model Context Protocol server for the Topolo platform. Exposes scope-gated tools that third-party agents (Claude, Codex, etc.) can call natively.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"author": "Topolo",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
38
|
-
"@topolo/sdk": "0.11.
|
|
38
|
+
"@topolo/sdk": "0.11.11"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^20.12.0",
|