@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.
Files changed (45) hide show
  1. package/dist/modules/files/index.cjs +101 -432
  2. package/dist/modules/files/index.cjs.map +1 -1
  3. package/dist/modules/files/index.js +102 -428
  4. package/dist/modules/files/index.js.map +1 -1
  5. package/dist/modules/groups/index.cjs +89 -360
  6. package/dist/modules/groups/index.cjs.map +1 -1
  7. package/dist/modules/groups/index.js +90 -356
  8. package/dist/modules/groups/index.js.map +1 -1
  9. package/dist/modules/rbac/index.cjs +85 -409
  10. package/dist/modules/rbac/index.cjs.map +1 -1
  11. package/dist/modules/rbac/index.js +86 -405
  12. package/dist/modules/rbac/index.js.map +1 -1
  13. package/dist/modules/sandbox/index.cjs +80 -1136
  14. package/dist/modules/sandbox/index.cjs.map +1 -1
  15. package/dist/modules/sandbox/index.js +80 -916
  16. package/dist/modules/sandbox/index.js.map +1 -1
  17. package/dist/modules/scheduler/index.cjs +70 -1044
  18. package/dist/modules/scheduler/index.cjs.map +1 -1
  19. package/dist/modules/scheduler/index.js +69 -1038
  20. package/dist/modules/scheduler/index.js.map +1 -1
  21. package/dist/modules/security/index.cjs +42 -507
  22. package/dist/modules/security/index.cjs.map +1 -1
  23. package/dist/modules/security/index.js +41 -501
  24. package/dist/modules/security/index.js.map +1 -1
  25. package/dist/modules/store/index.cjs +49 -479
  26. package/dist/modules/store/index.cjs.map +1 -1
  27. package/dist/modules/store/index.js +48 -473
  28. package/dist/modules/store/index.js.map +1 -1
  29. package/dist/modules/support/index.cjs +18 -19
  30. package/dist/modules/support/index.cjs.map +1 -1
  31. package/dist/modules/support/index.js +18 -19
  32. package/dist/modules/support/index.js.map +1 -1
  33. package/dist/modules/tags/index.cjs +43 -348
  34. package/dist/modules/tags/index.cjs.map +1 -1
  35. package/dist/modules/tags/index.js +42 -342
  36. package/dist/modules/tags/index.js.map +1 -1
  37. package/dist/modules/vibecontrols/index.js +1774 -1
  38. package/dist/modules/vibecontrols/index.js.map +1 -1
  39. package/dist/modules/workspaces/index.cjs +20 -29
  40. package/dist/modules/workspaces/index.cjs.map +1 -1
  41. package/dist/modules/workspaces/index.js +20 -29
  42. package/dist/modules/workspaces/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/chunk-XITZQYB2.js +0 -1776
  45. package/dist/chunk-XITZQYB2.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var zod = require('zod');
4
3
  require('graphql-request');
5
4
  require('cross-fetch');
6
5
  require('@modelcontextprotocol/sdk/server/mcp.js');
7
6
  require('@modelcontextprotocol/sdk/types.js');
7
+ require('zod');
8
8
 
9
- // src/modules/sandbox/tools.ts
9
+ // src/core/auth/store.ts
10
10
 
11
11
  // src/core/errors.ts
