@superblocksteam/cli 2.0.105-next.0 → 2.0.105-next.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/README.md +7 -6
- package/dist/{acorn-SPLJYDYN.js → acorn-CN6JYU6C.js} +3 -3
- package/dist/{angular-T25DB2NK.js → angular-2PNX3NJU.js} +3 -3
- package/dist/{api-6GH5RQOD.js → api-WBVLJHKL.js} +4 -4
- package/dist/{babel-NSJKWHAB.js → babel-3RYFPIHU.js} +3 -3
- package/dist/{chunk-IFUC4XZ2.js → chunk-6GJILK2C.js} +3 -3
- package/dist/chunk-6HO5XFAA.js +202 -0
- package/dist/chunk-6HO5XFAA.js.map +1 -0
- package/dist/{chunk-D7AZ3MNH.js → chunk-73IQKEW6.js} +3 -3
- package/dist/{chunk-GWMV3B7E.js → chunk-7F365BAF.js} +3 -3
- package/dist/{chunk-MLZWCAZM.js → chunk-BMTHQVNU.js} +6 -6
- package/dist/{chunk-QLZERZ2C.js → chunk-DBJL76JG.js} +2 -2
- package/dist/{chunk-L77W7UDL.js → chunk-DJS34GDP.js} +3 -3
- package/dist/{chunk-BSMI6NM3.js → chunk-FBRQ5GQY.js} +3 -3
- package/dist/{chunk-SWTFHX2J.js → chunk-IZ6TQ7NB.js} +3 -3
- package/dist/{chunk-NR35G7X3.js → chunk-OXC4M25U.js} +3 -3
- package/dist/{chunk-SOHOJJJL.js → chunk-Q5XZN3IH.js} +2516 -895
- package/dist/{chunk-SOHOJJJL.js.map → chunk-Q5XZN3IH.js.map} +1 -1
- package/dist/{chunk-HBXTW4UL.js → chunk-SWTDPYKF.js} +4 -4
- package/dist/{chunk-XHOK2OVZ.js → chunk-UR32AWL5.js} +3 -3
- package/dist/{chunk-7Y5NQEZS.js → chunk-V6HYX527.js} +3 -3
- package/dist/{chunk-6LTX4MKG.js → chunk-VRPW5BO7.js} +797 -198
- package/dist/chunk-VRPW5BO7.js.map +1 -0
- package/dist/{chunk-7HJMPY3P.js → chunk-XBQQ5LE3.js} +4 -4
- package/dist/{chunk-TUVNDUIM.js → chunk-YHSSGIR6.js} +4 -4
- package/dist/{cli-truncate-XKVKQ74O.js → cli-truncate-KBCISWJV.js} +5 -5
- package/dist/commands/dev-parent.js +2 -2
- package/dist/{dd-trace-FCIYQ26X.js → dd-trace-FGSZE4GX.js} +7 -7
- package/dist/{dist-PJRKTNKT.js → dist-ZNOR3C4J.js} +92 -34
- package/dist/dist-ZNOR3C4J.js.map +1 -0
- package/dist/{embedded-playwright-mcp-server-NARAP7OX.js → embedded-playwright-mcp-server-V35WE5T4.js} +3 -3
- package/dist/{enquirer-HTDPPQVH.js → enquirer-IXV6MGEM.js} +4 -4
- package/dist/{estree-2DSUUTQW.js → estree-XCEZDHRY.js} +3 -3
- package/dist/{flow-AOBRKQNJ.js → flow-OGEDI4B4.js} +3 -3
- package/dist/{getMachineId-bsd-FOIKWXDF.js → getMachineId-bsd-L2HGZSI6.js} +5 -5
- package/dist/{getMachineId-darwin-D52IQFXV.js → getMachineId-darwin-E6XNMPMP.js} +5 -5
- package/dist/{getMachineId-linux-PYKZK6KJ.js → getMachineId-linux-2CTIDIMS.js} +4 -4
- package/dist/{getMachineId-unsupported-MFQ2NJL2.js → getMachineId-unsupported-SK7LPXEI.js} +4 -4
- package/dist/{getMachineId-win-ECKGLXSG.js → getMachineId-win-B5E2HZYV.js} +5 -5
- package/dist/{glimmer-4PG6LXDZ.js → glimmer-OKVWSALA.js} +3 -3
- package/dist/{graphql-YBZHJ76A.js → graphql-YKF6QG2X.js} +3 -3
- package/dist/{html-N6IZH7PR.js → html-WIQCGFFQ.js} +3 -3
- package/dist/{http-GN34UTTD.js → http-5US3EJWW.js} +22 -115
- package/dist/http-5US3EJWW.js.map +1 -0
- package/dist/index.js +76 -46
- package/dist/index.js.map +1 -1
- package/dist/{jiti-MK2H65EM.js → jiti-EQEMGT6R.js} +3 -3
- package/dist/{log-update-SCNS3K3A.js → log-update-N5NNRYXM.js} +6 -6
- package/dist/{markdown-CRX6BOVX.js → markdown-WVMNDMRR.js} +3 -3
- package/dist/{meriyah-SQYD2WKB.js → meriyah-EWMMQMZU.js} +3 -3
- package/dist/{postcss-NLXHGDM2.js → postcss-44ISHF3Y.js} +3 -3
- package/dist/{read-pkg-O2DIYDZG.js → read-pkg-2HVFBBQB.js} +5 -5
- package/dist/{spans-4KMUHQCG.js → spans-SYI7DLFQ.js} +4 -4
- package/dist/{src-LMPHLH56.js → src-U5FIU7HU.js} +3 -3
- package/dist/{token-APXEU5RC.js → token-FDI4WOAX.js} +5 -5
- package/dist/{token-util-7BVKQ4XI.js → token-util-4NEFLWRZ.js} +5 -5
- package/dist/{typescript-H7UDWRQZ.js → typescript-PW5Z5LOC.js} +3 -3
- package/dist/{wrap-ansi-7QR2XAUH.js → wrap-ansi-54ZJTV6S.js} +5 -5
- package/dist/{yaml-DVCR22BU.js → yaml-BRCVPHKB.js} +3 -3
- package/oclif.manifest.json +10 -4
- package/package.json +5 -5
- package/dist/chunk-6LTX4MKG.js.map +0 -1
- package/dist/dist-PJRKTNKT.js.map +0 -1
- package/dist/http-GN34UTTD.js.map +0 -1
- /package/dist/{acorn-SPLJYDYN.js.map → acorn-CN6JYU6C.js.map} +0 -0
- /package/dist/{angular-T25DB2NK.js.map → angular-2PNX3NJU.js.map} +0 -0
- /package/dist/{api-6GH5RQOD.js.map → api-WBVLJHKL.js.map} +0 -0
- /package/dist/{babel-NSJKWHAB.js.map → babel-3RYFPIHU.js.map} +0 -0
- /package/dist/{chunk-IFUC4XZ2.js.map → chunk-6GJILK2C.js.map} +0 -0
- /package/dist/{chunk-D7AZ3MNH.js.map → chunk-73IQKEW6.js.map} +0 -0
- /package/dist/{chunk-GWMV3B7E.js.map → chunk-7F365BAF.js.map} +0 -0
- /package/dist/{chunk-MLZWCAZM.js.map → chunk-BMTHQVNU.js.map} +0 -0
- /package/dist/{chunk-QLZERZ2C.js.map → chunk-DBJL76JG.js.map} +0 -0
- /package/dist/{chunk-L77W7UDL.js.map → chunk-DJS34GDP.js.map} +0 -0
- /package/dist/{chunk-BSMI6NM3.js.map → chunk-FBRQ5GQY.js.map} +0 -0
- /package/dist/{chunk-SWTFHX2J.js.map → chunk-IZ6TQ7NB.js.map} +0 -0
- /package/dist/{chunk-NR35G7X3.js.map → chunk-OXC4M25U.js.map} +0 -0
- /package/dist/{chunk-HBXTW4UL.js.map → chunk-SWTDPYKF.js.map} +0 -0
- /package/dist/{chunk-XHOK2OVZ.js.map → chunk-UR32AWL5.js.map} +0 -0
- /package/dist/{chunk-7Y5NQEZS.js.map → chunk-V6HYX527.js.map} +0 -0
- /package/dist/{chunk-7HJMPY3P.js.map → chunk-XBQQ5LE3.js.map} +0 -0
- /package/dist/{chunk-TUVNDUIM.js.map → chunk-YHSSGIR6.js.map} +0 -0
- /package/dist/{cli-truncate-XKVKQ74O.js.map → cli-truncate-KBCISWJV.js.map} +0 -0
- /package/dist/{dd-trace-FCIYQ26X.js.map → dd-trace-FGSZE4GX.js.map} +0 -0
- /package/dist/{embedded-playwright-mcp-server-NARAP7OX.js.map → embedded-playwright-mcp-server-V35WE5T4.js.map} +0 -0
- /package/dist/{enquirer-HTDPPQVH.js.map → enquirer-IXV6MGEM.js.map} +0 -0
- /package/dist/{estree-2DSUUTQW.js.map → estree-XCEZDHRY.js.map} +0 -0
- /package/dist/{flow-AOBRKQNJ.js.map → flow-OGEDI4B4.js.map} +0 -0
- /package/dist/{getMachineId-bsd-FOIKWXDF.js.map → getMachineId-bsd-L2HGZSI6.js.map} +0 -0
- /package/dist/{getMachineId-darwin-D52IQFXV.js.map → getMachineId-darwin-E6XNMPMP.js.map} +0 -0
- /package/dist/{getMachineId-linux-PYKZK6KJ.js.map → getMachineId-linux-2CTIDIMS.js.map} +0 -0
- /package/dist/{getMachineId-unsupported-MFQ2NJL2.js.map → getMachineId-unsupported-SK7LPXEI.js.map} +0 -0
- /package/dist/{getMachineId-win-ECKGLXSG.js.map → getMachineId-win-B5E2HZYV.js.map} +0 -0
- /package/dist/{glimmer-4PG6LXDZ.js.map → glimmer-OKVWSALA.js.map} +0 -0
- /package/dist/{graphql-YBZHJ76A.js.map → graphql-YKF6QG2X.js.map} +0 -0
- /package/dist/{html-N6IZH7PR.js.map → html-WIQCGFFQ.js.map} +0 -0
- /package/dist/{jiti-MK2H65EM.js.map → jiti-EQEMGT6R.js.map} +0 -0
- /package/dist/{log-update-SCNS3K3A.js.map → log-update-N5NNRYXM.js.map} +0 -0
- /package/dist/{markdown-CRX6BOVX.js.map → markdown-WVMNDMRR.js.map} +0 -0
- /package/dist/{meriyah-SQYD2WKB.js.map → meriyah-EWMMQMZU.js.map} +0 -0
- /package/dist/{postcss-NLXHGDM2.js.map → postcss-44ISHF3Y.js.map} +0 -0
- /package/dist/{read-pkg-O2DIYDZG.js.map → read-pkg-2HVFBBQB.js.map} +0 -0
- /package/dist/{spans-4KMUHQCG.js.map → spans-SYI7DLFQ.js.map} +0 -0
- /package/dist/{src-LMPHLH56.js.map → src-U5FIU7HU.js.map} +0 -0
- /package/dist/{token-APXEU5RC.js.map → token-FDI4WOAX.js.map} +0 -0
- /package/dist/{token-util-7BVKQ4XI.js.map → token-util-4NEFLWRZ.js.map} +0 -0
- /package/dist/{typescript-H7UDWRQZ.js.map → typescript-PW5Z5LOC.js.map} +0 -0
- /package/dist/{wrap-ansi-7QR2XAUH.js.map → wrap-ansi-54ZJTV6S.js.map} +0 -0
- /package/dist/{yaml-DVCR22BU.js.map → yaml-BRCVPHKB.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
if (typeof process === 'object' && process !== null &&
|
|
2
2
|
process.env !== null && typeof process.env === 'object') {
|
|
3
3
|
process.env.DD_GIT_REPOSITORY_URL = 'https://token@github.com/superblocksteam/superblocks.git';
|
|
4
|
-
process.env.DD_GIT_COMMIT_SHA = '
|
|
4
|
+
process.env.DD_GIT_COMMIT_SHA = 'de5c3e104e3ed96f50cc0f43a6c093c0132245f9';
|
|
5
5
|
}
|
|
6
6
|
import { createRequire as $dd_createRequire } from 'module';
|
|
7
7
|
import { fileURLToPath as $dd_fileURLToPath } from 'url';
|
|
@@ -16,15 +16,194 @@ import {
|
|
|
16
16
|
require_dist,
|
|
17
17
|
require_dist2,
|
|
18
18
|
writeApplicationToDisk
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-Q5XZN3IH.js";
|
|
20
20
|
import {
|
|
21
21
|
require_lib
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UR32AWL5.js";
|
|
23
23
|
import {
|
|
24
24
|
__export,
|
|
25
25
|
__toESM,
|
|
26
26
|
init_cjs_shims
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DBJL76JG.js";
|
|
28
|
+
|
|
29
|
+
// ../mcp-server/package.json
|
|
30
|
+
var package_default = {
|
|
31
|
+
name: "@superblocksteam/mcp-server",
|
|
32
|
+
version: "2.0.105-next.2",
|
|
33
|
+
description: "Superblocks MCP server",
|
|
34
|
+
license: "Superblocks Community Software License",
|
|
35
|
+
bin: {
|
|
36
|
+
"superblocks-mcp": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
files: [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
type: "module",
|
|
42
|
+
main: "dist/index.js",
|
|
43
|
+
exports: {
|
|
44
|
+
".": {
|
|
45
|
+
types: "./dist/index.d.ts",
|
|
46
|
+
import: "./dist/index.js",
|
|
47
|
+
default: "./dist/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./http": {
|
|
50
|
+
types: "./dist/http.d.ts",
|
|
51
|
+
import: "./dist/http.js",
|
|
52
|
+
default: "./dist/http.js"
|
|
53
|
+
},
|
|
54
|
+
"./jsonrpc": {
|
|
55
|
+
types: "./dist/jsonrpc.d.ts",
|
|
56
|
+
import: "./dist/jsonrpc.js",
|
|
57
|
+
default: "./dist/jsonrpc.js"
|
|
58
|
+
},
|
|
59
|
+
"./auth/context": {
|
|
60
|
+
types: "./dist/auth/context.d.ts",
|
|
61
|
+
import: "./dist/auth/context.js",
|
|
62
|
+
default: "./dist/auth/context.js"
|
|
63
|
+
},
|
|
64
|
+
"./setup": {
|
|
65
|
+
types: "./dist/setup/index.d.ts",
|
|
66
|
+
import: "./dist/setup/index.js",
|
|
67
|
+
default: "./dist/setup/index.js"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
scripts: {
|
|
71
|
+
build: "tsc --build tsconfig.build.json",
|
|
72
|
+
check: "pnpm run lint && pnpm run typecheck",
|
|
73
|
+
dev: "tsc --build tsconfig.build.json --watch --preserveWatchOutput",
|
|
74
|
+
lint: "eslint --concurrency=auto",
|
|
75
|
+
"lint:fix": "eslint src --fix --concurrency=auto",
|
|
76
|
+
"publish-package": "pnpm publish",
|
|
77
|
+
test: "vitest run --config vitest.config.ts",
|
|
78
|
+
typecheck: "tsc --noEmit"
|
|
79
|
+
},
|
|
80
|
+
dependencies: {
|
|
81
|
+
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
82
|
+
"@superblocksteam/sdk": "workspace:*",
|
|
83
|
+
"@superblocksteam/shared": "workspace:*",
|
|
84
|
+
"@superblocksteam/util": "workspace:*",
|
|
85
|
+
"fs-extra": "^11.3.0",
|
|
86
|
+
zod: "^4.3.6"
|
|
87
|
+
},
|
|
88
|
+
devDependencies: {
|
|
89
|
+
"@types/fs-extra": "^11.0.4",
|
|
90
|
+
"@types/node": "catalog:",
|
|
91
|
+
eslint: "catalog:",
|
|
92
|
+
tsdown: "catalog:",
|
|
93
|
+
typescript: "catalog:",
|
|
94
|
+
"typescript-eslint": "catalog:",
|
|
95
|
+
vitest: "catalog:"
|
|
96
|
+
},
|
|
97
|
+
engines: {
|
|
98
|
+
node: ">=24",
|
|
99
|
+
npm: ">=10.x"
|
|
100
|
+
},
|
|
101
|
+
publishConfig: {
|
|
102
|
+
registry: "https://registry.npmjs.org"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// ../mcp-server/dist/jsonrpc.js
|
|
107
|
+
init_cjs_shims();
|
|
108
|
+
function isJsonRpcRequest(value) {
|
|
109
|
+
return typeof value === "object" && value !== null && "jsonrpc" in value && value.jsonrpc === "2.0" && "method" in value && typeof value.method === "string";
|
|
110
|
+
}
|
|
111
|
+
function invalidRequestResponse() {
|
|
112
|
+
return {
|
|
113
|
+
jsonrpc: "2.0",
|
|
114
|
+
id: null,
|
|
115
|
+
error: { code: -32600, message: "Invalid Request" }
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async function handleJsonRpc(request, options) {
|
|
119
|
+
const hasRequestId = Object.keys(request).includes("id");
|
|
120
|
+
const maybeRespond = (response) => hasRequestId ? response : null;
|
|
121
|
+
let id = null;
|
|
122
|
+
try {
|
|
123
|
+
id = hasRequestId ? request.id ?? null : null;
|
|
124
|
+
switch (request.method) {
|
|
125
|
+
case "initialize": {
|
|
126
|
+
return maybeRespond({
|
|
127
|
+
jsonrpc: "2.0",
|
|
128
|
+
id,
|
|
129
|
+
result: {
|
|
130
|
+
protocolVersion: "2025-03-26",
|
|
131
|
+
capabilities: { tools: {} },
|
|
132
|
+
serverInfo: {
|
|
133
|
+
name: "superblocks-mcp",
|
|
134
|
+
version: options.version
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
case "tools/list": {
|
|
140
|
+
return maybeRespond({
|
|
141
|
+
jsonrpc: "2.0",
|
|
142
|
+
id,
|
|
143
|
+
result: { tools: options.listTools() }
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
case "tools/call": {
|
|
147
|
+
const params = request.params;
|
|
148
|
+
if (!params?.name) {
|
|
149
|
+
return maybeRespond({
|
|
150
|
+
jsonrpc: "2.0",
|
|
151
|
+
id,
|
|
152
|
+
error: { code: -32602, message: "Missing tool name" }
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
const result = await options.executeToolCall(params.name, params.arguments);
|
|
157
|
+
return maybeRespond({ jsonrpc: "2.0", id, result });
|
|
158
|
+
} catch (error48) {
|
|
159
|
+
const code = typeof error48.code === "number" ? error48.code : -32603;
|
|
160
|
+
return maybeRespond({
|
|
161
|
+
jsonrpc: "2.0",
|
|
162
|
+
id,
|
|
163
|
+
error: {
|
|
164
|
+
code,
|
|
165
|
+
message: error48 instanceof Error ? error48.message : "Internal server error"
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
case "notifications/initialized": {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
case "ping": {
|
|
174
|
+
return maybeRespond({ jsonrpc: "2.0", id, result: {} });
|
|
175
|
+
}
|
|
176
|
+
default: {
|
|
177
|
+
return maybeRespond({
|
|
178
|
+
jsonrpc: "2.0",
|
|
179
|
+
id,
|
|
180
|
+
error: {
|
|
181
|
+
code: -32601,
|
|
182
|
+
message: `Method not found: ${request.method}`
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} catch (error48) {
|
|
188
|
+
return maybeRespond({
|
|
189
|
+
jsonrpc: "2.0",
|
|
190
|
+
id,
|
|
191
|
+
error: {
|
|
192
|
+
code: -32603,
|
|
193
|
+
message: error48 instanceof Error ? error48.message : "Internal server error"
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// ../mcp-server/dist/profile.js
|
|
200
|
+
init_cjs_shims();
|
|
201
|
+
function resolveProfile() {
|
|
202
|
+
if (process.env.SUPERBLOCKS_MCP_PROFILE === "internal") {
|
|
203
|
+
return "internal";
|
|
204
|
+
}
|
|
205
|
+
return "customer";
|
|
206
|
+
}
|
|
28
207
|
|
|
29
208
|
// ../../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
30
209
|
init_cjs_shims();
|
|
@@ -15410,107 +15589,21 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
15410
15589
|
}
|
|
15411
15590
|
};
|
|
15412
15591
|
|
|
15413
|
-
// ../mcp-server/
|
|
15414
|
-
var package_default = {
|
|
15415
|
-
name: "@superblocksteam/mcp-server",
|
|
15416
|
-
version: "2.0.105-next.0",
|
|
15417
|
-
description: "Superblocks MCP server",
|
|
15418
|
-
license: "Superblocks Community Software License",
|
|
15419
|
-
bin: {
|
|
15420
|
-
"superblocks-mcp": "./dist/index.js"
|
|
15421
|
-
},
|
|
15422
|
-
files: [
|
|
15423
|
-
"dist"
|
|
15424
|
-
],
|
|
15425
|
-
type: "module",
|
|
15426
|
-
main: "dist/index.js",
|
|
15427
|
-
exports: {
|
|
15428
|
-
".": {
|
|
15429
|
-
types: "./dist/index.d.ts",
|
|
15430
|
-
import: "./dist/index.js"
|
|
15431
|
-
},
|
|
15432
|
-
"./http": {
|
|
15433
|
-
types: "./dist/http.d.ts",
|
|
15434
|
-
import: "./dist/http.js"
|
|
15435
|
-
}
|
|
15436
|
-
},
|
|
15437
|
-
scripts: {
|
|
15438
|
-
build: "tsc --build tsconfig.build.json",
|
|
15439
|
-
check: "pnpm run lint && pnpm run typecheck",
|
|
15440
|
-
dev: "tsc --build tsconfig.build.json --watch --preserveWatchOutput",
|
|
15441
|
-
lint: "eslint --concurrency=auto",
|
|
15442
|
-
"lint:fix": "eslint src --fix --concurrency=auto",
|
|
15443
|
-
"publish-package": "pnpm publish",
|
|
15444
|
-
test: "vitest run --config vitest.config.ts",
|
|
15445
|
-
typecheck: "tsc --noEmit"
|
|
15446
|
-
},
|
|
15447
|
-
dependencies: {
|
|
15448
|
-
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
15449
|
-
"@superblocksteam/sdk": "workspace:*",
|
|
15450
|
-
"@superblocksteam/shared": "workspace:*",
|
|
15451
|
-
"@superblocksteam/util": "workspace:*",
|
|
15452
|
-
"fs-extra": "^11.3.0",
|
|
15453
|
-
zod: "^4.3.6"
|
|
15454
|
-
},
|
|
15455
|
-
devDependencies: {
|
|
15456
|
-
"@types/fs-extra": "^11.0.4",
|
|
15457
|
-
"@types/node": "catalog:",
|
|
15458
|
-
eslint: "catalog:",
|
|
15459
|
-
tsdown: "catalog:",
|
|
15460
|
-
typescript: "catalog:",
|
|
15461
|
-
"typescript-eslint": "catalog:",
|
|
15462
|
-
vitest: "catalog:"
|
|
15463
|
-
},
|
|
15464
|
-
engines: {
|
|
15465
|
-
node: ">=24",
|
|
15466
|
-
npm: ">=10.x"
|
|
15467
|
-
},
|
|
15468
|
-
publishConfig: {
|
|
15469
|
-
registry: "https://registry.npmjs.org"
|
|
15470
|
-
}
|
|
15471
|
-
};
|
|
15472
|
-
|
|
15473
|
-
// ../mcp-server/dist/profile.js
|
|
15592
|
+
// ../mcp-server/dist/auth/context.js
|
|
15474
15593
|
init_cjs_shims();
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
return "customer";
|
|
15594
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15595
|
+
var authStore = new AsyncLocalStorage();
|
|
15596
|
+
function getAuthContext() {
|
|
15597
|
+
return authStore.getStore();
|
|
15480
15598
|
}
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
init_cjs_shims();
|
|
15484
|
-
function buildToolRegistry(definitions, profile) {
|
|
15485
|
-
const filtered = profile === "internal" ? definitions : definitions.filter((d) => d.audience === "customer");
|
|
15486
|
-
return new ToolRegistry(filtered);
|
|
15599
|
+
function runWithAuthContext(context, fn) {
|
|
15600
|
+
return authStore.run(context, fn);
|
|
15487
15601
|
}
|
|
15488
|
-
var ToolRegistry = class {
|
|
15489
|
-
tools;
|
|
15490
|
-
constructor(definitions) {
|
|
15491
|
-
this.tools = new Map(definitions.map((d) => [d.name, d]));
|
|
15492
|
-
}
|
|
15493
|
-
listTools() {
|
|
15494
|
-
return [...this.tools.values()].map((d) => ({
|
|
15495
|
-
name: d.name,
|
|
15496
|
-
title: d.title,
|
|
15497
|
-
description: d.description,
|
|
15498
|
-
inputSchema: d.inputSchema,
|
|
15499
|
-
annotations: d.annotations
|
|
15500
|
-
}));
|
|
15501
|
-
}
|
|
15502
|
-
getHandler(name) {
|
|
15503
|
-
return this.tools.get(name)?.handler;
|
|
15504
|
-
}
|
|
15505
|
-
};
|
|
15506
|
-
|
|
15507
|
-
// ../mcp-server/dist/tools/index.js
|
|
15508
|
-
init_cjs_shims();
|
|
15509
15602
|
|
|
15510
|
-
// ../mcp-server/dist/tools/
|
|
15603
|
+
// ../mcp-server/dist/tools/registry.js
|
|
15511
15604
|
init_cjs_shims();
|
|
15512
15605
|
|
|
15513
|
-
//
|
|
15606
|
+
// ../mcp-server/dist/entitlement-wrapper.js
|
|
15514
15607
|
init_cjs_shims();
|
|
15515
15608
|
|
|
15516
15609
|
// ../mcp-server/dist/auth/resolve-auth.js
|
|
@@ -15576,28 +15669,28 @@ async function readAuthStore() {
|
|
|
15576
15669
|
origins: { ...EMPTY_AUTH_STORE.origins }
|
|
15577
15670
|
};
|
|
15578
15671
|
}
|
|
15579
|
-
const
|
|
15580
|
-
if (!
|
|
15672
|
+
const authStore2 = await import_fs_extra.default.readJSON(authFilePath);
|
|
15673
|
+
if (!authStore2 || typeof authStore2 !== "object" || !("origins" in authStore2)) {
|
|
15581
15674
|
throw new Error(`Invalid MCP auth store: ${authFilePath}`);
|
|
15582
15675
|
}
|
|
15583
15676
|
return {
|
|
15584
|
-
origins:
|
|
15677
|
+
origins: authStore2.origins
|
|
15585
15678
|
};
|
|
15586
15679
|
}
|
|
15587
|
-
async function writeAuthStore(
|
|
15680
|
+
async function writeAuthStore(authStore2) {
|
|
15588
15681
|
await ensureAuthDirectory();
|
|
15589
15682
|
const authFilePath = getMcpAuthFilePath();
|
|
15590
|
-
await import_fs_extra.default.writeJSON(authFilePath,
|
|
15683
|
+
await import_fs_extra.default.writeJSON(authFilePath, authStore2, { spaces: 2 });
|
|
15591
15684
|
await import_fs_extra.default.chmod(authFilePath, 384).catch(() => void 0);
|
|
15592
15685
|
}
|
|
15593
15686
|
async function upsertAuthToken(baseUrl, token) {
|
|
15594
15687
|
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
15595
|
-
const
|
|
15596
|
-
|
|
15688
|
+
const authStore2 = await readAuthStore();
|
|
15689
|
+
authStore2.origins[normalizedBaseUrl] = {
|
|
15597
15690
|
token,
|
|
15598
15691
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15599
15692
|
};
|
|
15600
|
-
await writeAuthStore(
|
|
15693
|
+
await writeAuthStore(authStore2);
|
|
15601
15694
|
return normalizedBaseUrl;
|
|
15602
15695
|
}
|
|
15603
15696
|
async function getStoredAuthToken(baseUrl) {
|
|
@@ -15605,12 +15698,12 @@ async function getStoredAuthToken(baseUrl) {
|
|
|
15605
15698
|
}
|
|
15606
15699
|
async function getStoredAuthEntry(baseUrl) {
|
|
15607
15700
|
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
15608
|
-
const
|
|
15609
|
-
return
|
|
15701
|
+
const authStore2 = await readAuthStore();
|
|
15702
|
+
return authStore2.origins[normalizedBaseUrl];
|
|
15610
15703
|
}
|
|
15611
15704
|
async function listStoredOrigins() {
|
|
15612
|
-
const
|
|
15613
|
-
return Object.keys(
|
|
15705
|
+
const authStore2 = await readAuthStore();
|
|
15706
|
+
return Object.keys(authStore2.origins).sort();
|
|
15614
15707
|
}
|
|
15615
15708
|
|
|
15616
15709
|
// ../mcp-server/dist/auth/resolve-auth.js
|
|
@@ -15636,6 +15729,15 @@ async function tryMcpStoreAuth(normalizedBaseUrl) {
|
|
|
15636
15729
|
return void 0;
|
|
15637
15730
|
}
|
|
15638
15731
|
async function getAuthStatusForOrigin(baseUrl) {
|
|
15732
|
+
const ctx = getAuthContext();
|
|
15733
|
+
if (ctx) {
|
|
15734
|
+
const normalizedRequested = normalizeBaseUrl(baseUrl);
|
|
15735
|
+
const normalizedContext = normalizeBaseUrl(ctx.baseUrl);
|
|
15736
|
+
if (normalizedRequested !== normalizedContext) {
|
|
15737
|
+
return { authenticated: false, source: null, updatedAt: null };
|
|
15738
|
+
}
|
|
15739
|
+
return { authenticated: true, source: "remote-context", updatedAt: null };
|
|
15740
|
+
}
|
|
15639
15741
|
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
15640
15742
|
const cliAuth = await tryCliAuth(normalizedBaseUrl);
|
|
15641
15743
|
if (cliAuth) {
|
|
@@ -15652,6 +15754,15 @@ async function getAuthStatusForOrigin(baseUrl) {
|
|
|
15652
15754
|
return { authenticated: false, source: null, updatedAt: null };
|
|
15653
15755
|
}
|
|
15654
15756
|
async function resolveAuthForOrigin(baseUrl) {
|
|
15757
|
+
const ctx = getAuthContext();
|
|
15758
|
+
if (ctx) {
|
|
15759
|
+
const normalizedRequested = normalizeBaseUrl(baseUrl);
|
|
15760
|
+
const normalizedContext = normalizeBaseUrl(ctx.baseUrl);
|
|
15761
|
+
if (normalizedRequested !== normalizedContext) {
|
|
15762
|
+
throw new Error(`Remote auth context is for ${normalizedContext}, but tool requested auth for ${normalizedRequested}`);
|
|
15763
|
+
}
|
|
15764
|
+
return { token: ctx.token, source: "remote-context" };
|
|
15765
|
+
}
|
|
15655
15766
|
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
15656
15767
|
const cliAuth = await tryCliAuth(normalizedBaseUrl);
|
|
15657
15768
|
if (cliAuth) {
|
|
@@ -15664,14 +15775,173 @@ async function resolveAuthForOrigin(baseUrl) {
|
|
|
15664
15775
|
throw new Error(`No API token configured for ${normalizedBaseUrl}. ${getAuthSetupHint(normalizedBaseUrl)}`);
|
|
15665
15776
|
}
|
|
15666
15777
|
|
|
15667
|
-
// ../mcp-server/dist/
|
|
15778
|
+
// ../mcp-server/dist/entitlement.js
|
|
15668
15779
|
init_cjs_shims();
|
|
15669
|
-
|
|
15670
|
-
|
|
15671
|
-
|
|
15780
|
+
|
|
15781
|
+
// ../mcp-server/dist/tools/server-api.js
|
|
15782
|
+
init_cjs_shims();
|
|
15783
|
+
function extractMessage(payload) {
|
|
15784
|
+
if (!payload || typeof payload !== "object")
|
|
15785
|
+
return void 0;
|
|
15786
|
+
const obj = payload;
|
|
15787
|
+
const responseMeta = obj.responseMeta;
|
|
15788
|
+
if (responseMeta && typeof responseMeta === "object" && "message" in responseMeta) {
|
|
15789
|
+
const msg = responseMeta.message;
|
|
15790
|
+
if (typeof msg === "string" && msg.length > 0)
|
|
15791
|
+
return msg;
|
|
15792
|
+
}
|
|
15793
|
+
if ("message" in obj && typeof obj.message === "string" && obj.message.length > 0) {
|
|
15794
|
+
return obj.message;
|
|
15795
|
+
}
|
|
15796
|
+
return void 0;
|
|
15797
|
+
}
|
|
15798
|
+
async function callServerApi(options) {
|
|
15799
|
+
const url2 = new URL(options.path, options.baseUrl);
|
|
15800
|
+
for (const [key, value] of Object.entries(options.query ?? {})) {
|
|
15801
|
+
if (value !== void 0) {
|
|
15802
|
+
url2.searchParams.set(key, String(value));
|
|
15803
|
+
}
|
|
15804
|
+
}
|
|
15805
|
+
const response = await fetch(url2, {
|
|
15806
|
+
method: options.method,
|
|
15807
|
+
headers: {
|
|
15808
|
+
Authorization: `Bearer ${options.token}`,
|
|
15809
|
+
...options.body !== void 0 ? { "Content-Type": "application/json" } : {}
|
|
15810
|
+
},
|
|
15811
|
+
body: options.body !== void 0 ? JSON.stringify(options.body) : void 0
|
|
15812
|
+
});
|
|
15813
|
+
const raw = await response.text();
|
|
15814
|
+
let parsed;
|
|
15815
|
+
if (raw.length > 0) {
|
|
15816
|
+
try {
|
|
15817
|
+
parsed = JSON.parse(raw);
|
|
15818
|
+
} catch {
|
|
15819
|
+
parsed = void 0;
|
|
15820
|
+
}
|
|
15821
|
+
}
|
|
15822
|
+
if (!response.ok) {
|
|
15823
|
+
const message = extractMessage(parsed) ?? (raw.length > 0 ? raw : response.statusText || "Request failed");
|
|
15824
|
+
throw new Error(message);
|
|
15825
|
+
}
|
|
15826
|
+
if (parsed && typeof parsed === "object" && "data" in parsed) {
|
|
15827
|
+
return parsed.data;
|
|
15828
|
+
}
|
|
15829
|
+
return parsed;
|
|
15830
|
+
}
|
|
15831
|
+
|
|
15832
|
+
// ../mcp-server/dist/entitlement.js
|
|
15833
|
+
var ENTITLED_PLANS = /* @__PURE__ */ new Set(["ENTERPRISE", "POC"]);
|
|
15834
|
+
var EntitlementError = class extends Error {
|
|
15835
|
+
plan;
|
|
15836
|
+
constructor(plan) {
|
|
15837
|
+
const planLabel = plan ?? "unknown";
|
|
15838
|
+
super(`The Superblocks MCP server requires an Enterprise or POC plan. Your organization is on the ${planLabel} plan. Contact sales to upgrade: https://www.superblocks.com/contact-sales`);
|
|
15839
|
+
this.name = "EntitlementError";
|
|
15840
|
+
this.plan = plan;
|
|
15841
|
+
}
|
|
15672
15842
|
};
|
|
15673
|
-
|
|
15674
|
-
|
|
15843
|
+
async function assertEnterprisePlan(baseUrl, token) {
|
|
15844
|
+
const data = await callServerApi({
|
|
15845
|
+
baseUrl,
|
|
15846
|
+
token,
|
|
15847
|
+
method: "GET",
|
|
15848
|
+
path: "api/v1/public/users/me"
|
|
15849
|
+
});
|
|
15850
|
+
const plan = data?.organizations?.[0]?.billing?.plan;
|
|
15851
|
+
if (!plan || !ENTITLED_PLANS.has(plan)) {
|
|
15852
|
+
throw new EntitlementError(plan);
|
|
15853
|
+
}
|
|
15854
|
+
}
|
|
15855
|
+
|
|
15856
|
+
// ../mcp-server/dist/entitlement-wrapper.js
|
|
15857
|
+
function extractBaseUrl(args) {
|
|
15858
|
+
if (!args || typeof args !== "object") {
|
|
15859
|
+
return void 0;
|
|
15860
|
+
}
|
|
15861
|
+
const obj = args;
|
|
15862
|
+
if (typeof obj.base_url === "string") {
|
|
15863
|
+
try {
|
|
15864
|
+
return normalizeBaseUrl(obj.base_url);
|
|
15865
|
+
} catch {
|
|
15866
|
+
return void 0;
|
|
15867
|
+
}
|
|
15868
|
+
}
|
|
15869
|
+
if (typeof obj.app_url === "string") {
|
|
15870
|
+
try {
|
|
15871
|
+
return normalizeBaseUrl(obj.app_url);
|
|
15872
|
+
} catch {
|
|
15873
|
+
return void 0;
|
|
15874
|
+
}
|
|
15875
|
+
}
|
|
15876
|
+
return void 0;
|
|
15877
|
+
}
|
|
15878
|
+
function wrapHandlerWithEntitlement(handler) {
|
|
15879
|
+
return async (args) => {
|
|
15880
|
+
const baseUrl = extractBaseUrl(args);
|
|
15881
|
+
if (baseUrl) {
|
|
15882
|
+
let authResolved = false;
|
|
15883
|
+
try {
|
|
15884
|
+
const auth = await resolveAuthForOrigin(baseUrl);
|
|
15885
|
+
authResolved = true;
|
|
15886
|
+
await assertEnterprisePlan(baseUrl, auth.token);
|
|
15887
|
+
} catch (error48) {
|
|
15888
|
+
if (error48 instanceof EntitlementError) {
|
|
15889
|
+
throw error48;
|
|
15890
|
+
}
|
|
15891
|
+
if (authResolved) {
|
|
15892
|
+
throw error48;
|
|
15893
|
+
}
|
|
15894
|
+
}
|
|
15895
|
+
}
|
|
15896
|
+
return handler(args);
|
|
15897
|
+
};
|
|
15898
|
+
}
|
|
15899
|
+
|
|
15900
|
+
// ../mcp-server/dist/tools/registry.js
|
|
15901
|
+
function buildToolRegistry(definitions, profile) {
|
|
15902
|
+
const filtered = profile === "internal" ? definitions : definitions.filter((d) => d.audience === "customer");
|
|
15903
|
+
const ready = profile === "internal" ? filtered : filtered.map((d) => ({
|
|
15904
|
+
...d,
|
|
15905
|
+
handler: wrapHandlerWithEntitlement(d.handler)
|
|
15906
|
+
}));
|
|
15907
|
+
return new ToolRegistry(ready);
|
|
15908
|
+
}
|
|
15909
|
+
var ToolRegistry = class {
|
|
15910
|
+
tools;
|
|
15911
|
+
constructor(definitions) {
|
|
15912
|
+
this.tools = new Map(definitions.map((d) => [d.name, d]));
|
|
15913
|
+
}
|
|
15914
|
+
listTools() {
|
|
15915
|
+
return [...this.tools.values()].map((d) => ({
|
|
15916
|
+
name: d.name,
|
|
15917
|
+
title: d.title,
|
|
15918
|
+
description: d.description,
|
|
15919
|
+
inputSchema: d.inputSchema,
|
|
15920
|
+
annotations: d.annotations
|
|
15921
|
+
}));
|
|
15922
|
+
}
|
|
15923
|
+
getHandler(name) {
|
|
15924
|
+
return this.tools.get(name)?.handler;
|
|
15925
|
+
}
|
|
15926
|
+
};
|
|
15927
|
+
|
|
15928
|
+
// ../mcp-server/dist/tools/index.js
|
|
15929
|
+
init_cjs_shims();
|
|
15930
|
+
|
|
15931
|
+
// ../mcp-server/dist/tools/assign-builder-seat.js
|
|
15932
|
+
init_cjs_shims();
|
|
15933
|
+
|
|
15934
|
+
// ../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.js
|
|
15935
|
+
init_cjs_shims();
|
|
15936
|
+
|
|
15937
|
+
// ../mcp-server/dist/tools/schemas.js
|
|
15938
|
+
init_cjs_shims();
|
|
15939
|
+
var APP_URL_PROPERTY = {
|
|
15940
|
+
format: "uri",
|
|
15941
|
+
type: "string"
|
|
15942
|
+
};
|
|
15943
|
+
var APPLICATION_ID_PROPERTY = {
|
|
15944
|
+
format: "uuid",
|
|
15675
15945
|
pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
15676
15946
|
type: "string"
|
|
15677
15947
|
};
|
|
@@ -15813,7 +16083,7 @@ var OCSF_CLASS_UID_PROPERTY = {
|
|
|
15813
16083
|
type: "integer"
|
|
15814
16084
|
};
|
|
15815
16085
|
var OCSF_STATUS_ID_PROPERTY = {
|
|
15816
|
-
description: "OCSF status filter (0=UNKNOWN, 1=SUCCESS, 2=FAILURE, 99=IN_PROGRESS).",
|
|
16086
|
+
description: "OCSF status filter (0=UNKNOWN, 1=SUCCESS, 2=FAILURE, 99=IN_PROGRESS). For API execution events (class_uid=6003), each execution emits a start event (status_id=99) and a completion event (status_id=1 or 2). To count unique executions, exclude status_id=99.",
|
|
15817
16087
|
type: "integer"
|
|
15818
16088
|
};
|
|
15819
16089
|
var OCSF_SEVERITY_ID_PROPERTY = {
|
|
@@ -15875,10 +16145,6 @@ var ASSIGNMENT_ID_PROPERTY = {
|
|
|
15875
16145
|
description: "Role ID or permission ID depending on assignment_type.",
|
|
15876
16146
|
type: "string"
|
|
15877
16147
|
};
|
|
15878
|
-
var ORGANIZATION_ID_GENERIC_PROPERTY = {
|
|
15879
|
-
format: "uuid",
|
|
15880
|
-
type: "string"
|
|
15881
|
-
};
|
|
15882
16148
|
var OBJECT_PAYLOAD_PROPERTY = {
|
|
15883
16149
|
additionalProperties: true,
|
|
15884
16150
|
description: "Integration payload object sent directly to the integrations API. Include fields required by the target integration type.",
|
|
@@ -16078,8 +16344,7 @@ var grantResourceAccessToolInputSchema = {
|
|
|
16078
16344
|
resource_type: RBAC_RESOURCE_TYPE_PROPERTY,
|
|
16079
16345
|
resource_id: { type: "string" },
|
|
16080
16346
|
principal_type: PRINCIPAL_TYPE_PROPERTY,
|
|
16081
|
-
principal_id: { type: "string" }
|
|
16082
|
-
organization_id: ORGANIZATION_ID_GENERIC_PROPERTY
|
|
16347
|
+
principal_id: { type: "string" }
|
|
16083
16348
|
},
|
|
16084
16349
|
required: [
|
|
16085
16350
|
"assignment_type",
|
|
@@ -16087,8 +16352,7 @@ var grantResourceAccessToolInputSchema = {
|
|
|
16087
16352
|
"resource_type",
|
|
16088
16353
|
"resource_id",
|
|
16089
16354
|
"principal_type",
|
|
16090
|
-
"principal_id"
|
|
16091
|
-
"organization_id"
|
|
16355
|
+
"principal_id"
|
|
16092
16356
|
],
|
|
16093
16357
|
type: "object"
|
|
16094
16358
|
},
|
|
@@ -16134,28 +16398,87 @@ var listRbacAssignmentsToolInputSchema = {
|
|
|
16134
16398
|
required: ["base_url", "resource_type", "resource_id"],
|
|
16135
16399
|
type: "object"
|
|
16136
16400
|
};
|
|
16401
|
+
var ORGANIZATION_ID_OPTIONAL_PROPERTY = {
|
|
16402
|
+
...ORGANIZATION_ID_PROPERTY,
|
|
16403
|
+
description: "Optional. When omitted, uses the authenticated user's current organization."
|
|
16404
|
+
};
|
|
16137
16405
|
var listRolesToolInputSchema = {
|
|
16138
16406
|
additionalProperties: false,
|
|
16139
16407
|
properties: {
|
|
16140
16408
|
base_url: BASE_URL_PROPERTY,
|
|
16141
|
-
organization_id:
|
|
16409
|
+
organization_id: ORGANIZATION_ID_OPTIONAL_PROPERTY,
|
|
16142
16410
|
type: {
|
|
16143
16411
|
description: "Filter roles by type (apps, integrations, org, jobs, workflows).",
|
|
16144
16412
|
enum: ["apps", "integrations", "org", "jobs", "workflows"],
|
|
16145
16413
|
type: "string"
|
|
16146
16414
|
}
|
|
16147
16415
|
},
|
|
16416
|
+
required: ["base_url"],
|
|
16417
|
+
type: "object"
|
|
16418
|
+
};
|
|
16419
|
+
var listUsersToolInputSchema = {
|
|
16420
|
+
additionalProperties: false,
|
|
16421
|
+
properties: {
|
|
16422
|
+
base_url: BASE_URL_PROPERTY,
|
|
16423
|
+
organization_id: ORGANIZATION_ID_PROPERTY,
|
|
16424
|
+
page: {
|
|
16425
|
+
description: "Page number (1-indexed). Defaults to 1.",
|
|
16426
|
+
minimum: 1,
|
|
16427
|
+
type: "integer"
|
|
16428
|
+
},
|
|
16429
|
+
page_size: {
|
|
16430
|
+
description: "Number of users per page. Defaults to 100. Maximum 500.",
|
|
16431
|
+
minimum: 1,
|
|
16432
|
+
maximum: 500,
|
|
16433
|
+
type: "integer"
|
|
16434
|
+
}
|
|
16435
|
+
},
|
|
16148
16436
|
required: ["base_url", "organization_id"],
|
|
16149
16437
|
type: "object"
|
|
16150
16438
|
};
|
|
16151
|
-
var
|
|
16439
|
+
var listUsersByRoleToolInputSchema = {
|
|
16152
16440
|
additionalProperties: false,
|
|
16153
16441
|
properties: {
|
|
16154
16442
|
base_url: BASE_URL_PROPERTY,
|
|
16155
16443
|
organization_id: ORGANIZATION_ID_PROPERTY,
|
|
16444
|
+
role_name: {
|
|
16445
|
+
description: "Org role name to filter by (e.g. Admin, Developer, End-User). Case-insensitive.",
|
|
16446
|
+
minLength: 1,
|
|
16447
|
+
type: "string"
|
|
16448
|
+
},
|
|
16449
|
+
page: {
|
|
16450
|
+
description: "Page number (1-indexed). Defaults to 1.",
|
|
16451
|
+
minimum: 1,
|
|
16452
|
+
type: "integer"
|
|
16453
|
+
},
|
|
16454
|
+
page_size: {
|
|
16455
|
+
description: "Number of users per page. Defaults to 100. Maximum 500.",
|
|
16456
|
+
minimum: 1,
|
|
16457
|
+
maximum: 500,
|
|
16458
|
+
type: "integer"
|
|
16459
|
+
}
|
|
16460
|
+
},
|
|
16461
|
+
required: ["base_url", "organization_id", "role_name"],
|
|
16462
|
+
type: "object"
|
|
16463
|
+
};
|
|
16464
|
+
var getUserPermissionsToolInputSchema = {
|
|
16465
|
+
additionalProperties: false,
|
|
16466
|
+
properties: {
|
|
16467
|
+
base_url: BASE_URL_PROPERTY,
|
|
16468
|
+
organization_id: ORGANIZATION_ID_PROPERTY,
|
|
16469
|
+
user_id: USER_ID_PROPERTY
|
|
16470
|
+
},
|
|
16471
|
+
required: ["base_url", "organization_id", "user_id"],
|
|
16472
|
+
type: "object"
|
|
16473
|
+
};
|
|
16474
|
+
var listOrganizationAgentsToolInputSchema = {
|
|
16475
|
+
additionalProperties: false,
|
|
16476
|
+
properties: {
|
|
16477
|
+
base_url: BASE_URL_PROPERTY,
|
|
16478
|
+
organization_id: ORGANIZATION_ID_OPTIONAL_PROPERTY,
|
|
16156
16479
|
start_time: ISO_DATE_PROPERTY
|
|
16157
16480
|
},
|
|
16158
|
-
required: ["base_url"
|
|
16481
|
+
required: ["base_url"],
|
|
16159
16482
|
type: "object"
|
|
16160
16483
|
};
|
|
16161
16484
|
var START_DATE_PROPERTY = {
|
|
@@ -16231,9 +16554,24 @@ var findAppsByPackageToolInputSchema = {
|
|
|
16231
16554
|
type: "string"
|
|
16232
16555
|
},
|
|
16233
16556
|
package_version: {
|
|
16557
|
+
description: "Filter by declared version string/range from package.json.",
|
|
16558
|
+
minLength: 1,
|
|
16559
|
+
type: "string"
|
|
16560
|
+
},
|
|
16561
|
+
package_version_resolved: {
|
|
16562
|
+
description: "Filter by resolved version from lockfile (e.g. '1.2.3').",
|
|
16234
16563
|
minLength: 1,
|
|
16235
16564
|
type: "string"
|
|
16236
16565
|
},
|
|
16566
|
+
dependency_source: {
|
|
16567
|
+
description: "Filter by dependency source: 'root' (root package.json), 'direct' (any non-transitive), 'transitive' (lockfile-only).",
|
|
16568
|
+
enum: ["root", "direct", "transitive"],
|
|
16569
|
+
type: "string"
|
|
16570
|
+
},
|
|
16571
|
+
include_transitive: {
|
|
16572
|
+
description: "When false, excludes transitive (lockfile-only) dependencies. Defaults to true.",
|
|
16573
|
+
type: "boolean"
|
|
16574
|
+
},
|
|
16237
16575
|
deployed: {
|
|
16238
16576
|
description: "Optional deploy filter. true = only deployed commit matches, false = only non-deployed commit matches, omitted = both.",
|
|
16239
16577
|
type: "boolean"
|
|
@@ -16314,57 +16652,21 @@ var getKnowledgeToolInputSchema = {
|
|
|
16314
16652
|
required: ["base_url", "knowledge_id"],
|
|
16315
16653
|
type: "object"
|
|
16316
16654
|
};
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
|
|
16330
|
-
|
|
16331
|
-
|
|
16332
|
-
}
|
|
16333
|
-
return void 0;
|
|
16334
|
-
}
|
|
16335
|
-
async function callServerApi(options) {
|
|
16336
|
-
const url2 = new URL(options.path, options.baseUrl);
|
|
16337
|
-
for (const [key, value] of Object.entries(options.query ?? {})) {
|
|
16338
|
-
if (value !== void 0) {
|
|
16339
|
-
url2.searchParams.set(key, String(value));
|
|
16340
|
-
}
|
|
16341
|
-
}
|
|
16342
|
-
const response = await fetch(url2, {
|
|
16343
|
-
method: options.method,
|
|
16344
|
-
headers: {
|
|
16345
|
-
Authorization: `Bearer ${options.token}`,
|
|
16346
|
-
...options.body !== void 0 ? { "Content-Type": "application/json" } : {}
|
|
16347
|
-
},
|
|
16348
|
-
body: options.body !== void 0 ? JSON.stringify(options.body) : void 0
|
|
16349
|
-
});
|
|
16350
|
-
const raw = await response.text();
|
|
16351
|
-
let parsed;
|
|
16352
|
-
if (raw.length > 0) {
|
|
16353
|
-
try {
|
|
16354
|
-
parsed = JSON.parse(raw);
|
|
16355
|
-
} catch {
|
|
16356
|
-
parsed = void 0;
|
|
16357
|
-
}
|
|
16358
|
-
}
|
|
16359
|
-
if (!response.ok) {
|
|
16360
|
-
const message = extractMessage(parsed) ?? (raw.length > 0 ? raw : response.statusText || "Request failed");
|
|
16361
|
-
throw new Error(message);
|
|
16362
|
-
}
|
|
16363
|
-
if (parsed && typeof parsed === "object" && "data" in parsed) {
|
|
16364
|
-
return parsed.data;
|
|
16365
|
-
}
|
|
16366
|
-
return parsed;
|
|
16367
|
-
}
|
|
16655
|
+
var REASON_PROPERTY = {
|
|
16656
|
+
description: "Optional reason for the action. Echoed in the tool response for the caller's own logging; not persisted server-side.",
|
|
16657
|
+
minLength: 1,
|
|
16658
|
+
type: "string"
|
|
16659
|
+
};
|
|
16660
|
+
var deactivateUserToolInputSchema = {
|
|
16661
|
+
additionalProperties: false,
|
|
16662
|
+
properties: {
|
|
16663
|
+
base_url: BASE_URL_PROPERTY,
|
|
16664
|
+
user_id: USER_ID_PROPERTY,
|
|
16665
|
+
reason: REASON_PROPERTY
|
|
16666
|
+
},
|
|
16667
|
+
required: ["base_url", "user_id"],
|
|
16668
|
+
type: "object"
|
|
16669
|
+
};
|
|
16368
16670
|
|
|
16369
16671
|
// ../mcp-server/dist/tools/validation.js
|
|
16370
16672
|
init_cjs_shims();
|
|
@@ -16700,6 +17002,79 @@ var createIntegration = {
|
|
|
16700
17002
|
}
|
|
16701
17003
|
};
|
|
16702
17004
|
|
|
17005
|
+
// ../mcp-server/dist/tools/deactivate-user.js
|
|
17006
|
+
init_cjs_shims();
|
|
17007
|
+
var ALL_USERS_GROUP_TYPE = 0;
|
|
17008
|
+
var deactivateUserInputSchema = external_exports.object({
|
|
17009
|
+
base_url: external_exports.string().url(),
|
|
17010
|
+
user_id: external_exports.string().uuid(),
|
|
17011
|
+
reason: external_exports.string().trim().min(1).optional().describe("Echoed in the response for the caller's own logging; not persisted server-side.")
|
|
17012
|
+
}).strict();
|
|
17013
|
+
var deactivateUser = {
|
|
17014
|
+
name: "deactivate_user",
|
|
17015
|
+
title: "Deactivate User",
|
|
17016
|
+
description: "Deactivate a user account by user_id for incident response. This removes the user from all groups, revokes their RBAC assignments, and prevents them from logging in. Requires org admin privileges. Optionally include a reason, which is echoed back in the response for the caller's own logging.",
|
|
17017
|
+
inputSchema: deactivateUserToolInputSchema,
|
|
17018
|
+
annotations: {
|
|
17019
|
+
readOnlyHint: false,
|
|
17020
|
+
destructiveHint: true,
|
|
17021
|
+
idempotentHint: false,
|
|
17022
|
+
openWorldHint: true
|
|
17023
|
+
},
|
|
17024
|
+
audience: "internal",
|
|
17025
|
+
async handler(args) {
|
|
17026
|
+
const input = parseToolInput(deactivateUserInputSchema, args);
|
|
17027
|
+
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
17028
|
+
const auth = await resolveAuthForOrigin(baseUrl);
|
|
17029
|
+
const sdk = createSdk(auth.token, baseUrl);
|
|
17030
|
+
const currentUser = await sdk.fetchCurrentUser();
|
|
17031
|
+
const organizationId = currentUser.user.currentOrganizationId;
|
|
17032
|
+
const targetUser = await callServerApi({
|
|
17033
|
+
baseUrl,
|
|
17034
|
+
token: auth.token,
|
|
17035
|
+
method: "GET",
|
|
17036
|
+
path: `/api/v1/organizations/${organizationId}/users/${input.user_id}`
|
|
17037
|
+
});
|
|
17038
|
+
if (!targetUser?.email) {
|
|
17039
|
+
throw new Error(`Could not resolve email for user ${input.user_id}. The user may not exist in this organization.`);
|
|
17040
|
+
}
|
|
17041
|
+
const groupsResponse = await callServerApi({
|
|
17042
|
+
baseUrl,
|
|
17043
|
+
token: auth.token,
|
|
17044
|
+
method: "GET",
|
|
17045
|
+
path: `/api/v1/organizations/${organizationId}/groups`
|
|
17046
|
+
});
|
|
17047
|
+
if (!Array.isArray(groupsResponse?.groups)) {
|
|
17048
|
+
throw new Error("Unexpected response shape from groups endpoint.");
|
|
17049
|
+
}
|
|
17050
|
+
const allUsersGroup = groupsResponse.groups.find((g) => g.type === ALL_USERS_GROUP_TYPE);
|
|
17051
|
+
if (!allUsersGroup) {
|
|
17052
|
+
throw new Error("Could not find the All Users group in the organization.");
|
|
17053
|
+
}
|
|
17054
|
+
const result = await callServerApi({
|
|
17055
|
+
baseUrl,
|
|
17056
|
+
token: auth.token,
|
|
17057
|
+
method: "POST",
|
|
17058
|
+
path: `/api/v1/organizations/${organizationId}/groups/${allUsersGroup.id}`,
|
|
17059
|
+
body: {
|
|
17060
|
+
operations: [{ email: targetUser.email, action: "REMOVE_MEMBER" }]
|
|
17061
|
+
}
|
|
17062
|
+
});
|
|
17063
|
+
if (result && typeof result === "object" && "errors" in result) {
|
|
17064
|
+
throw new Error(`User deactivation may have failed. Server response: ${JSON.stringify(result)}`);
|
|
17065
|
+
}
|
|
17066
|
+
return {
|
|
17067
|
+
result,
|
|
17068
|
+
user_id: input.user_id,
|
|
17069
|
+
user_email: targetUser.email,
|
|
17070
|
+
reason: input.reason,
|
|
17071
|
+
auth_source: auth.source,
|
|
17072
|
+
base_url: baseUrl,
|
|
17073
|
+
environment: detectEnvironment(baseUrl)
|
|
17074
|
+
};
|
|
17075
|
+
}
|
|
17076
|
+
};
|
|
17077
|
+
|
|
16703
17078
|
// ../mcp-server/dist/tools/delete-folder.js
|
|
16704
17079
|
init_cjs_shims();
|
|
16705
17080
|
var deleteFolderInputSchema = external_exports.object({
|
|
@@ -16894,6 +17269,9 @@ var findAppsByPackageInputSchema = external_exports.object({
|
|
|
16894
17269
|
base_url: external_exports.string().url(),
|
|
16895
17270
|
package_name: external_exports.string().trim().min(1),
|
|
16896
17271
|
package_version: external_exports.string().trim().min(1).optional(),
|
|
17272
|
+
package_version_resolved: external_exports.string().trim().min(1).optional(),
|
|
17273
|
+
dependency_source: external_exports.enum(["root", "direct", "transitive"]).describe("Filter by dependency source: 'root' (root package.json), 'direct' (any non-transitive), 'transitive' (lockfile-only)").optional(),
|
|
17274
|
+
include_transitive: external_exports.boolean().describe("When false, excludes transitive (lockfile-only) dependencies. Defaults to true.").optional(),
|
|
16897
17275
|
deployed: external_exports.boolean().optional(),
|
|
16898
17276
|
limit: external_exports.number().int().min(1).max(200).optional(),
|
|
16899
17277
|
offset: external_exports.number().int().min(0).optional()
|
|
@@ -16901,7 +17279,7 @@ var findAppsByPackageInputSchema = external_exports.object({
|
|
|
16901
17279
|
var findAppsByPackage = {
|
|
16902
17280
|
name: "find_apps_by_package",
|
|
16903
17281
|
title: "Find Apps by Package",
|
|
16904
|
-
description: "Find apps whose package usage index contains a
|
|
17282
|
+
description: "Find apps whose package usage index contains a package dependency. Supports filtering by deployed/non-deployed commits, declared or resolved version, and dependency source (root, direct, transitive).",
|
|
16905
17283
|
inputSchema: findAppsByPackageToolInputSchema,
|
|
16906
17284
|
annotations: {
|
|
16907
17285
|
readOnlyHint: true,
|
|
@@ -16917,6 +17295,7 @@ var findAppsByPackage = {
|
|
|
16917
17295
|
const limit = input.limit ?? 50;
|
|
16918
17296
|
const offset = input.offset ?? 0;
|
|
16919
17297
|
const deployed = input.deployed === void 0 ? void 0 : input.deployed ? "true" : "false";
|
|
17298
|
+
const dependencySource = input.dependency_source ?? (input.include_transitive === false ? "direct" : void 0);
|
|
16920
17299
|
const data = await callServerApi({
|
|
16921
17300
|
baseUrl,
|
|
16922
17301
|
token: auth.token,
|
|
@@ -16925,6 +17304,8 @@ var findAppsByPackage = {
|
|
|
16925
17304
|
query: {
|
|
16926
17305
|
package_name: input.package_name,
|
|
16927
17306
|
package_version_declared: input.package_version,
|
|
17307
|
+
package_version_resolved: input.package_version_resolved,
|
|
17308
|
+
dependency_source: dependencySource,
|
|
16928
17309
|
deployed,
|
|
16929
17310
|
limit,
|
|
16930
17311
|
offset
|
|
@@ -16938,11 +17319,13 @@ var findAppsByPackage = {
|
|
|
16938
17319
|
deployed_filter: data.deployed_filter,
|
|
16939
17320
|
package_name: data.package_name,
|
|
16940
17321
|
package_version_declared: data.package_version_declared,
|
|
17322
|
+
package_version_resolved: data.package_version_resolved,
|
|
17323
|
+
dependency_source: data.dependency_source,
|
|
16941
17324
|
limit: data.limit,
|
|
16942
17325
|
offset: data.offset,
|
|
16943
17326
|
total_matches: data.total,
|
|
16944
17327
|
matches: data.items,
|
|
16945
|
-
note: "
|
|
17328
|
+
note: "Results include dependency_source ('root' or 'transitive') and package_version_resolved (from lockfile). Use dependency_source filter to narrow results. Use include_transitive=false to exclude lockfile-only transitive deps.",
|
|
16946
17329
|
auth_source: auth.source,
|
|
16947
17330
|
base_url: baseUrl,
|
|
16948
17331
|
environment: detectEnvironment(baseUrl)
|
|
@@ -17408,7 +17791,7 @@ function resolveBaseUrlTarget(input) {
|
|
|
17408
17791
|
var getAuditEvents = {
|
|
17409
17792
|
name: "get_audit_events",
|
|
17410
17793
|
title: "Get Audit Events",
|
|
17411
|
-
description: "Fetch v2 audit events (OCSF) for the current organization in a time range, with cursor pagination and OCSF filters. Use list_audit_event_types to discover all available class_uid, resource_type, and operation values for filtering.",
|
|
17794
|
+
description: "Fetch v2 audit events (OCSF) for the current organization in a time range, with cursor pagination and OCSF filters. Use list_audit_event_types to discover all available class_uid, resource_type, and operation values for filtering.\n\nIMPORTANT \u2014 API execution double-counting: API execution events (class_uid=6003) are logged as start/completion pairs. Each execution produces two events with the same timestamp: a start event (status_id=99, no duration) and a completion event (status_id=1 for success or status_id=2 for failure, includes duration in ms). To count unique executions, filter to status_id != 99 (i.e. exclude IN_PROGRESS) or divide the raw class_uid=6003 count by 2.",
|
|
17412
17795
|
inputSchema: getAuditEventsToolInputSchema,
|
|
17413
17796
|
annotations: {
|
|
17414
17797
|
readOnlyHint: true,
|
|
@@ -17850,6 +18233,66 @@ var getOrganizationSummary = {
|
|
|
17850
18233
|
}
|
|
17851
18234
|
};
|
|
17852
18235
|
|
|
18236
|
+
// ../mcp-server/dist/tools/get-user-permissions.js
|
|
18237
|
+
init_cjs_shims();
|
|
18238
|
+
var getUserPermissionsInputSchema = external_exports.object({
|
|
18239
|
+
base_url: external_exports.string().url(),
|
|
18240
|
+
organization_id: external_exports.string().uuid(),
|
|
18241
|
+
user_id: external_exports.string().uuid()
|
|
18242
|
+
}).strict();
|
|
18243
|
+
var getUserPermissions = {
|
|
18244
|
+
name: "get_user_permissions",
|
|
18245
|
+
title: "Get User Permissions",
|
|
18246
|
+
description: "Get all resources a user can access and their role on each, including assignments inherited through groups. Returns RBAC assignments across applications, integrations, workflows, and jobs. Useful for deprovisioning audits, compliance reviews, and access certification.",
|
|
18247
|
+
inputSchema: getUserPermissionsToolInputSchema,
|
|
18248
|
+
annotations: {
|
|
18249
|
+
readOnlyHint: true,
|
|
18250
|
+
destructiveHint: false,
|
|
18251
|
+
idempotentHint: true,
|
|
18252
|
+
openWorldHint: true
|
|
18253
|
+
},
|
|
18254
|
+
audience: "customer",
|
|
18255
|
+
async handler(args) {
|
|
18256
|
+
const input = parseToolInput(getUserPermissionsInputSchema, args);
|
|
18257
|
+
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
18258
|
+
const auth = await resolveAuthForOrigin(baseUrl);
|
|
18259
|
+
const assignments = await callServerApi({
|
|
18260
|
+
baseUrl,
|
|
18261
|
+
token: auth.token,
|
|
18262
|
+
method: "GET",
|
|
18263
|
+
path: `/api/v1/organizations/${input.organization_id}/users/${input.user_id}/assignments`
|
|
18264
|
+
});
|
|
18265
|
+
if (!Array.isArray(assignments)) {
|
|
18266
|
+
throw new Error(`Unexpected response from user assignments API: expected array, got ${typeof assignments}`);
|
|
18267
|
+
}
|
|
18268
|
+
const assignmentsList = assignments;
|
|
18269
|
+
return {
|
|
18270
|
+
user_id: input.user_id,
|
|
18271
|
+
organization_id: input.organization_id,
|
|
18272
|
+
assignments: assignmentsList.map((a) => ({
|
|
18273
|
+
id: a.id,
|
|
18274
|
+
assignment_type: a.assignmentType,
|
|
18275
|
+
resource_type: a.resourceType,
|
|
18276
|
+
resource_id: a.resourceId,
|
|
18277
|
+
principal_type: a.principalType,
|
|
18278
|
+
principal_id: a.principalId,
|
|
18279
|
+
role_name: a.role?.name ?? null,
|
|
18280
|
+
role_id: a.role?.id ?? null,
|
|
18281
|
+
permission: a.permission ? {
|
|
18282
|
+
action: a.permission.actionType,
|
|
18283
|
+
resource: a.permission.resourceType
|
|
18284
|
+
} : null,
|
|
18285
|
+
resource_name: a.application?.name ?? a.integration?.name ?? a.api?.name ?? null,
|
|
18286
|
+
inherited_via_group: a.group?.name ?? null
|
|
18287
|
+
})),
|
|
18288
|
+
auth_source: auth.source,
|
|
18289
|
+
base_url: baseUrl,
|
|
18290
|
+
environment: detectEnvironment(baseUrl),
|
|
18291
|
+
total_count: assignmentsList.length
|
|
18292
|
+
};
|
|
18293
|
+
}
|
|
18294
|
+
};
|
|
18295
|
+
|
|
17853
18296
|
// ../mcp-server/dist/tools/get-workflow-access.js
|
|
17854
18297
|
init_cjs_shims();
|
|
17855
18298
|
var getWorkflowAccessInputSchema = external_exports.object({
|
|
@@ -17886,6 +18329,20 @@ var getWorkflowAccess = {
|
|
|
17886
18329
|
|
|
17887
18330
|
// ../mcp-server/dist/tools/grant-resource-access.js
|
|
17888
18331
|
init_cjs_shims();
|
|
18332
|
+
|
|
18333
|
+
// ../mcp-server/dist/auth/resolve-current-organization.js
|
|
18334
|
+
init_cjs_shims();
|
|
18335
|
+
async function resolveCurrentOrganizationId(normalizedBaseUrl, token) {
|
|
18336
|
+
const sdk = createSdk(token, normalizedBaseUrl);
|
|
18337
|
+
const me = await sdk.fetchCurrentUser();
|
|
18338
|
+
const id = me.user?.currentOrganizationId;
|
|
18339
|
+
if (!id) {
|
|
18340
|
+
throw new Error("Could not resolve current organization: missing currentOrganizationId on user");
|
|
18341
|
+
}
|
|
18342
|
+
return id;
|
|
18343
|
+
}
|
|
18344
|
+
|
|
18345
|
+
// ../mcp-server/dist/tools/grant-resource-access.js
|
|
17889
18346
|
var grantResourceAccessInputSchema = external_exports.object({
|
|
17890
18347
|
base_url: external_exports.string().url(),
|
|
17891
18348
|
assignments: external_exports.array(external_exports.object({
|
|
@@ -17894,14 +18351,13 @@ var grantResourceAccessInputSchema = external_exports.object({
|
|
|
17894
18351
|
resource_type: external_exports.string().min(1),
|
|
17895
18352
|
resource_id: external_exports.string().min(1),
|
|
17896
18353
|
principal_type: external_exports.enum(["user", "group"]),
|
|
17897
|
-
principal_id: external_exports.string().min(1)
|
|
17898
|
-
organization_id: external_exports.string().uuid()
|
|
18354
|
+
principal_id: external_exports.string().min(1)
|
|
17899
18355
|
}).strict()).min(1)
|
|
17900
18356
|
}).strict();
|
|
17901
18357
|
var grantResourceAccess = {
|
|
17902
18358
|
name: "grant_resource_access",
|
|
17903
18359
|
title: "Grant Resource Access",
|
|
17904
|
-
description: "Create RBAC assignments for a resource (roles or direct permissions).",
|
|
18360
|
+
description: "Create RBAC assignments for a resource (roles or direct permissions). Organization scope is always the authenticated user's current organization (matches server enforcement).",
|
|
17905
18361
|
inputSchema: grantResourceAccessToolInputSchema,
|
|
17906
18362
|
annotations: {
|
|
17907
18363
|
readOnlyHint: false,
|
|
@@ -17914,6 +18370,7 @@ var grantResourceAccess = {
|
|
|
17914
18370
|
const input = parseToolInput(grantResourceAccessInputSchema, args);
|
|
17915
18371
|
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
17916
18372
|
const auth = await resolveAuthForOrigin(baseUrl);
|
|
18373
|
+
const organizationId = await resolveCurrentOrganizationId(baseUrl, auth.token);
|
|
17917
18374
|
const sdk = createSdk(auth.token, baseUrl);
|
|
17918
18375
|
const assignments = await sdk.createRbacAssignments({
|
|
17919
18376
|
assignments: input.assignments.map((a) => ({
|
|
@@ -17923,11 +18380,12 @@ var grantResourceAccess = {
|
|
|
17923
18380
|
resourceId: a.resource_id,
|
|
17924
18381
|
principalType: a.principal_type,
|
|
17925
18382
|
principalId: a.principal_id,
|
|
17926
|
-
organizationId
|
|
18383
|
+
organizationId
|
|
17927
18384
|
}))
|
|
17928
18385
|
});
|
|
17929
18386
|
return {
|
|
17930
18387
|
assignments,
|
|
18388
|
+
organization_id: organizationId,
|
|
17931
18389
|
auth_source: auth.source,
|
|
17932
18390
|
base_url: baseUrl,
|
|
17933
18391
|
environment: detectEnvironment(baseUrl),
|
|
@@ -18154,7 +18612,7 @@ var listIntegrations = {
|
|
|
18154
18612
|
const target = resolveBaseUrlTarget(input);
|
|
18155
18613
|
const auth = await resolveAuthForOrigin(target.baseUrl);
|
|
18156
18614
|
const sdk = createSdk(auth.token, target.baseUrl);
|
|
18157
|
-
let integrations = await sdk.fetchIntegrations(input.kind ? { kind: input.kind } : void 0);
|
|
18615
|
+
let integrations = (await sdk.fetchIntegrations(input.kind ? { kind: input.kind } : void 0)).filter((i) => i.isUserConfigured === true);
|
|
18158
18616
|
if (input.creator_email) {
|
|
18159
18617
|
const createdBy = input.creator_email.toLowerCase();
|
|
18160
18618
|
integrations = integrations.filter((i) => i.ownerEmail?.toLowerCase() === createdBy);
|
|
@@ -18238,14 +18696,14 @@ var listKnowledge = {
|
|
|
18238
18696
|
// ../mcp-server/dist/tools/list-organization-agents.js
|
|
18239
18697
|
init_cjs_shims();
|
|
18240
18698
|
var listOrganizationAgentsInputSchema = external_exports.object({
|
|
18241
|
-
organization_id: external_exports.string().uuid(),
|
|
18242
18699
|
base_url: external_exports.string().url(),
|
|
18700
|
+
organization_id: external_exports.uuid().optional(),
|
|
18243
18701
|
start_time: external_exports.string().datetime({ offset: true }).optional()
|
|
18244
18702
|
}).strict();
|
|
18245
18703
|
var listOrganizationAgents = {
|
|
18246
18704
|
name: "list_organization_agents",
|
|
18247
18705
|
title: "List Organization Agents",
|
|
18248
|
-
description: "List non-deactivated agents for
|
|
18706
|
+
description: "List non-deactivated agents for the authenticated user's current organization. Organization scope matches auth (same as other MCP tools); organization_id is optional and only needed if you must target a specific org UUID for URL compatibility.",
|
|
18249
18707
|
inputSchema: listOrganizationAgentsToolInputSchema,
|
|
18250
18708
|
annotations: {
|
|
18251
18709
|
readOnlyHint: true,
|
|
@@ -18258,15 +18716,16 @@ var listOrganizationAgents = {
|
|
|
18258
18716
|
const input = parseToolInput(listOrganizationAgentsInputSchema, args);
|
|
18259
18717
|
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
18260
18718
|
const auth = await resolveAuthForOrigin(baseUrl);
|
|
18719
|
+
const organizationId = input.organization_id ?? await resolveCurrentOrganizationId(baseUrl, auth.token);
|
|
18261
18720
|
const agents = await callServerApi({
|
|
18262
18721
|
baseUrl,
|
|
18263
18722
|
token: auth.token,
|
|
18264
18723
|
method: "GET",
|
|
18265
|
-
path: `/api/v1/organizations/${
|
|
18724
|
+
path: `/api/v1/organizations/${organizationId}/agents`,
|
|
18266
18725
|
query: { startTime: input.start_time }
|
|
18267
18726
|
});
|
|
18268
18727
|
return {
|
|
18269
|
-
organization_id:
|
|
18728
|
+
organization_id: organizationId,
|
|
18270
18729
|
agents,
|
|
18271
18730
|
auth_source: auth.source,
|
|
18272
18731
|
base_url: baseUrl,
|
|
@@ -18328,13 +18787,13 @@ var listRbacAssignments = {
|
|
|
18328
18787
|
init_cjs_shims();
|
|
18329
18788
|
var listRolesInputSchema = external_exports.object({
|
|
18330
18789
|
base_url: external_exports.string().url(),
|
|
18331
|
-
organization_id: external_exports.
|
|
18790
|
+
organization_id: external_exports.uuid().optional(),
|
|
18332
18791
|
type: external_exports.enum(["apps", "integrations", "org", "jobs", "workflows"]).optional()
|
|
18333
18792
|
}).strict();
|
|
18334
18793
|
var listRoles = {
|
|
18335
18794
|
name: "list_roles",
|
|
18336
18795
|
title: "List Roles",
|
|
18337
|
-
description: "List available RBAC roles for an organization, including their UUIDs. Use these role UUIDs as assignment_id when calling grant_resource_access. Optionally filter by role type (apps, integrations, org, jobs, workflows).",
|
|
18796
|
+
description: "List available RBAC roles for an organization, including their UUIDs. Use these role UUIDs as assignment_id when calling grant_resource_access. Optionally filter by role type (apps, integrations, org, jobs, workflows). Organization scope defaults to the authenticated user's current organization; pass organization_id only when targeting a different org you belong to.",
|
|
18338
18797
|
inputSchema: listRolesToolInputSchema,
|
|
18339
18798
|
annotations: {
|
|
18340
18799
|
readOnlyHint: true,
|
|
@@ -18347,11 +18806,12 @@ var listRoles = {
|
|
|
18347
18806
|
const input = parseToolInput(listRolesInputSchema, args);
|
|
18348
18807
|
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
18349
18808
|
const auth = await resolveAuthForOrigin(baseUrl);
|
|
18809
|
+
const organizationId = input.organization_id ?? await resolveCurrentOrganizationId(baseUrl, auth.token);
|
|
18350
18810
|
const roles = await callServerApi({
|
|
18351
18811
|
baseUrl,
|
|
18352
18812
|
token: auth.token,
|
|
18353
18813
|
method: "GET",
|
|
18354
|
-
path: `/api/v1/organizations/${
|
|
18814
|
+
path: `/api/v1/organizations/${organizationId}/roles`,
|
|
18355
18815
|
query: input.type ? { type: input.type } : void 0
|
|
18356
18816
|
});
|
|
18357
18817
|
if (!Array.isArray(roles)) {
|
|
@@ -18374,6 +18834,132 @@ var listRoles = {
|
|
|
18374
18834
|
}
|
|
18375
18835
|
};
|
|
18376
18836
|
|
|
18837
|
+
// ../mcp-server/dist/tools/list-users-by-role.js
|
|
18838
|
+
init_cjs_shims();
|
|
18839
|
+
var DEFAULT_PAGE_SIZE = 100;
|
|
18840
|
+
var listUsersByRoleInputSchema = external_exports.object({
|
|
18841
|
+
base_url: external_exports.string().url(),
|
|
18842
|
+
organization_id: external_exports.string().uuid(),
|
|
18843
|
+
role_name: external_exports.string().trim().min(1),
|
|
18844
|
+
page: external_exports.number().int().positive().optional(),
|
|
18845
|
+
page_size: external_exports.number().int().positive().max(500).optional()
|
|
18846
|
+
}).strict();
|
|
18847
|
+
var listUsersByRole = {
|
|
18848
|
+
name: "list_users_by_role",
|
|
18849
|
+
title: "List Users by Role",
|
|
18850
|
+
description: "List users in a Superblocks organization filtered by org role name (e.g. Admin, Developer, End-User). Returns only users whose org-level role assignment matches the given role_name (case-insensitive). Useful for access audits and compliance reviews.",
|
|
18851
|
+
inputSchema: listUsersByRoleToolInputSchema,
|
|
18852
|
+
annotations: {
|
|
18853
|
+
readOnlyHint: true,
|
|
18854
|
+
destructiveHint: false,
|
|
18855
|
+
idempotentHint: true,
|
|
18856
|
+
openWorldHint: true
|
|
18857
|
+
},
|
|
18858
|
+
audience: "customer",
|
|
18859
|
+
async handler(args) {
|
|
18860
|
+
const input = parseToolInput(listUsersByRoleInputSchema, args);
|
|
18861
|
+
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
18862
|
+
const auth = await resolveAuthForOrigin(baseUrl);
|
|
18863
|
+
const users = await callServerApi({
|
|
18864
|
+
baseUrl,
|
|
18865
|
+
token: auth.token,
|
|
18866
|
+
method: "GET",
|
|
18867
|
+
path: `/api/v1/organizations/${input.organization_id}/users`
|
|
18868
|
+
});
|
|
18869
|
+
if (!Array.isArray(users)) {
|
|
18870
|
+
throw new Error(`Unexpected response from users API: expected array, got ${typeof users}`);
|
|
18871
|
+
}
|
|
18872
|
+
const usersList = users;
|
|
18873
|
+
const roleNameLower = input.role_name.toLowerCase();
|
|
18874
|
+
const filtered = usersList.filter((u) => u.assignments?.some((a) => a.assignmentType === "role" && a.role?.name?.toLowerCase() === roleNameLower));
|
|
18875
|
+
const totalCount = filtered.length;
|
|
18876
|
+
const page = input.page ?? 1;
|
|
18877
|
+
const pageSize = input.page_size ?? DEFAULT_PAGE_SIZE;
|
|
18878
|
+
const totalPages = Math.ceil(totalCount / pageSize);
|
|
18879
|
+
const offset = (page - 1) * pageSize;
|
|
18880
|
+
const paged = filtered.slice(offset, offset + pageSize);
|
|
18881
|
+
return {
|
|
18882
|
+
users: paged.map((u) => ({
|
|
18883
|
+
id: u.id,
|
|
18884
|
+
name: u.name,
|
|
18885
|
+
email: u.email,
|
|
18886
|
+
status: u.status,
|
|
18887
|
+
type: u.type ?? null,
|
|
18888
|
+
org_role: u.assignments?.find((a) => a.assignmentType === "role" && a.role?.name?.toLowerCase() === roleNameLower)?.role?.name ?? null
|
|
18889
|
+
})),
|
|
18890
|
+
role_filter: input.role_name,
|
|
18891
|
+
auth_source: auth.source,
|
|
18892
|
+
base_url: baseUrl,
|
|
18893
|
+
environment: detectEnvironment(baseUrl),
|
|
18894
|
+
total_count: totalCount,
|
|
18895
|
+
page,
|
|
18896
|
+
page_size: pageSize,
|
|
18897
|
+
total_pages: totalPages
|
|
18898
|
+
};
|
|
18899
|
+
}
|
|
18900
|
+
};
|
|
18901
|
+
|
|
18902
|
+
// ../mcp-server/dist/tools/list-users.js
|
|
18903
|
+
init_cjs_shims();
|
|
18904
|
+
var DEFAULT_PAGE_SIZE2 = 100;
|
|
18905
|
+
var listUsersInputSchema = external_exports.object({
|
|
18906
|
+
base_url: external_exports.string().url(),
|
|
18907
|
+
organization_id: external_exports.string().uuid(),
|
|
18908
|
+
page: external_exports.number().int().positive().optional(),
|
|
18909
|
+
page_size: external_exports.number().int().positive().max(500).optional()
|
|
18910
|
+
}).strict();
|
|
18911
|
+
var listUsers = {
|
|
18912
|
+
name: "list_users",
|
|
18913
|
+
title: "List Users",
|
|
18914
|
+
description: "List all users in a Superblocks organization with their status, type, and org-level role assignments. Useful for access audits, user inventories, and governance workflows.",
|
|
18915
|
+
inputSchema: listUsersToolInputSchema,
|
|
18916
|
+
annotations: {
|
|
18917
|
+
readOnlyHint: true,
|
|
18918
|
+
destructiveHint: false,
|
|
18919
|
+
idempotentHint: true,
|
|
18920
|
+
openWorldHint: true
|
|
18921
|
+
},
|
|
18922
|
+
audience: "customer",
|
|
18923
|
+
async handler(args) {
|
|
18924
|
+
const input = parseToolInput(listUsersInputSchema, args);
|
|
18925
|
+
const baseUrl = normalizeBaseUrl(input.base_url);
|
|
18926
|
+
const auth = await resolveAuthForOrigin(baseUrl);
|
|
18927
|
+
const users = await callServerApi({
|
|
18928
|
+
baseUrl,
|
|
18929
|
+
token: auth.token,
|
|
18930
|
+
method: "GET",
|
|
18931
|
+
path: `/api/v1/organizations/${input.organization_id}/users`
|
|
18932
|
+
});
|
|
18933
|
+
if (!Array.isArray(users)) {
|
|
18934
|
+
throw new Error(`Unexpected response from users API: expected array, got ${typeof users}`);
|
|
18935
|
+
}
|
|
18936
|
+
const usersList = users;
|
|
18937
|
+
const totalCount = usersList.length;
|
|
18938
|
+
const page = input.page ?? 1;
|
|
18939
|
+
const pageSize = input.page_size ?? DEFAULT_PAGE_SIZE2;
|
|
18940
|
+
const totalPages = Math.ceil(totalCount / pageSize);
|
|
18941
|
+
const offset = (page - 1) * pageSize;
|
|
18942
|
+
const paged = usersList.slice(offset, offset + pageSize);
|
|
18943
|
+
return {
|
|
18944
|
+
users: paged.map((u) => ({
|
|
18945
|
+
id: u.id,
|
|
18946
|
+
name: u.name,
|
|
18947
|
+
email: u.email,
|
|
18948
|
+
status: u.status,
|
|
18949
|
+
type: u.type ?? null,
|
|
18950
|
+
org_role: u.assignments?.find((a) => a.assignmentType === "role")?.role?.name ?? null
|
|
18951
|
+
})),
|
|
18952
|
+
auth_source: auth.source,
|
|
18953
|
+
base_url: baseUrl,
|
|
18954
|
+
environment: detectEnvironment(baseUrl),
|
|
18955
|
+
total_count: totalCount,
|
|
18956
|
+
page,
|
|
18957
|
+
page_size: pageSize,
|
|
18958
|
+
total_pages: totalPages
|
|
18959
|
+
};
|
|
18960
|
+
}
|
|
18961
|
+
};
|
|
18962
|
+
|
|
18377
18963
|
// ../mcp-server/dist/tools/revoke-resource-access.js
|
|
18378
18964
|
init_cjs_shims();
|
|
18379
18965
|
var revokeResourceAccessInputSchema = external_exports.object({
|
|
@@ -18608,6 +19194,7 @@ var toolDefinitions = [
|
|
|
18608
19194
|
checkoutApplication,
|
|
18609
19195
|
createFolder,
|
|
18610
19196
|
createIntegration,
|
|
19197
|
+
deactivateUser,
|
|
18611
19198
|
deleteFolder,
|
|
18612
19199
|
deleteIntegration,
|
|
18613
19200
|
deployApplication,
|
|
@@ -18629,6 +19216,7 @@ var toolDefinitions = [
|
|
|
18629
19216
|
getJobAccess,
|
|
18630
19217
|
getKnowledge,
|
|
18631
19218
|
getOrganizationSummary,
|
|
19219
|
+
getUserPermissions,
|
|
18632
19220
|
getWorkflowAccess,
|
|
18633
19221
|
grantResourceAccess,
|
|
18634
19222
|
listApplications,
|
|
@@ -18640,6 +19228,8 @@ var toolDefinitions = [
|
|
|
18640
19228
|
listOrganizationAgents,
|
|
18641
19229
|
listRbacAssignments,
|
|
18642
19230
|
listRoles,
|
|
19231
|
+
listUsers,
|
|
19232
|
+
listUsersByRole,
|
|
18643
19233
|
revokeResourceAccess,
|
|
18644
19234
|
unassignBuilderSeat,
|
|
18645
19235
|
undeployApplication,
|
|
@@ -18676,6 +19266,9 @@ async function executeToolCall(name, args, registry2) {
|
|
|
18676
19266
|
if (error48 instanceof McpError) {
|
|
18677
19267
|
throw error48;
|
|
18678
19268
|
}
|
|
19269
|
+
if (error48 instanceof EntitlementError) {
|
|
19270
|
+
return createToolCallResultPayload(error48.message, { isError: true });
|
|
19271
|
+
}
|
|
18679
19272
|
return createToolCallResultPayload(JSON.stringify({
|
|
18680
19273
|
error: error48 instanceof Error ? error48.message : String(error48)
|
|
18681
19274
|
}, null, 2), { isError: true });
|
|
@@ -18683,6 +19276,11 @@ async function executeToolCall(name, args, registry2) {
|
|
|
18683
19276
|
}
|
|
18684
19277
|
|
|
18685
19278
|
export {
|
|
19279
|
+
package_default,
|
|
19280
|
+
isJsonRpcRequest,
|
|
19281
|
+
invalidRequestResponse,
|
|
19282
|
+
handleJsonRpc,
|
|
19283
|
+
resolveProfile,
|
|
18686
19284
|
$constructor,
|
|
18687
19285
|
defineLazy,
|
|
18688
19286
|
clone,
|
|
@@ -18738,14 +19336,15 @@ export {
|
|
|
18738
19336
|
assertCompleteRequestResourceTemplate,
|
|
18739
19337
|
ListRootsResultSchema,
|
|
18740
19338
|
McpError,
|
|
18741
|
-
package_default,
|
|
18742
|
-
resolveProfile,
|
|
18743
19339
|
normalizeBaseUrl,
|
|
19340
|
+
getAuthContext,
|
|
19341
|
+
runWithAuthContext,
|
|
18744
19342
|
getMcpAuthFilePath,
|
|
18745
19343
|
upsertAuthToken,
|
|
18746
19344
|
listStoredOrigins,
|
|
19345
|
+
createSdk,
|
|
18747
19346
|
buildToolRegistry,
|
|
18748
19347
|
toolDefinitions,
|
|
18749
19348
|
executeToolCall
|
|
18750
19349
|
};
|
|
18751
|
-
//# sourceMappingURL=chunk-
|
|
19350
|
+
//# sourceMappingURL=chunk-VRPW5BO7.js.map
|