@burdenoff/mcp-libs 2026.1008.4 → 2026.1009.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/modules/files/index.cjs +101 -432
- package/dist/modules/files/index.cjs.map +1 -1
- package/dist/modules/files/index.js +102 -428
- package/dist/modules/files/index.js.map +1 -1
- package/dist/modules/groups/index.cjs +89 -360
- package/dist/modules/groups/index.cjs.map +1 -1
- package/dist/modules/groups/index.js +90 -356
- package/dist/modules/groups/index.js.map +1 -1
- package/dist/modules/rbac/index.cjs +85 -409
- package/dist/modules/rbac/index.cjs.map +1 -1
- package/dist/modules/rbac/index.js +86 -405
- package/dist/modules/rbac/index.js.map +1 -1
- package/dist/modules/sandbox/index.cjs +80 -1136
- package/dist/modules/sandbox/index.cjs.map +1 -1
- package/dist/modules/sandbox/index.js +80 -916
- package/dist/modules/sandbox/index.js.map +1 -1
- package/dist/modules/scheduler/index.cjs +70 -1044
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +69 -1038
- package/dist/modules/scheduler/index.js.map +1 -1
- package/dist/modules/security/index.cjs +42 -507
- package/dist/modules/security/index.cjs.map +1 -1
- package/dist/modules/security/index.js +41 -501
- package/dist/modules/security/index.js.map +1 -1
- package/dist/modules/store/index.cjs +49 -479
- package/dist/modules/store/index.cjs.map +1 -1
- package/dist/modules/store/index.js +48 -473
- package/dist/modules/store/index.js.map +1 -1
- package/dist/modules/support/index.cjs +18 -19
- package/dist/modules/support/index.cjs.map +1 -1
- package/dist/modules/support/index.js +18 -19
- package/dist/modules/support/index.js.map +1 -1
- package/dist/modules/tags/index.cjs +43 -348
- package/dist/modules/tags/index.cjs.map +1 -1
- package/dist/modules/tags/index.js +42 -342
- package/dist/modules/tags/index.js.map +1 -1
- package/dist/modules/vibecontrols/index.js +1774 -1
- package/dist/modules/vibecontrols/index.js.map +1 -1
- package/dist/modules/workspaces/index.cjs +20 -29
- package/dist/modules/workspaces/index.cjs.map +1 -1
- package/dist/modules/workspaces/index.js +20 -29
- package/dist/modules/workspaces/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-XITZQYB2.js +0 -1776
- package/dist/chunk-XITZQYB2.js.map +0 -1
|
@@ -37,12 +37,6 @@ function mcpToolName(productName, ...parts) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// src/core/result.ts
|
|
40
|
-
function jsonResult(data, structured) {
|
|
41
|
-
const result = {
|
|
42
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
43
|
-
};
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
40
|
function errorResult(message, hint) {
|
|
47
41
|
const text = hint ? `${message}
|
|
48
42
|
|
|
@@ -50,421 +44,103 @@ Hint: ${hint}` : message;
|
|
|
50
44
|
return { content: [{ type: "text", text }], isError: true };
|
|
51
45
|
}
|
|
52
46
|
|
|
53
|
-
// src/modules/rbac/operations.ts
|
|
54
|
-
var LIST_ROLES = `
|
|
55
|
-
query ListRoles($filter: RoleFilterInput, $pagination: PaginationInput, $scopeId: String!) {
|
|
56
|
-
roles(filter: $filter, pagination: $pagination, scopeId: $scopeId) {
|
|
57
|
-
id
|
|
58
|
-
name
|
|
59
|
-
description
|
|
60
|
-
isSystem
|
|
61
|
-
scopeId
|
|
62
|
-
priority
|
|
63
|
-
defaultPermissions {
|
|
64
|
-
level
|
|
65
|
-
resourceType
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
var GET_ROLE = `
|
|
71
|
-
query GetRole($id: ID!) {
|
|
72
|
-
role(id: $id) {
|
|
73
|
-
id
|
|
74
|
-
name
|
|
75
|
-
description
|
|
76
|
-
isSystem
|
|
77
|
-
scopeId
|
|
78
|
-
priority
|
|
79
|
-
defaultPermissions {
|
|
80
|
-
level
|
|
81
|
-
resourceType
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
86
|
-
var CREATE_ROLE = `
|
|
87
|
-
mutation CreateRole($input: CreateRoleInput!) {
|
|
88
|
-
createRole(input: $input) {
|
|
89
|
-
id
|
|
90
|
-
name
|
|
91
|
-
description
|
|
92
|
-
scopeId
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
`;
|
|
96
|
-
var UPDATE_ROLE = `
|
|
97
|
-
mutation UpdateRole($id: ID!, $input: UpdateRoleInput!) {
|
|
98
|
-
updateRole(id: $id, input: $input) {
|
|
99
|
-
id
|
|
100
|
-
name
|
|
101
|
-
description
|
|
102
|
-
priority
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
106
|
-
var DELETE_ROLE = `
|
|
107
|
-
mutation DeleteRole($id: ID!, $reassignToRoleId: ID) {
|
|
108
|
-
deleteRole(id: $id, reassignToRoleId: $reassignToRoleId)
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
111
|
-
var CHECK_PERMISSION = `
|
|
112
|
-
query CheckPermission($input: PermissionCheckInput!) {
|
|
113
|
-
checkPermission(input: $input) {
|
|
114
|
-
allowed
|
|
115
|
-
decisionPath
|
|
116
|
-
roleName
|
|
117
|
-
roleLevel
|
|
118
|
-
overrideType
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
`;
|
|
122
|
-
var LIST_POLICY_REFERENCES = `
|
|
123
|
-
query PolicyReferences($filter: PolicyReferenceFilterInput, $pagination: PaginationInput) {
|
|
124
|
-
policyReferences(filter: $filter, pagination: $pagination) {
|
|
125
|
-
id
|
|
126
|
-
name
|
|
127
|
-
description
|
|
128
|
-
opaPackage
|
|
129
|
-
resourceType
|
|
130
|
-
action
|
|
131
|
-
isActive
|
|
132
|
-
priority
|
|
133
|
-
createdAt
|
|
134
|
-
updatedAt
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
`;
|
|
138
|
-
var ATTACH_POLICY = `
|
|
139
|
-
mutation AttachPolicy($roleId: ID!, $policyId: ID!) {
|
|
140
|
-
attachPolicyToRole(roleId: $roleId, policyId: $policyId) {
|
|
141
|
-
id
|
|
142
|
-
name
|
|
143
|
-
resourceType
|
|
144
|
-
action
|
|
145
|
-
isActive
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
`;
|
|
149
|
-
var DETACH_POLICY = `
|
|
150
|
-
mutation DetachPolicy($roleId: ID!, $policyId: ID!) {
|
|
151
|
-
detachPolicyFromRole(roleId: $roleId, policyId: $policyId)
|
|
152
|
-
}
|
|
153
|
-
`;
|
|
154
|
-
|
|
155
47
|
// src/modules/rbac/tools.ts
|
|
156
|
-
|
|
157
|
-
var ActorTypeEnum = zod.z.enum(["USER", "BOT", "GROUP", "INTEGRATION", "DELEGATED_AGENT"]);
|
|
158
|
-
function clientForLayer(ctx, layer) {
|
|
159
|
-
return layer === "workspace" ? ctx.gql.workspace : ctx.gql.global;
|
|
160
|
-
}
|
|
161
|
-
function defaultScopeId(ctx, layer) {
|
|
162
|
-
const auth = ctx.auth.read();
|
|
163
|
-
if (!auth) return null;
|
|
164
|
-
if (layer === "workspace") return auth.workspaceId ?? null;
|
|
165
|
-
return auth.organizationId ?? null;
|
|
166
|
-
}
|
|
167
|
-
function registerRbacTools(server, ctx, track) {
|
|
48
|
+
function stubbedTool(server, toolName, title, description, featureNote, inputSchema, altSuggestions) {
|
|
168
49
|
server.registerTool(
|
|
169
|
-
|
|
50
|
+
toolName,
|
|
170
51
|
{
|
|
171
|
-
title
|
|
172
|
-
description:
|
|
173
|
-
inputSchema
|
|
174
|
-
layer: LayerEnum.optional().describe("workspace or global (default: workspace)"),
|
|
175
|
-
scopeId: zod.z.string().optional().describe("Override scope id (workspace or tenant)"),
|
|
176
|
-
includeSystem: zod.z.boolean().optional().describe("Include system roles"),
|
|
177
|
-
limit: zod.z.number().optional().describe("Page size")
|
|
178
|
-
}
|
|
52
|
+
title,
|
|
53
|
+
description: `${description} [STUB]`,
|
|
54
|
+
inputSchema
|
|
179
55
|
},
|
|
180
|
-
async (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const resolvedScope = scopeId ?? defaultScopeId(ctx, targetLayer);
|
|
184
|
-
if (!resolvedScope) {
|
|
185
|
-
return errorResult(
|
|
186
|
-
`No ${targetLayer} scope. Pass scopeId or authenticate to a workspace/organization.`
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
const filter = {};
|
|
190
|
-
if (includeSystem) filter.includeSystem = true;
|
|
191
|
-
const data = await clientForLayer(ctx, targetLayer).request(
|
|
192
|
-
LIST_ROLES,
|
|
193
|
-
{
|
|
194
|
-
filter: Object.keys(filter).length ? filter : void 0,
|
|
195
|
-
pagination: { limit: limit ?? 100, offset: 0 },
|
|
196
|
-
scopeId: resolvedScope
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
return jsonResult(data.roles);
|
|
200
|
-
} catch (error) {
|
|
201
|
-
ctx.logger.error("rbac_roles_list failed", { error: String(error) });
|
|
202
|
-
return errorResult(
|
|
203
|
-
`Failed to list roles: ${error instanceof Error ? error.message : String(error)}`
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
56
|
+
async () => errorResult(
|
|
57
|
+
`[stubbed] ${featureNote} Use ${altSuggestions.join(", ")} instead. The tool remains registered so callers receive a meaningful response instead of a schema-validation error.`
|
|
58
|
+
)
|
|
207
59
|
);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const targetLayer = layer ?? "workspace";
|
|
221
|
-
const data = await clientForLayer(ctx, targetLayer).request(
|
|
222
|
-
GET_ROLE,
|
|
223
|
-
{ id }
|
|
224
|
-
);
|
|
225
|
-
if (!data.role) return errorResult(`Role ${id} not found`);
|
|
226
|
-
return jsonResult(data.role);
|
|
227
|
-
} catch (error) {
|
|
228
|
-
ctx.logger.error("rbac_roles_get failed", { error: String(error) });
|
|
229
|
-
return errorResult(
|
|
230
|
-
`Failed to get role: ${error instanceof Error ? error.message : String(error)}`
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
60
|
+
}
|
|
61
|
+
function registerRbacTools(server, _ctx, track) {
|
|
62
|
+
const featureNote = "Live alpha removed the rbac policies surface (no `attachPolicyToRole` / `detachPolicyFromRole` mutations; `roles` / `policies` queries are gone).";
|
|
63
|
+
const alts = ["the next alpha release that re-exposes the rbac surface"];
|
|
64
|
+
stubbedTool(
|
|
65
|
+
server,
|
|
66
|
+
track(mcpToolName(_ctx.productName, "rbac_check")),
|
|
67
|
+
"Check Permission",
|
|
68
|
+
"Check whether the calling actor has a given permission.",
|
|
69
|
+
featureNote,
|
|
70
|
+
{ permission: zod.z.string() },
|
|
71
|
+
alts
|
|
234
72
|
);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
parentId: zod.z.string().optional().describe("Parent role id"),
|
|
244
|
-
priority: zod.z.number().optional().describe("Priority"),
|
|
245
|
-
layer: LayerEnum.optional().describe("workspace or global (default: workspace)"),
|
|
246
|
-
scopeId: zod.z.string().optional().describe("Override scope id"),
|
|
247
|
-
scopeType: zod.z.string().optional().describe("wspace|entity (global layer only)")
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
async ({ name, description, parentId, priority, layer, scopeId, scopeType }) => {
|
|
251
|
-
try {
|
|
252
|
-
const targetLayer = layer ?? "workspace";
|
|
253
|
-
const resolvedScope = scopeId ?? defaultScopeId(ctx, targetLayer);
|
|
254
|
-
if (!resolvedScope) {
|
|
255
|
-
return errorResult(
|
|
256
|
-
`No ${targetLayer} scope. Pass scopeId or authenticate to a workspace/organization.`
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
const input = { name, scopeId: resolvedScope };
|
|
260
|
-
if (description !== void 0) input.description = description;
|
|
261
|
-
if (parentId !== void 0) input.parentId = parentId;
|
|
262
|
-
if (priority !== void 0) input.priority = priority;
|
|
263
|
-
if (targetLayer === "global" && scopeType) input.scopeType = scopeType;
|
|
264
|
-
const data = await clientForLayer(ctx, targetLayer).request(
|
|
265
|
-
CREATE_ROLE,
|
|
266
|
-
{ input }
|
|
267
|
-
);
|
|
268
|
-
return jsonResult(data.createRole);
|
|
269
|
-
} catch (error) {
|
|
270
|
-
ctx.logger.error("rbac_roles_create failed", { error: String(error) });
|
|
271
|
-
return errorResult(
|
|
272
|
-
`Failed to create role: ${error instanceof Error ? error.message : String(error)}`
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
73
|
+
stubbedTool(
|
|
74
|
+
server,
|
|
75
|
+
track(mcpToolName(_ctx.productName, "rbac_policies_list")),
|
|
76
|
+
"List Policy References",
|
|
77
|
+
"List references to a policy across the system.",
|
|
78
|
+
featureNote,
|
|
79
|
+
{ policyId: zod.z.string() },
|
|
80
|
+
alts
|
|
276
81
|
);
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
description: zod.z.string().optional().describe("Updated description"),
|
|
286
|
-
priority: zod.z.number().optional().describe("Updated priority"),
|
|
287
|
-
parentId: zod.z.string().optional().describe("Updated parent role id"),
|
|
288
|
-
layer: LayerEnum.optional().describe("workspace or global (default: workspace)")
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
async ({ id, name, description, priority, parentId, layer }) => {
|
|
292
|
-
try {
|
|
293
|
-
const targetLayer = layer ?? "workspace";
|
|
294
|
-
const input = {};
|
|
295
|
-
if (name !== void 0) input.name = name;
|
|
296
|
-
if (description !== void 0) input.description = description;
|
|
297
|
-
if (priority !== void 0) input.priority = priority;
|
|
298
|
-
if (parentId !== void 0) input.parentId = parentId;
|
|
299
|
-
if (!Object.keys(input).length) {
|
|
300
|
-
return errorResult("No updates specified");
|
|
301
|
-
}
|
|
302
|
-
const data = await clientForLayer(ctx, targetLayer).request(
|
|
303
|
-
UPDATE_ROLE,
|
|
304
|
-
{ id, input }
|
|
305
|
-
);
|
|
306
|
-
return jsonResult(data.updateRole);
|
|
307
|
-
} catch (error) {
|
|
308
|
-
ctx.logger.error("rbac_roles_update failed", { error: String(error) });
|
|
309
|
-
return errorResult(
|
|
310
|
-
`Failed to update role: ${error instanceof Error ? error.message : String(error)}`
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
82
|
+
stubbedTool(
|
|
83
|
+
server,
|
|
84
|
+
track(mcpToolName(_ctx.productName, "rbac_policies_attach")),
|
|
85
|
+
"Attach Policy to Role",
|
|
86
|
+
"Attach a policy to a role.",
|
|
87
|
+
featureNote,
|
|
88
|
+
{ roleId: zod.z.string(), policyId: zod.z.string() },
|
|
89
|
+
alts
|
|
314
90
|
);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
layer: LayerEnum.optional().describe("workspace or global (default: workspace)")
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
async ({ id, reassignToRoleId, layer }) => {
|
|
327
|
-
try {
|
|
328
|
-
const targetLayer = layer ?? "workspace";
|
|
329
|
-
const data = await clientForLayer(ctx, targetLayer).request(
|
|
330
|
-
DELETE_ROLE,
|
|
331
|
-
{ id, reassignToRoleId }
|
|
332
|
-
);
|
|
333
|
-
return jsonResult({ deleted: data.deleteRole, roleId: id });
|
|
334
|
-
} catch (error) {
|
|
335
|
-
ctx.logger.error("rbac_roles_delete failed", { error: String(error) });
|
|
336
|
-
return errorResult(
|
|
337
|
-
`Failed to delete role: ${error instanceof Error ? error.message : String(error)}`
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
91
|
+
stubbedTool(
|
|
92
|
+
server,
|
|
93
|
+
track(mcpToolName(_ctx.productName, "rbac_policies_detach")),
|
|
94
|
+
"Detach Policy from Role",
|
|
95
|
+
"Detach a policy from a role.",
|
|
96
|
+
featureNote,
|
|
97
|
+
{ roleId: zod.z.string(), policyId: zod.z.string() },
|
|
98
|
+
alts
|
|
341
99
|
);
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
action: zod.z.string().optional().describe("Filter by action (e.g. read/write/delete)"),
|
|
351
|
-
isActive: zod.z.boolean().optional().describe("Only active/inactive policies"),
|
|
352
|
-
limit: zod.z.number().int().optional().describe("Page size (default 100)"),
|
|
353
|
-
offset: zod.z.number().int().optional().describe("Pagination offset (default 0)")
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
async ({ layer, resourceType, action, isActive, limit, offset }) => {
|
|
357
|
-
try {
|
|
358
|
-
const targetLayer = layer ?? "workspace";
|
|
359
|
-
const filter = {};
|
|
360
|
-
if (resourceType !== void 0) filter.resourceType = resourceType;
|
|
361
|
-
if (action !== void 0) filter.action = action;
|
|
362
|
-
if (isActive !== void 0) filter.isActive = isActive;
|
|
363
|
-
const data = await clientForLayer(ctx, targetLayer).request(LIST_POLICY_REFERENCES, {
|
|
364
|
-
filter: Object.keys(filter).length ? filter : void 0,
|
|
365
|
-
pagination: { limit: limit ?? 100, offset: offset ?? 0 }
|
|
366
|
-
});
|
|
367
|
-
return jsonResult(data.policyReferences);
|
|
368
|
-
} catch (error) {
|
|
369
|
-
ctx.logger.error("rbac_policies_list failed", { error: String(error) });
|
|
370
|
-
return errorResult(
|
|
371
|
-
`Failed to list policy references: ${error instanceof Error ? error.message : String(error)}`
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
100
|
+
stubbedTool(
|
|
101
|
+
server,
|
|
102
|
+
track(mcpToolName(_ctx.productName, "rbac_roles_list")),
|
|
103
|
+
"List Roles",
|
|
104
|
+
"List roles (workspace or global layer).",
|
|
105
|
+
featureNote,
|
|
106
|
+
{ layer: zod.z.enum(["workspace", "global"]).optional() },
|
|
107
|
+
alts
|
|
375
108
|
);
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
layer: LayerEnum.optional().describe("workspace or global (default: workspace)")
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
async ({ roleId, policyId, layer }) => {
|
|
388
|
-
try {
|
|
389
|
-
const targetLayer = layer ?? "workspace";
|
|
390
|
-
const data = await clientForLayer(ctx, targetLayer).request(ATTACH_POLICY, { roleId, policyId });
|
|
391
|
-
return jsonResult(data.attachPolicyToRole);
|
|
392
|
-
} catch (error) {
|
|
393
|
-
ctx.logger.error("rbac_policies_attach failed", { error: String(error) });
|
|
394
|
-
return errorResult(
|
|
395
|
-
`Failed to attach policy: ${error instanceof Error ? error.message : String(error)}`
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
109
|
+
stubbedTool(
|
|
110
|
+
server,
|
|
111
|
+
track(mcpToolName(_ctx.productName, "rbac_roles_get")),
|
|
112
|
+
"Get Role",
|
|
113
|
+
"Get a role by ID.",
|
|
114
|
+
featureNote,
|
|
115
|
+
{ id: zod.z.string() },
|
|
116
|
+
alts
|
|
399
117
|
);
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
layer: LayerEnum.optional().describe("workspace or global (default: workspace)")
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
async ({ roleId, policyId, layer }) => {
|
|
412
|
-
try {
|
|
413
|
-
const targetLayer = layer ?? "workspace";
|
|
414
|
-
const data = await clientForLayer(ctx, targetLayer).request(DETACH_POLICY, { roleId, policyId });
|
|
415
|
-
return jsonResult({ detached: data.detachPolicyFromRole, roleId, policyId });
|
|
416
|
-
} catch (error) {
|
|
417
|
-
ctx.logger.error("rbac_policies_detach failed", { error: String(error) });
|
|
418
|
-
return errorResult(
|
|
419
|
-
`Failed to detach policy: ${error instanceof Error ? error.message : String(error)}`
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
118
|
+
stubbedTool(
|
|
119
|
+
server,
|
|
120
|
+
track(mcpToolName(_ctx.productName, "rbac_roles_create")),
|
|
121
|
+
"Create Role",
|
|
122
|
+
"Create a new role.",
|
|
123
|
+
featureNote,
|
|
124
|
+
{ name: zod.z.string() },
|
|
125
|
+
alts
|
|
423
126
|
);
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
const targetLayer = layer ?? "workspace";
|
|
442
|
-
const resolvedScope = scopeId ?? defaultScopeId(ctx, targetLayer);
|
|
443
|
-
if (!resolvedScope) {
|
|
444
|
-
return errorResult(
|
|
445
|
-
`No ${targetLayer} scope. Pass scopeId or authenticate to a workspace/organization.`
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
const input = {
|
|
449
|
-
actorId,
|
|
450
|
-
actorType: actorType ?? "USER",
|
|
451
|
-
action,
|
|
452
|
-
resourceType,
|
|
453
|
-
scopeId: resolvedScope
|
|
454
|
-
};
|
|
455
|
-
if (resourceId !== void 0) input.resourceId = resourceId;
|
|
456
|
-
const data = await clientForLayer(ctx, targetLayer).request(
|
|
457
|
-
CHECK_PERMISSION,
|
|
458
|
-
{ input }
|
|
459
|
-
);
|
|
460
|
-
return jsonResult(data.checkPermission);
|
|
461
|
-
} catch (error) {
|
|
462
|
-
ctx.logger.error("rbac_check failed", { error: String(error) });
|
|
463
|
-
return errorResult(
|
|
464
|
-
`Failed to check permission: ${error instanceof Error ? error.message : String(error)}`
|
|
465
|
-
);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
127
|
+
stubbedTool(
|
|
128
|
+
server,
|
|
129
|
+
track(mcpToolName(_ctx.productName, "rbac_roles_update")),
|
|
130
|
+
"Update Role",
|
|
131
|
+
"Update a role.",
|
|
132
|
+
featureNote,
|
|
133
|
+
{ id: zod.z.string() },
|
|
134
|
+
alts
|
|
135
|
+
);
|
|
136
|
+
stubbedTool(
|
|
137
|
+
server,
|
|
138
|
+
track(mcpToolName(_ctx.productName, "rbac_roles_delete")),
|
|
139
|
+
"Delete Role",
|
|
140
|
+
"Delete a role.",
|
|
141
|
+
featureNote,
|
|
142
|
+
{ id: zod.z.string() },
|
|
143
|
+
alts
|
|
468
144
|
);
|
|
469
145
|
}
|
|
470
146
|
|