12
12
  var McpInternalError = class extends Error {
@@ -37,1153 +37,97 @@ 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
 
49
43
  Hint: ${hint}` : message;
50
44
  return { content: [{ type: "text", text }], isError: true };
51
45
  }
52
- var SANDBOX_FIELDS = `
53
- id name description template mode status
54
- crdName podName namespace runtimeClass
55
- containers { name image ports { containerPort name protocol } env { name value } command args resources { requestsCpu requestsMemory limitsCpu limitsMemory } }
56
- containerStatuses { name ready port restartCount }
57
- resources { cpuRequest cpuLimit memoryRequest memoryLimit }
58
- storage { mode sizeGi mountPath retainOnDelete }
59
- network { exposeService internalUrl containerUrls serviceName }
60
- ttlSeconds expiresAt metadata errorMessage
61
- workspaceId createdBy createdAt updatedAt stoppedAt
62
- `;
63
- var LIST_SANDBOXES = `
64
- query ListSandboxes($filter: SandboxFilterInput, $pagination: SandboxPaginationInput, $context: ContextInput!) {
65
- listSandboxes(filter: $filter, pagination: $pagination, context: $context) {
66
- items { ${SANDBOX_FIELDS} }
67
- total hasMore
68
- }
69
- }
70
- `;
71
- var GET_SANDBOX = `
72
- query GetSandbox($id: ID!, $context: ContextInput!) {
73
- getSandbox(id: $id, context: $context) { ${SANDBOX_FIELDS} }
74
- }
75
- `;
76
- var CREATE_SANDBOX = `
77
- mutation CreateSandbox($input: CreateSandboxInput!) {
78
- createSandbox(input: $input) { ${SANDBOX_FIELDS} }
79
- }
80
- `;
81
- var DELETE_SANDBOX = `
82
- mutation DeleteSandbox($id: ID!, $context: ContextInput!) {
83
- deleteSandbox(id: $id, context: $context)
84
- }
85
- `;
86
- var STOP_SANDBOX = `
87
- mutation StopSandbox($id: ID!, $context: ContextInput!) {
88
- stopSandbox(id: $id, context: $context) { ${SANDBOX_FIELDS} }
89
- }
90
- `;
91
- var START_SANDBOX = `
92
- mutation StartSandbox($id: ID!, $context: ContextInput!) {
93
- startSandbox(id: $id, context: $context) { ${SANDBOX_FIELDS} }
94
- }
95
- `;
96
- var EXTEND_SANDBOX_TTL = `
97
- mutation ExtendSandboxTTL($id: ID!, $additionalSeconds: Int!, $context: ContextInput!) {
98
- extendSandboxTTL(id: $id, additionalSeconds: $additionalSeconds, context: $context) { ${SANDBOX_FIELDS} }
99
- }
100
- `;
101
- var SANDBOX_TEMPLATE_FIELDS = `
102
- id name description template isDefault ttlSeconds
103
- containers { name image }
104
- resources { cpuRequest cpuLimit memoryRequest memoryLimit }
105
- storage { mode sizeGi mountPath retainOnDelete }
106
- config metadata allowedImages
107
- workspaceId createdBy createdAt updatedAt
108
- `;
109
- var LIST_SANDBOX_TEMPLATES = `
110
- query ListSandboxTemplates($context: ContextInput!, $template: SandboxTemplate, $pagination: SandboxPaginationInput) {
111
- listSandboxTemplates(context: $context, template: $template, pagination: $pagination) {
112
- items { ${SANDBOX_TEMPLATE_FIELDS} } total hasMore
113
- }
114
- }
115
- `;
116
- var GET_SANDBOX_TEMPLATE = `
117
- query GetSandboxTemplate($context: ContextInput!, $id: ID!) {
118
- getSandboxTemplate(context: $context, id: $id) { ${SANDBOX_TEMPLATE_FIELDS} }
119
- }
120
- `;
121
- var CREATE_SANDBOX_TEMPLATE = `
122
- mutation CreateSandboxTemplate($input: CreateSandboxTemplateInput!) {
123
- createSandboxTemplate(input: $input) { ${SANDBOX_TEMPLATE_FIELDS} }
124
- }
125
- `;
126
- var UPDATE_SANDBOX_TEMPLATE = `
127
- mutation UpdateSandboxTemplate($input: UpdateSandboxTemplateInput!) {
128
- updateSandboxTemplate(input: $input) { ${SANDBOX_TEMPLATE_FIELDS} }
129
- }
130
- `;
131
- var DELETE_SANDBOX_TEMPLATE = `
132
- mutation DeleteSandboxTemplate($context: ContextInput!, $id: ID!) {
133
- deleteSandboxTemplate(context: $context, id: $id)
134
- }
135
- `;
136
- var AVAILABLE_SANDBOX_TAGS = `
137
- query AvailableSandboxTags($query: String, $limit: Int) {
138
- availableSandboxTags(query: $query, limit: $limit) { id key label color }
139
- }
140
- `;
141
- var GET_SANDBOX_TAGS = `
142
- query GetSandboxTags($input: GetSandboxTagsInput!) {
143
- getSandboxTags(input: $input) {
144
- id entityId entityType tagId source assignedAt assignedBy
145
- }
146
- }
147
- `;
148
- var CREATE_SANDBOX_TAG = `
149
- mutation CreateSandboxTag($input: CreateSandboxTagInput!) {
150
- createSandboxTag(input: $input) { id key label color }
151
- }
152
- `;
153
- var TAG_SANDBOX = `
154
- mutation TagSandbox($input: TagSandboxInput!) {
155
- tagSandbox(input: $input) {
156
- id entityId tagId source assignedAt
157
- }
158
- }
159
- `;
160
- var UNTAG_SANDBOX = `
161
- mutation UntagSandbox($input: UntagSandboxInput!) {
162
- untagSandbox(input: $input)
163
- }
164
- `;
165
- var REPLACE_SANDBOX_TAGS = `
166
- mutation ReplaceSandboxTags($input: ReplaceSandboxTagsInput!) {
167
- replaceSandboxTags(input: $input) {
168
- id entityId tagId source assignedAt
169
- }
170
- }
171
- `;
172
- var LIST_ALL_SANDBOXES = `
173
- query ListAllSandboxes($context: ContextInput!, $filter: SandboxFilterInput, $pagination: SandboxPaginationInput) {
174
- listAllSandboxes(context: $context, filter: $filter, pagination: $pagination) {
175
- items { ${SANDBOX_FIELDS} } total hasMore
176
- }
177
- }
178
- `;
179
- var LIST_SANDBOX_NODES = `
180
- query ListSandboxNodes($context: ContextInput!) {
181
- listSandboxNodes(context: $context) {
182
- name status allocatableCpu allocatableMemory sandboxPodCount labels
183
- }
184
- }
185
- `;
186
- var GET_ACTIVE_SANDBOXES = `
187
- query GetActiveSandboxes($context: ContextInput!) {
188
- getActiveSandboxes(context: $context) { ${SANDBOX_FIELDS} }
189
- }
190
- `;
191
- var GET_RECENT_SANDBOX_ACTIVITY = `
192
- query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {
193
- getRecentSandboxActivity(context: $context, limit: $limit) {
194
- items { id action actorId status sandboxName sandboxId createdAt }
195
- total
196
- }
197
- }
198
- `;
199
- var GET_SANDBOX_STATS = `
200
- query GetSandboxStats($context: ContextInput!) {
201
- getSandboxStats(context: $context) {
202
- activeSandboxes activeUserSandboxes activeInternalSandboxes
203
- totalCreated totalDeleted totalUserCreated totalInternalCreated
204
- runningNow provisioningNow stoppedNow expiredCount failedCount
205
- totalCpuUsed totalMemoryUsed
206
- }
207
- }
208
- `;
209
- var GET_SANDBOX_LOGS = `
210
- query GetSandboxLogs($context: ContextInput!, $id: ID!, $containerName: String!, $tailLines: Int) {
211
- getSandboxLogs(context: $context, id: $id, containerName: $containerName, tailLines: $tailLines)
212
- }
213
- `;
214
- var GET_SANDBOX_CONFIG = `
215
- query GetSandboxConfig($context: ContextInput!) {
216
- getSandboxConfig(context: $context) {
217
- id defaultTtlSeconds maxTtlSeconds allowedTemplates
218
- maxConcurrentPerUser maxConcurrentPerWorkspace
219
- defaultCpuRequest defaultCpuLimit defaultMemoryRequest defaultMemoryLimit
220
- workspaceId updatedAt
221
- }
222
- }
223
- `;
224
- var UPDATE_SANDBOX_CONFIG = `
225
- mutation UpdateSandboxConfig($input: UpdateSandboxConfigInput!) {
226
- updateSandboxConfig(input: $input) {
227
- id defaultTtlSeconds maxTtlSeconds allowedTemplates
228
- maxConcurrentPerUser maxConcurrentPerWorkspace
229
- defaultCpuRequest defaultCpuLimit defaultMemoryRequest defaultMemoryLimit
230
- workspaceId updatedAt
231
- }
232
- }
233
- `;
234
- var SANDBOX_EXPORT_JOB_FIELDS = `
235
- id workspaceId format status requestedBy rowCount
236
- downloadUrl errorMessage expiresAt createdAt updatedAt
237
- `;
238
- var EXPORT_SANDBOXES = `
239
- mutation ExportSandboxes($input: ExportSandboxesInput!) {
240
- exportSandboxes(input: $input) { ${SANDBOX_EXPORT_JOB_FIELDS} }
241
- }
242
- `;
243
- var GET_SANDBOX_EXPORT_JOB = `
244
- query GetSandboxExportJob($workspaceId: ID!, $jobId: ID!, $context: ContextInput!) {
245
- getSandboxExportJob(workspaceId: $workspaceId, jobId: $jobId, context: $context) {
246
- ${SANDBOX_EXPORT_JOB_FIELDS}
247
- }
248
- }
249
- `;
250
- var LIST_SANDBOX_EXPORT_JOBS = `
251
- query ListSandboxExportJobs($workspaceId: ID!, $context: ContextInput!, $pagination: SandboxPaginationInput) {
252
- listSandboxExportJobs(workspaceId: $workspaceId, context: $context, pagination: $pagination) {
253
- ${SANDBOX_EXPORT_JOB_FIELDS}
254
- }
255
- }
256
- `;
257
- var GET_SANDBOX_ARTIFACT_BYTES = `
258
- query GetSandboxArtifactBytes($input: SandboxArtifactBytesInput!) {
259
- getSandboxArtifactBytes(input: $input) { filename mimeType size contentBase64 }
260
- }
261
- `;
262
- var PROXY_SANDBOX_REQUEST = `
263
- mutation ProxySandboxRequest($input: ProxySandboxRequestInput!) {
264
- proxySandboxRequest(input: $input) { status body }
265
- }
266
- `;
267
46
 
268
47
  // src/modules/sandbox/tools.ts
269
- function registerSandboxTools(server, ctx, track) {
270
- server.registerTool(
271
- track(mcpToolName(ctx.productName, "sandbox_list")),
272
- {
273
- title: "List Sandboxes",
274
- description: "List Kubernetes-native sandboxes with optional filters and pagination.",
275
- inputSchema: {
276
- status: zod.z.string().optional().describe(
277
- "Filter by status (PENDING, PROVISIONING, RUNNING, STOPPING, STOPPED, EXPIRED, FAILED)"
278
- ),
279
- template: zod.z.string().optional().describe(
280
- "Filter by template (VIBECONTROLS, AI_BUILDER, WORKFLOW_MULTI_NODE, MISC_SHELL, CUSTOM)"
281
- ),
282
- limit: zod.z.number().optional().describe("Max results"),
283
- offset: zod.z.number().optional().describe("Skip results")
284
- }
285
- },
286
- async ({ status, template, limit, offset }) => {
287
- try {
288
- const filter = {};
289
- if (status !== void 0) filter.status = status;
290
- if (template !== void 0) filter.template = template;
291
- const pagination = {};
292
- if (limit !== void 0) pagination.limit = limit;
293
- if (offset !== void 0) pagination.offset = offset;
294
- const data = await ctx.gql.workspace.request(LIST_SANDBOXES, {
295
- filter: Object.keys(filter).length > 0 ? filter : void 0,
296
- pagination: Object.keys(pagination).length > 0 ? pagination : void 0
297
- });
298
- return jsonResult(data.listSandboxes);
299
- } catch (error) {
300
- ctx.logger.error("vibecontrols_sandbox_list failed", { error });
301
- return errorResult(
302
- `Failed to list sandboxes: ${error instanceof Error ? error.message : String(error)}`
303
- );
304
- }
305
- }
306
- );
307
- server.registerTool(
308
- track(mcpToolName(ctx.productName, "sandbox_get")),
309
- {
310
- title: "Get Sandbox",
311
- description: "Get a sandbox by its ID.",
312
- inputSchema: { id: zod.z.string().describe("Sandbox ID") }
313
- },
314
- async ({ id }) => {
315
- try {
316
- const data = await ctx.gql.workspace.request(GET_SANDBOX, { id });
317
- return jsonResult(data.getSandbox);
318
- } catch (error) {
319
- ctx.logger.error("vibecontrols_sandbox_get failed", { error });
320
- return errorResult(
321
- `Failed to get sandbox: ${error instanceof Error ? error.message : String(error)}`
322
- );
323
- }
324
- }
325
- );
326
- server.registerTool(
327
- track(mcpToolName(ctx.productName, "sandbox_create")),
328
- {
329
- title: "Create Sandbox",
330
- description: "Create a new Kubernetes-native sandbox environment with Kata Containers isolation.",
331
- inputSchema: {
332
- name: zod.z.string().describe("Sandbox name"),
333
- template: zod.z.enum(["VIBECONTROLS", "AI_BUILDER", "WORKFLOW_MULTI_NODE", "MISC_SHELL", "CUSTOM"]).describe("Sandbox template type"),
334
- mode: zod.z.enum(["DEPLOYMENT", "JOB"]).optional().describe("Run mode: DEPLOYMENT (long-running) or JOB (run-to-completion)"),
335
- containers: zod.z.array(
336
- zod.z.object({
337
- name: zod.z.string().describe("Container name"),
338
- image: zod.z.string().describe("Container image"),
339
- ports: zod.z.array(
340
- zod.z.object({
341
- containerPort: zod.z.number().describe("Container port"),
342
- name: zod.z.string().optional().describe("Port name"),
343
- protocol: zod.z.string().optional().describe("Protocol (TCP, UDP)")
344
- })
345
- ).optional().describe("Exposed ports"),
346
- env: zod.z.array(
347
- zod.z.object({
348
- name: zod.z.string().describe("Env var name"),
349
- value: zod.z.string().describe("Env var value")
350
- })
351
- ).optional().describe("Environment variables"),
352
- command: zod.z.array(zod.z.string()).optional().describe("Container entrypoint command"),
353
- args: zod.z.array(zod.z.string()).optional().describe("Container arguments")
354
- })
355
- ).optional().describe("Container specifications (uses template defaults if omitted)"),
356
- ttlSeconds: zod.z.number().optional().describe("Time-to-live in seconds"),
357
- resources: zod.z.object({
358
- cpuRequest: zod.z.string().optional(),
359
- cpuLimit: zod.z.string().optional(),
360
- memoryRequest: zod.z.string().optional(),
361
- memoryLimit: zod.z.string().optional()
362
- }).optional().describe("Resource requests/limits"),
363
- description: zod.z.string().optional().describe("Sandbox description"),
364
- templateId: zod.z.string().optional().describe("Sandbox template config ID to use")
365
- }
366
- },
367
- async ({
368
- name,
369
- template,
370
- mode,
371
- containers,
372
- ttlSeconds,
373
- resources,
374
- description,
375
- templateId
376
- }) => {
377
- try {
378
- const input = { name, template };
379
- if (mode !== void 0) input.mode = mode;
380
- if (containers !== void 0) input.containers = containers;
381
- if (ttlSeconds !== void 0) input.ttlSeconds = ttlSeconds;
382
- if (resources !== void 0) input.resources = resources;
383
- if (description !== void 0) input.description = description;
384
- if (templateId !== void 0) input.templateId = templateId;
385
- const data = await ctx.gql.workspace.request(CREATE_SANDBOX, {
386
- input
387
- });
388
- return jsonResult(data.createSandbox);
389
- } catch (error) {
390
- ctx.logger.error("vibecontrols_sandbox_create failed", { error });
391
- return errorResult(
392
- `Failed to create sandbox: ${error instanceof Error ? error.message : String(error)}`
393
- );
394
- }
395
- }
396
- );
397
- server.registerTool(
398
- track(mcpToolName(ctx.productName, "sandbox_delete")),
399
- {
400
- title: "Delete Sandbox",
401
- description: "Delete a sandbox and its Kubernetes resources.",
402
- inputSchema: { id: zod.z.string().describe("Sandbox ID") }
403
- },
404
- async ({ id }) => {
405
- try {
406
- const data = await ctx.gql.workspace.request(DELETE_SANDBOX, {
407
- id
408
- });
409
- return jsonResult({ deleted: data.deleteSandbox, sandboxId: id });
410
- } catch (error) {
411
- ctx.logger.error("vibecontrols_sandbox_delete failed", { error });
412
- return errorResult(
413
- `Failed to delete sandbox: ${error instanceof Error ? error.message : String(error)}`
414
- );
415
- }
416
- }
417
- );
418
- server.registerTool(
419
- track(mcpToolName(ctx.productName, "sandbox_stop")),
420
- {
421
- title: "Stop Sandbox",
422
- description: "Stop a running sandbox.",
423
- inputSchema: { id: zod.z.string().describe("Sandbox ID") }
424
- },
425
- async ({ id }) => {
426
- try {
427
- const data = await ctx.gql.workspace.request(STOP_SANDBOX, {
428
- id
429
- });
430
- return jsonResult(data.stopSandbox);
431
- } catch (error) {
432
- ctx.logger.error("vibecontrols_sandbox_stop failed", { error });
433
- return errorResult(
434
- `Failed to stop sandbox: ${error instanceof Error ? error.message : String(error)}`
435
- );
436
- }
437
- }
438
- );
439
- server.registerTool(
440
- track(mcpToolName(ctx.productName, "sandbox_start")),
441
- {
442
- title: "Start Sandbox",
443
- description: "Start a stopped sandbox.",
444
- inputSchema: { id: zod.z.string().describe("Sandbox ID") }
445
- },
446
- async ({ id }) => {
447
- try {
448
- const data = await ctx.gql.workspace.request(START_SANDBOX, {
449
- id
450
- });
451
- return jsonResult(data.startSandbox);
452
- } catch (error) {
453
- ctx.logger.error("vibecontrols_sandbox_start failed", { error });
454
- return errorResult(
455
- `Failed to start sandbox: ${error instanceof Error ? error.message : String(error)}`
456
- );
457
- }
458
- }
459
- );
460
- server.registerTool(
461
- track(mcpToolName(ctx.productName, "sandbox_extend")),
462
- {
463
- title: "Extend Sandbox TTL",
464
- description: "Extend the time-to-live of a sandbox.",
465
- inputSchema: {
466
- id: zod.z.string().describe("Sandbox ID"),
467
- additionalSeconds: zod.z.number().describe("Number of seconds to add to the TTL")
468
- }
469
- },
470
- async ({ id, additionalSeconds }) => {
471
- try {
472
- const data = await ctx.gql.workspace.request(
473
- EXTEND_SANDBOX_TTL,
474
- {
475
- id,
476
- additionalSeconds
477
- }
478
- );
479
- return jsonResult(data.extendSandboxTTL);
480
- } catch (error) {
481
- ctx.logger.error("vibecontrols_sandbox_extend failed", { error });
482
- return errorResult(
483
- `Failed to extend sandbox TTL: ${error instanceof Error ? error.message : String(error)}`
484
- );
485
- }
486
- }
487
- );
488
- server.registerTool(
489
- track(mcpToolName(ctx.productName, "sandbox_templates_list")),
490
- {
491
- title: "List Sandbox Templates",
492
- description: "List sandbox template configurations available in this workspace.",
493
- inputSchema: {
494
- template: zod.z.string().optional().describe("Filter by template kind"),
495
- limit: zod.z.number().optional(),
496
- offset: zod.z.number().optional()
497
- }
498
- },
499
- async ({ template, limit, offset }) => {
500
- try {
501
- const pagination = {};
502
- if (limit !== void 0) pagination.limit = limit;
503
- if (offset !== void 0) pagination.offset = offset;
504
- const data = await ctx.gql.workspace.request(
505
- LIST_SANDBOX_TEMPLATES,
506
- {
507
- template,
508
- pagination: Object.keys(pagination).length > 0 ? pagination : void 0
509
- }
510
- );
511
- return jsonResult(data.listSandboxTemplates);
512
- } catch (error) {
513
- ctx.logger.error("sandbox_templates_list failed", { error });
514
- return errorResult(
515
- `Failed to list templates: ${error instanceof Error ? error.message : String(error)}`
516
- );
517
- }
518
- }
519
- );
520
- server.registerTool(
521
- track(mcpToolName(ctx.productName, "sandbox_templates_get")),
522
- {
523
- title: "Get Sandbox Template",
524
- description: "Get a sandbox template by ID.",
525
- inputSchema: { id: zod.z.string().describe("Template ID") }
526
- },
527
- async ({ id }) => {
528
- try {
529
- const data = await ctx.gql.workspace.request(
530
- GET_SANDBOX_TEMPLATE,
531
- { id }
532
- );
533
- return jsonResult(data.getSandboxTemplate);
534
- } catch (error) {
535
- ctx.logger.error("sandbox_templates_get failed", { error });
536
- return errorResult(
537
- `Failed to get template: ${error instanceof Error ? error.message : String(error)}`
538
- );
539
- }
540
- }
541
- );
542
- server.registerTool(
543
- track(mcpToolName(ctx.productName, "sandbox_templates_create")),
544
- {
545
- title: "Create Sandbox Template",
546
- description: "Create a new sandbox template configuration.",
547
- inputSchema: {
548
- name: zod.z.string(),
549
- template: zod.z.enum([
550
- "VIBECONTROLS",
551
- "AI_BUILDER",
552
- "WORKFLOW_MULTI_NODE",
553
- "MISC_SHELL",
554
- "CUSTOM",
555
- "DOCS_BUILDER"
556
- ]),
557
- description: zod.z.string().optional(),
558
- isDefault: zod.z.boolean().optional(),
559
- ttlSeconds: zod.z.number().optional()
560
- }
561
- },
562
- async ({ name, template, description, isDefault, ttlSeconds }) => {
563
- try {
564
- const input = { name, template };
565
- if (description !== void 0) input.description = description;
566
- if (isDefault !== void 0) input.isDefault = isDefault;
567
- if (ttlSeconds !== void 0) input.ttlSeconds = ttlSeconds;
568
- const data = await ctx.gql.workspace.request(
569
- CREATE_SANDBOX_TEMPLATE,
570
- { input }
571
- );
572
- return jsonResult(data.createSandboxTemplate);
573
- } catch (error) {
574
- ctx.logger.error("sandbox_templates_create failed", { error });
575
- return errorResult(
576
- `Failed to create template: ${error instanceof Error ? error.message : String(error)}`
577
- );
578
- }
579
- }
580
- );
581
- server.registerTool(
582
- track(mcpToolName(ctx.productName, "sandbox_templates_update")),
583
- {
584
- title: "Update Sandbox Template",
585
- description: "Update a sandbox template configuration.",
586
- inputSchema: {
587
- id: zod.z.string(),
588
- name: zod.z.string().optional(),
589
- description: zod.z.string().optional(),
590
- isDefault: zod.z.boolean().optional(),
591
- ttlSeconds: zod.z.number().optional()
592
- }
593
- },
594
- async ({ id, name, description, isDefault, ttlSeconds }) => {
595
- try {
596
- const input = { id };
597
- if (name !== void 0) input.name = name;
598
- if (description !== void 0) input.description = description;
599
- if (isDefault !== void 0) input.isDefault = isDefault;
600
- if (ttlSeconds !== void 0) input.ttlSeconds = ttlSeconds;
601
- const data = await ctx.gql.workspace.request(
602
- UPDATE_SANDBOX_TEMPLATE,
603
- { input }
604
- );
605
- return jsonResult(data.updateSandboxTemplate);
606
- } catch (error) {
607
- ctx.logger.error("sandbox_templates_update failed", { error });
608
- return errorResult(
609
- `Failed to update template: ${error instanceof Error ? error.message : String(error)}`
610
- );
611
- }
612
- }
613
- );
614
- server.registerTool(
615
- track(mcpToolName(ctx.productName, "sandbox_templates_delete")),
616
- {
617
- title: "Delete Sandbox Template",
618
- description: "Delete a sandbox template configuration.",
619
- inputSchema: { id: zod.z.string() }
620
- },
621
- async ({ id }) => {
622
- try {
623
- const data = await ctx.gql.workspace.request(
624
- DELETE_SANDBOX_TEMPLATE,
625
- { id }
626
- );
627
- return jsonResult({ deleted: data.deleteSandboxTemplate, templateId: id });
628
- } catch (error) {
629
- ctx.logger.error("sandbox_templates_delete failed", { error });
630
- return errorResult(
631
- `Failed to delete template: ${error instanceof Error ? error.message : String(error)}`
632
- );
633
- }
634
- }
635
- );
636
- server.registerTool(
637
- track(mcpToolName(ctx.productName, "sandbox_tags_list")),
638
- {
639
- title: "List Available Sandbox Tags",
640
- description: "List available sandbox tags in the workspace.",
641
- inputSchema: {
642
- query: zod.z.string().optional(),
643
- limit: zod.z.number().optional()
644
- }
645
- },
646
- async ({ query, limit }) => {
647
- try {
648
- const data = await ctx.gql.workspace.request(
649
- AVAILABLE_SANDBOX_TAGS,
650
- { query, limit }
651
- );
652
- return jsonResult(data.availableSandboxTags);
653
- } catch (error) {
654
- ctx.logger.error("sandbox_tags_list failed", { error });
655
- return errorResult(
656
- `Failed to list tags: ${error instanceof Error ? error.message : String(error)}`
657
- );
658
- }
659
- }
660
- );
661
- server.registerTool(
662
- track(mcpToolName(ctx.productName, "sandbox_tags_get")),
663
- {
664
- title: "Get Sandbox Tags",
665
- description: "Get tag assignments for a sandbox.",
666
- inputSchema: { sandboxId: zod.z.string() }
667
- },
668
- async ({ sandboxId }) => {
669
- try {
670
- const data = await ctx.gql.workspace.request(
671
- GET_SANDBOX_TAGS,
672
- { input: { sandboxId } }
673
- );
674
- return jsonResult(data.getSandboxTags);
675
- } catch (error) {
676
- ctx.logger.error("sandbox_tags_get failed", { error });
677
- return errorResult(
678
- `Failed to get tags: ${error instanceof Error ? error.message : String(error)}`
679
- );
680
- }
681
- }
682
- );
683
- server.registerTool(
684
- track(mcpToolName(ctx.productName, "sandbox_tags_create")),
685
- {
686
- title: "Create Sandbox Tag",
687
- description: "Create a new sandbox tag.",
688
- inputSchema: {
689
- label: zod.z.string(),
690
- color: zod.z.string().optional()
691
- }
692
- },
693
- async ({ label, color }) => {
694
- try {
695
- const input = { label };
696
- if (color !== void 0) input.color = color;
697
- const data = await ctx.gql.workspace.request(
698
- CREATE_SANDBOX_TAG,
699
- { input }
700
- );
701
- return jsonResult(data.createSandboxTag);
702
- } catch (error) {
703
- ctx.logger.error("sandbox_tags_create failed", { error });
704
- return errorResult(
705
- `Failed to create tag: ${error instanceof Error ? error.message : String(error)}`
706
- );
707
- }
708
- }
709
- );
710
- server.registerTool(
711
- track(mcpToolName(ctx.productName, "sandbox_tags_attach")),
712
- {
713
- title: "Attach Tag to Sandbox",
714
- description: "Attach a tag to a sandbox.",
715
- inputSchema: {
716
- sandboxId: zod.z.string(),
717
- tagId: zod.z.string(),
718
- source: zod.z.string().optional()
719
- }
720
- },
721
- async ({ sandboxId, tagId, source }) => {
722
- try {
723
- const input = { sandboxId, tagId };
724
- if (source !== void 0) input.source = source;
725
- const data = await ctx.gql.workspace.request(TAG_SANDBOX, {
726
- input
727
- });
728
- return jsonResult(data.tagSandbox);
729
- } catch (error) {
730
- ctx.logger.error("sandbox_tags_attach failed", { error });
731
- return errorResult(
732
- `Failed to attach tag: ${error instanceof Error ? error.message : String(error)}`
733
- );
734
- }
735
- }
736
- );
737
- server.registerTool(
738
- track(mcpToolName(ctx.productName, "sandbox_tags_detach")),
739
- {
740
- title: "Detach Tag from Sandbox",
741
- description: "Detach a tag from a sandbox.",
742
- inputSchema: {
743
- sandboxId: zod.z.string(),
744
- tagId: zod.z.string()
745
- }
746
- },
747
- async ({ sandboxId, tagId }) => {
748
- try {
749
- const data = await ctx.gql.workspace.request(UNTAG_SANDBOX, {
750
- input: { sandboxId, tagId }
751
- });
752
- return jsonResult({ detached: data.untagSandbox, sandboxId, tagId });
753
- } catch (error) {
754
- ctx.logger.error("sandbox_tags_detach failed", { error });
755
- return errorResult(
756
- `Failed to detach tag: ${error instanceof Error ? error.message : String(error)}`
757
- );
758
- }
759
- }
760
- );
761
- server.registerTool(
762
- track(mcpToolName(ctx.productName, "sandbox_tags_replace")),
763
- {
764
- title: "Replace Sandbox Tags",
765
- description: "Replace the full set of tags on a sandbox.",
766
- inputSchema: {
767
- sandboxId: zod.z.string(),
768
- tagIds: zod.z.array(zod.z.string())
769
- }
770
- },
771
- async ({ sandboxId, tagIds }) => {
772
- try {
773
- const data = await ctx.gql.workspace.request(
774
- REPLACE_SANDBOX_TAGS,
775
- { input: { sandboxId, tagIds } }
776
- );
777
- return jsonResult(data.replaceSandboxTags);
778
- } catch (error) {
779
- ctx.logger.error("sandbox_tags_replace failed", { error });
780
- return errorResult(
781
- `Failed to replace tags: ${error instanceof Error ? error.message : String(error)}`
782
- );
783
- }
784
- }
785
- );
786
- server.registerTool(
787
- track(mcpToolName(ctx.productName, "sandbox_admin_list_all")),
788
- {
789
- title: "List All Sandboxes (admin)",
790
- description: "Admin-only list across the entire workspace including internal sandboxes.",
791
- inputSchema: {
792
- status: zod.z.string().optional(),
793
- template: zod.z.string().optional(),
794
- limit: zod.z.number().optional(),
795
- offset: zod.z.number().optional()
796
- }
797
- },
798
- async ({ status, template, limit, offset }) => {
799
- try {
800
- const filter = {};
801
- if (status !== void 0) filter.status = status;
802
- if (template !== void 0) filter.template = template;
803
- const pagination = {};
804
- if (limit !== void 0) pagination.limit = limit;
805
- if (offset !== void 0) pagination.offset = offset;
806
- const data = await ctx.gql.workspace.request(
807
- LIST_ALL_SANDBOXES,
808
- {
809
- filter: Object.keys(filter).length > 0 ? filter : void 0,
810
- pagination: Object.keys(pagination).length > 0 ? pagination : void 0
811
- }
812
- );
813
- return jsonResult(data.listAllSandboxes);
814
- } catch (error) {
815
- ctx.logger.error("sandbox_admin_list_all failed", { error });
816
- return errorResult(
817
- `Failed to list all sandboxes: ${error instanceof Error ? error.message : String(error)}`
818
- );
819
- }
820
- }
821
- );
48
+ function stubbedTool(server, toolName, title, description, featureNote, inputSchema, altSuggestions) {
822
49
  server.registerTool(
823
- track(mcpToolName(ctx.productName, "sandbox_admin_nodes_list")),
50
+ toolName,
824
51
  {
825
- title: "List Sandbox Nodes",
826
- description: "List Kubernetes nodes hosting sandbox workloads with capacity info.",
827
- inputSchema: {}
52
+ title,
53
+ description: `${description} [STUB]`,
54
+ inputSchema
828
55
  },
829
- async () => {
830
- try {
831
- const data = await ctx.gql.workspace.request(
832
- LIST_SANDBOX_NODES,
833
- {}
834
- );
835
- return jsonResult(data.listSandboxNodes);
836
- } catch (error) {
837
- ctx.logger.error("sandbox_admin_nodes_list failed", { error });
838
- return errorResult(
839
- `Failed to list nodes: ${error instanceof Error ? error.message : String(error)}`
840
- );
841
- }
842
- }
843
- );
844
- server.registerTool(
845
- track(mcpToolName(ctx.productName, "sandbox_admin_active")),
846
- {
847
- title: "Get Active Sandboxes",
848
- description: "Get currently active sandboxes in the workspace.",
849
- inputSchema: {}
850
- },
851
- async () => {
852
- try {
853
- const data = await ctx.gql.workspace.request(
854
- GET_ACTIVE_SANDBOXES,
855
- {}
856
- );
857
- return jsonResult(data.getActiveSandboxes);
858
- } catch (error) {
859
- ctx.logger.error("sandbox_admin_active failed", { error });
860
- return errorResult(
861
- `Failed to get active sandboxes: ${error instanceof Error ? error.message : String(error)}`
862
- );
863
- }
864
- }
865
- );
866
- server.registerTool(
867
- track(mcpToolName(ctx.productName, "sandbox_admin_activity")),
868
- {
869
- title: "Recent Sandbox Activity",
870
- description: "Get recent sandbox lifecycle activity (create/stop/delete/extend).",
871
- inputSchema: { limit: zod.z.number().optional() }
872
- },
873
- async ({ limit }) => {
874
- try {
875
- const data = await ctx.gql.workspace.request(
876
- GET_RECENT_SANDBOX_ACTIVITY,
877
- { limit }
878
- );
879
- return jsonResult(data.getRecentSandboxActivity);
880
- } catch (error) {
881
- ctx.logger.error("sandbox_admin_activity failed", { error });
882
- return errorResult(
883
- `Failed to get activity: ${error instanceof Error ? error.message : String(error)}`
884
- );
885
- }
886
- }
887
- );
888
- server.registerTool(
889
- track(mcpToolName(ctx.productName, "sandbox_admin_stats")),
890
- {
891
- title: "Sandbox Stats",
892
- description: "Get aggregate sandbox usage statistics for the workspace.",
893
- inputSchema: {}
894
- },
895
- async () => {
896
- try {
897
- const data = await ctx.gql.workspace.request(
898
- GET_SANDBOX_STATS,
899
- {}
900
- );
901
- return jsonResult(data.getSandboxStats);
902
- } catch (error) {
903
- ctx.logger.error("sandbox_admin_stats failed", { error });
904
- return errorResult(
905
- `Failed to get stats: ${error instanceof Error ? error.message : String(error)}`
906
- );
907
- }
908
- }
909
- );
910
- server.registerTool(
911
- track(mcpToolName(ctx.productName, "sandbox_admin_logs")),
912
- {
913
- title: "Get Sandbox Logs",
914
- description: "Fetch logs for a sandbox container.",
915
- inputSchema: {
916
- id: zod.z.string(),
917
- containerName: zod.z.string(),
918
- tailLines: zod.z.number().optional()
919
- }
920
- },
921
- async ({ id, containerName, tailLines }) => {
922
- try {
923
- const data = await ctx.gql.workspace.request(GET_SANDBOX_LOGS, {
924
- id,
925
- containerName,
926
- tailLines
927
- });
928
- return jsonResult({ logs: data.getSandboxLogs });
929
- } catch (error) {
930
- ctx.logger.error("sandbox_admin_logs failed", { error });
931
- return errorResult(
932
- `Failed to get logs: ${error instanceof Error ? error.message : String(error)}`
933
- );
934
- }
935
- }
936
- );
937
- server.registerTool(
938
- track(mcpToolName(ctx.productName, "sandbox_admin_config_get")),
939
- {
940
- title: "Get Sandbox Config",
941
- description: "Get the per-workspace sandbox configuration limits.",
942
- inputSchema: {}
943
- },
944
- async () => {
945
- try {
946
- const data = await ctx.gql.workspace.request(
947
- GET_SANDBOX_CONFIG,
948
- {}
949
- );
950
- return jsonResult(data.getSandboxConfig);
951
- } catch (error) {
952
- ctx.logger.error("sandbox_admin_config_get failed", { error });
953
- return errorResult(
954
- `Failed to get config: ${error instanceof Error ? error.message : String(error)}`
955
- );
956
- }
957
- }
958
- );
959
- server.registerTool(
960
- track(mcpToolName(ctx.productName, "sandbox_admin_config_set")),
961
- {
962
- title: "Update Sandbox Config",
963
- description: "Update the per-workspace sandbox configuration limits.",
964
- inputSchema: {
965
- defaultTtlSeconds: zod.z.number().optional(),
966
- maxTtlSeconds: zod.z.number().optional(),
967
- maxConcurrentPerUser: zod.z.number().optional(),
968
- maxConcurrentPerWorkspace: zod.z.number().optional()
969
- }
970
- },
971
- async ({
972
- defaultTtlSeconds,
973
- maxTtlSeconds,
974
- maxConcurrentPerUser,
975
- maxConcurrentPerWorkspace
976
- }) => {
977
- try {
978
- const input = {};
979
- if (defaultTtlSeconds !== void 0) input.defaultTtlSeconds = defaultTtlSeconds;
980
- if (maxTtlSeconds !== void 0) input.maxTtlSeconds = maxTtlSeconds;
981
- if (maxConcurrentPerUser !== void 0) input.maxConcurrentPerUser = maxConcurrentPerUser;
982
- if (maxConcurrentPerWorkspace !== void 0)
983
- input.maxConcurrentPerWorkspace = maxConcurrentPerWorkspace;
984
- const data = await ctx.gql.workspace.request(
985
- UPDATE_SANDBOX_CONFIG,
986
- { input }
987
- );
988
- return jsonResult(data.updateSandboxConfig);
989
- } catch (error) {
990
- ctx.logger.error("sandbox_admin_config_set failed", { error });
991
- return errorResult(
992
- `Failed to update config: ${error instanceof Error ? error.message : String(error)}`
993
- );
994
- }
995
- }
996
- );
997
- server.registerTool(
998
- track(mcpToolName(ctx.productName, "sandbox_export_create")),
999
- {
1000
- title: "Create Sandbox Export Job",
1001
- description: "Kick off an async job to export sandboxes for the workspace.",
1002
- inputSchema: {
1003
- workspaceId: zod.z.string(),
1004
- format: zod.z.enum(["CSV", "JSON"]),
1005
- includeUsageEvents: zod.z.boolean().optional()
1006
- }
1007
- },
1008
- async ({ workspaceId, format, includeUsageEvents }) => {
1009
- try {
1010
- const input = { workspaceId, format };
1011
- if (includeUsageEvents !== void 0) input.includeUsageEvents = includeUsageEvents;
1012
- const data = await ctx.gql.workspace.request(
1013
- EXPORT_SANDBOXES,
1014
- { input }
1015
- );
1016
- return jsonResult(data.exportSandboxes);
1017
- } catch (error) {
1018
- ctx.logger.error("sandbox_export_create failed", { error });
1019
- return errorResult(
1020
- `Failed to create export: ${error instanceof Error ? error.message : String(error)}`
1021
- );
1022
- }
1023
- }
1024
- );
1025
- server.registerTool(
1026
- track(mcpToolName(ctx.productName, "sandbox_export_get")),
1027
- {
1028
- title: "Get Sandbox Export Job",
1029
- description: "Get a sandbox export job by ID. Poll this to track progress (MCP has no subscriptions).",
1030
- inputSchema: {
1031
- workspaceId: zod.z.string(),
1032
- jobId: zod.z.string()
1033
- }
1034
- },
1035
- async ({ workspaceId, jobId }) => {
1036
- try {
1037
- const data = await ctx.gql.workspace.request(
1038
- GET_SANDBOX_EXPORT_JOB,
1039
- { workspaceId, jobId }
1040
- );
1041
- return jsonResult(data.getSandboxExportJob);
1042
- } catch (error) {
1043
- ctx.logger.error("sandbox_export_get failed", { error });
1044
- return errorResult(
1045
- `Failed to get export job: ${error instanceof Error ? error.message : String(error)}`
1046
- );
1047
- }
1048
- }
1049
- );
1050
- server.registerTool(
1051
- track(mcpToolName(ctx.productName, "sandbox_export_list")),
1052
- {
1053
- title: "List Sandbox Export Jobs",
1054
- description: "List sandbox export jobs for a workspace.",
1055
- inputSchema: {
1056
- workspaceId: zod.z.string(),
1057
- limit: zod.z.number().optional(),
1058
- offset: zod.z.number().optional()
1059
- }
1060
- },
1061
- async ({ workspaceId, limit, offset }) => {
1062
- try {
1063
- const pagination = {};
1064
- if (limit !== void 0) pagination.limit = limit;
1065
- if (offset !== void 0) pagination.offset = offset;
1066
- const data = await ctx.gql.workspace.request(
1067
- LIST_SANDBOX_EXPORT_JOBS,
1068
- {
1069
- workspaceId,
1070
- pagination: Object.keys(pagination).length > 0 ? pagination : void 0
1071
- }
1072
- );
1073
- return jsonResult(data.listSandboxExportJobs);
1074
- } catch (error) {
1075
- ctx.logger.error("sandbox_export_list failed", { error });
1076
- return errorResult(
1077
- `Failed to list export jobs: ${error instanceof Error ? error.message : String(error)}`
1078
- );
1079
- }
1080
- }
1081
- );
1082
- server.registerTool(
1083
- track(mcpToolName(ctx.productName, "sandbox_export_get_artifact_bytes")),
1084
- {
1085
- title: "Get Sandbox Artifact Bytes",
1086
- description: "Fetch raw artifact bytes for a sandbox session (base64-encoded, 50 MB cap).",
1087
- inputSchema: {
1088
- sandboxId: zod.z.string(),
1089
- sessionId: zod.z.string(),
1090
- path: zod.z.string(),
1091
- onBehalfOfUserId: zod.z.string().optional()
1092
- }
1093
- },
1094
- async ({ sandboxId, sessionId, path, onBehalfOfUserId }) => {
1095
- try {
1096
- const input = { sandboxId, sessionId, path };
1097
- if (onBehalfOfUserId !== void 0) input.onBehalfOfUserId = onBehalfOfUserId;
1098
- const data = await ctx.gql.workspace.request(
1099
- GET_SANDBOX_ARTIFACT_BYTES,
1100
- { input }
1101
- );
1102
- return jsonResult(data.getSandboxArtifactBytes);
1103
- } catch (error) {
1104
- ctx.logger.error("sandbox_export_get_artifact_bytes failed", { error });
1105
- return errorResult(
1106
- `Failed to get artifact bytes: ${error instanceof Error ? error.message : String(error)}`
1107
- );
1108
- }
1109
- }
1110
- );
1111
- server.registerTool(
1112
- track(mcpToolName(ctx.productName, "sandbox_proxy_request")),
1113
- {
1114
- title: "Proxy HTTP Request to Sandbox",
1115
- description: "Proxy an HTTP request to a service running inside a sandbox container.",
1116
- inputSchema: {
1117
- sandboxId: zod.z.string(),
1118
- method: zod.z.string(),
1119
- path: zod.z.string(),
1120
- body: zod.z.unknown().optional(),
1121
- containerName: zod.z.string().optional()
1122
- }
1123
- },
1124
- async ({ sandboxId, method, path, body, containerName }) => {
1125
- try {
1126
- const input = { sandboxId, method, path };
1127
- if (body !== void 0) input.body = body;
1128
- if (containerName !== void 0) input.containerName = containerName;
1129
- const data = await ctx.gql.workspace.request(
1130
- PROXY_SANDBOX_REQUEST,
1131
- { input }
1132
- );
1133
- return jsonResult(data.proxySandboxRequest);
1134
- } catch (error) {
1135
- ctx.logger.error("sandbox_proxy_request failed", { error });
1136
- return errorResult(
1137
- `Failed to proxy request: ${error instanceof Error ? error.message : String(error)}`
1138
- );
1139
- }
1140
- }
1141
- );
1142
- server.registerTool(
1143
- track(mcpToolName(ctx.productName, "sandbox_check")),
1144
- {
1145
- title: "Check Sandbox State",
1146
- description: "Poll a sandbox by ID. MCP has no subscription protocol \u2014 call this in a loop to track lifecycle.",
1147
- inputSchema: { id: zod.z.string() }
1148
- },
1149
- async ({ id }) => {
1150
- try {
1151
- const data = await ctx.gql.workspace.request(GET_SANDBOX, { id });
1152
- return jsonResult(data.getSandbox);
1153
- } catch (error) {
1154
- ctx.logger.error("sandbox_check failed", { error });
1155
- return errorResult(
1156
- `Failed to poll sandbox: ${error instanceof Error ? error.message : String(error)}`
1157
- );
1158
- }
1159
- }
1160
- );
1161
- server.registerTool(
1162
- track(mcpToolName(ctx.productName, "sandbox_export_check")),
1163
- {
1164
- title: "Check Sandbox Export Job",
1165
- description: "Poll an export job by ID. MCP has no subscription protocol \u2014 call this in a loop to track progress.",
1166
- inputSchema: {
1167
- workspaceId: zod.z.string(),
1168
- jobId: zod.z.string()
1169
- }
1170
- },
1171
- async ({ workspaceId, jobId }) => {
1172
- try {
1173
- const data = await ctx.gql.workspace.request(
1174
- GET_SANDBOX_EXPORT_JOB,
1175
- { workspaceId, jobId }
1176
- );
1177
- return jsonResult(data.getSandboxExportJob);
1178
- } catch (error) {
1179
- ctx.logger.error("sandbox_export_check failed", { error });
1180
- return errorResult(
1181
- `Failed to poll export job: ${error instanceof Error ? error.message : String(error)}`
1182
- );
1183
- }
1184
- }
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
+ )
1185
59
  );
1186
60
  }
61
+ function registerSandboxTools(server, ctx, track) {
62
+ const featureNote = "Live alpha requires `$context: ContextInput!` on every sandbox call (33 tools), and `Query.sandboxes` is gone from the gateway. The MCP never supplied the `$context` arg.";
63
+ const alts = [
64
+ "the next alpha release that derives the sandbox context from the workspace token",
65
+ "the SDK sandbox API (which the MCP will mirror once it lands)"
66
+ ];
67
+ const tools = [
68
+ ["sandbox_list", "List Sandboxes", "List sandboxes in the active workspace."],
69
+ ["sandbox_get", "Get Sandbox", "Get a sandbox by ID."],
70
+ ["sandbox_create", "Create Sandbox", "Create a new sandbox."],
71
+ ["sandbox_delete", "Delete Sandbox", "Delete a sandbox."],
72
+ ["sandbox_start", "Start Sandbox", "Start a sandbox."],
73
+ ["sandbox_stop", "Stop Sandbox", "Stop a sandbox."],
74
+ ["sandbox_extend", "Extend Sandbox TTL", "Extend a sandbox's TTL."],
75
+ ["sandbox_check", "Check Sandbox Health", "Run a health check on a sandbox."],
76
+ ["sandbox_export_create", "Create Sandbox Export", "Create a sandbox export job."],
77
+ ["sandbox_export_check", "Check Export Job", "Check the status of a sandbox export."],
78
+ ["sandbox_export_get", "Get Sandbox Export", "Get details of a sandbox export job."],
79
+ ["sandbox_export_list", "List Sandbox Exports", "List sandbox export jobs."],
80
+ [
81
+ "sandbox_export_get_artifact_bytes",
82
+ "Get Export Artifact Bytes",
83
+ "Fetch bytes of a sandbox export artifact."
84
+ ],
85
+ ["sandbox_templates_list", "List Sandbox Templates", "List sandbox templates."],
86
+ ["sandbox_templates_get", "Get Sandbox Template", "Get a sandbox template by ID."],
87
+ ["sandbox_templates_create", "Create Sandbox Template", "Create a new sandbox template."],
88
+ ["sandbox_templates_update", "Update Sandbox Template", "Update a sandbox template."],
89
+ ["sandbox_templates_delete", "Delete Sandbox Template", "Delete a sandbox template."],
90
+ ["sandbox_tags_list", "List Sandbox Tags", "List tags on a sandbox."],
91
+ ["sandbox_tags_get", "Get Sandbox Tag", "Get a sandbox tag."],
92
+ ["sandbox_tags_create", "Create Sandbox Tag", "Create a tag on a sandbox."],
93
+ ["sandbox_tags_attach", "Attach Tag to Sandbox", "Attach an existing tag to a sandbox."],
94
+ ["sandbox_tags_detach", "Detach Tag from Sandbox", "Detach a tag from a sandbox."],
95
+ ["sandbox_tags_replace", "Replace Sandbox Tags", "Replace the tag set on a sandbox."],
96
+ [
97
+ "sandbox_admin_list_all",
98
+ "List All Sandboxes (Admin)",
99
+ "List all sandboxes across workspaces (admin)."
100
+ ],
101
+ ["sandbox_admin_nodes_list", "List Sandbox Nodes (Admin)", "List sandbox node fleet (admin)."],
102
+ ["sandbox_admin_active", "List Active Sandboxes (Admin)", "List active sandboxes (admin)."],
103
+ [
104
+ "sandbox_admin_activity",
105
+ "List Recent Sandbox Activity (Admin)",
106
+ "Recent activity across sandboxes (admin)."
107
+ ],
108
+ ["sandbox_admin_stats", "Sandbox Fleet Stats (Admin)", "Aggregate sandbox fleet stats."],
109
+ ["sandbox_admin_logs", "Sandbox Fleet Logs (Admin)", "Sandbox fleet logs (admin)."],
110
+ ["sandbox_admin_config_get", "Get Sandbox Config (Admin)", "Read sandbox module config."],
111
+ ["sandbox_admin_config_set", "Update Sandbox Config (Admin)", "Update sandbox module config."],
112
+ [
113
+ "sandbox_export_workspace_list",
114
+ "List Sandbox Exports (Workspace)",
115
+ "List sandbox exports in the active workspace."
116
+ ],
117
+ ["sandbox_proxy_request", "Proxy Sandbox Request", "Proxy a request into a running sandbox."]
118
+ ];
119
+ for (const [tool, title, desc] of tools) {
120
+ stubbedTool(
121
+ server,
122
+ track(mcpToolName(ctx.productName, tool)),
123
+ title,
124
+ desc,
125
+ featureNote,
126
+ {},
127
+ alts
128
+ );
129
+ }
130
+ }
1187
131
 
1188
132
  // src/modules/sandbox/index.ts
1189
133
  var sandboxModule = {