@burdenoff/mcp-libs 2026.523.1 → 2026.529.1
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/chunk-HRWIDQJE.js +1771 -0
- package/dist/chunk-HRWIDQJE.js.map +1 -0
- package/dist/modules/conversations/index.cjs +1174 -0
- package/dist/modules/conversations/index.cjs.map +1 -1
- package/dist/modules/conversations/index.js +1174 -0
- package/dist/modules/conversations/index.js.map +1 -1
- package/dist/modules/export/index.cjs +348 -0
- package/dist/modules/export/index.cjs.map +1 -1
- package/dist/modules/export/index.js +348 -0
- package/dist/modules/export/index.js.map +1 -1
- package/dist/modules/integrations/index.cjs +539 -0
- package/dist/modules/integrations/index.cjs.map +1 -1
- package/dist/modules/integrations/index.js +539 -0
- package/dist/modules/integrations/index.js.map +1 -1
- package/dist/modules/sandbox/index.cjs +864 -0
- package/dist/modules/sandbox/index.cjs.map +1 -1
- package/dist/modules/sandbox/index.js +699 -1
- package/dist/modules/sandbox/index.js.map +1 -1
- package/dist/modules/scheduler/index.cjs +736 -0
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +736 -0
- package/dist/modules/scheduler/index.js.map +1 -1
- package/dist/modules/vibecontrols/index.cjs +4230 -477
- package/dist/modules/vibecontrols/index.cjs.map +1 -1
- package/dist/modules/vibecontrols/index.js +3424 -401
- package/dist/modules/vibecontrols/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-N2CZNPYC.js +0 -875
- package/dist/chunk-N2CZNPYC.js.map +0 -1
|
@@ -60,6 +60,171 @@ var RETRY_JOB_EXECUTION = `
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
`;
|
|
63
|
+
var PAUSE_JOB = `
|
|
64
|
+
mutation PauseScheduledJob($id: ID!) {
|
|
65
|
+
pauseScheduledJob(id: $id) { id name status }
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
var RESUME_JOB = `
|
|
69
|
+
mutation ResumeScheduledJob($id: ID!) {
|
|
70
|
+
resumeScheduledJob(id: $id) { id name status }
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
var ACTIVATE_SCHEDULE = `
|
|
74
|
+
mutation ActivateSchedule($id: ID!) {
|
|
75
|
+
activateSchedule(id: $id) { id name status }
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
var ARCHIVE_SCHEDULE = `
|
|
79
|
+
mutation ArchiveSchedule($id: ID!) {
|
|
80
|
+
archiveSchedule(id: $id) { id name status }
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
var DISABLE_SCHEDULE = `
|
|
84
|
+
mutation DisableSchedule($id: ID!, $reason: String) {
|
|
85
|
+
disableSchedule(id: $id, reason: $reason) { id name status }
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
var CLONE_SCHEDULE = `
|
|
89
|
+
mutation CloneSchedule($sourceId: ID!, $newWorkspaceId: ID, $overrides: CreateScheduledJobInput) {
|
|
90
|
+
cloneSchedule(sourceId: $sourceId, newWorkspaceId: $newWorkspaceId, overrides: $overrides) {
|
|
91
|
+
id name status
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
var EXECUTE_JOB_NOW = `
|
|
96
|
+
mutation ExecuteJobNow($id: ID!) {
|
|
97
|
+
executeJobNow(id: $id) { id scheduledJobId status }
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
var PREVIEW_SCHEDULE = `
|
|
101
|
+
query PreviewSchedule(
|
|
102
|
+
$scheduleType: ScheduleType!
|
|
103
|
+
$cronExpression: String
|
|
104
|
+
$rrule: String
|
|
105
|
+
$interval: Int
|
|
106
|
+
$intervalUnit: String
|
|
107
|
+
$count: Int
|
|
108
|
+
$startDate: DateTime
|
|
109
|
+
$endDate: DateTime
|
|
110
|
+
$timezone: String
|
|
111
|
+
) {
|
|
112
|
+
previewSchedule(
|
|
113
|
+
scheduleType: $scheduleType
|
|
114
|
+
cronExpression: $cronExpression
|
|
115
|
+
rrule: $rrule
|
|
116
|
+
interval: $interval
|
|
117
|
+
intervalUnit: $intervalUnit
|
|
118
|
+
count: $count
|
|
119
|
+
startDate: $startDate
|
|
120
|
+
endDate: $endDate
|
|
121
|
+
timezone: $timezone
|
|
122
|
+
) {
|
|
123
|
+
count startDate endDate nextExecutions
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
var LIST_SCHEDULE_TEMPLATES = `
|
|
128
|
+
query ScheduleTemplates(
|
|
129
|
+
$workspaceId: ID!
|
|
130
|
+
$filter: ScheduleTemplateFilterInput
|
|
131
|
+
$pagination: SchedulerPaginationInput
|
|
132
|
+
) {
|
|
133
|
+
scheduleTemplates(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
134
|
+
templates { id name category isPublic scheduleType executorType usageCount }
|
|
135
|
+
total nextCursor
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`;
|
|
139
|
+
var LIST_PUBLIC_SCHEDULE_TEMPLATES = `
|
|
140
|
+
query PublicScheduleTemplates(
|
|
141
|
+
$filter: ScheduleTemplateFilterInput
|
|
142
|
+
$pagination: SchedulerPaginationInput
|
|
143
|
+
) {
|
|
144
|
+
publicScheduleTemplates(filter: $filter, pagination: $pagination) {
|
|
145
|
+
templates { id name category isPublic scheduleType executorType usageCount }
|
|
146
|
+
total nextCursor
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
var GET_SCHEDULE_TEMPLATE = `
|
|
151
|
+
query ScheduleTemplate($id: ID!) {
|
|
152
|
+
scheduleTemplate(id: $id) {
|
|
153
|
+
id name description category isPublic scheduleType executorType
|
|
154
|
+
scheduleConfig executorConfig usageCount
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
var CREATE_SCHEDULE_TEMPLATE = `
|
|
159
|
+
mutation CreateScheduleTemplate($input: CreateScheduleTemplateInput!, $workspaceId: ID!) {
|
|
160
|
+
createScheduleTemplate(input: $input, workspaceId: $workspaceId) { id name scheduleType }
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
var UPDATE_SCHEDULE_TEMPLATE = `
|
|
164
|
+
mutation UpdateScheduleTemplate($id: ID!, $input: UpdateScheduleTemplateInput!) {
|
|
165
|
+
updateScheduleTemplate(id: $id, input: $input) { id name }
|
|
166
|
+
}
|
|
167
|
+
`;
|
|
168
|
+
var DELETE_SCHEDULE_TEMPLATE = `
|
|
169
|
+
mutation DeleteScheduleTemplate($id: ID!) { deleteScheduleTemplate(id: $id) }
|
|
170
|
+
`;
|
|
171
|
+
var CREATE_SCHEDULE_FROM_TEMPLATE = `
|
|
172
|
+
mutation CreateScheduleFromTemplate(
|
|
173
|
+
$templateId: ID!
|
|
174
|
+
$workspaceId: ID!
|
|
175
|
+
$overrides: CreateScheduledJobInput
|
|
176
|
+
) {
|
|
177
|
+
createScheduleFromTemplate(templateId: $templateId, workspaceId: $workspaceId, overrides: $overrides) {
|
|
178
|
+
id name status
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
var SCHEDULE_VERSION_HISTORY = `
|
|
183
|
+
query ScheduleVersionHistory($scheduleId: ID!) {
|
|
184
|
+
scheduleVersionHistory(scheduleId: $scheduleId) {
|
|
185
|
+
id scheduleId version changedBy changedFields changeReason createdAt
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
var RESTORE_SCHEDULE_VERSION = `
|
|
190
|
+
mutation RestoreScheduleVersion($scheduleId: ID!, $versionId: ID!) {
|
|
191
|
+
restoreScheduleVersion(scheduleId: $scheduleId, versionId: $versionId) { id name version }
|
|
192
|
+
}
|
|
193
|
+
`;
|
|
194
|
+
var TAG_SCHEDULED_JOB = `
|
|
195
|
+
mutation TagScheduledJob($input: TagScheduledJobInput!) {
|
|
196
|
+
tagScheduledJob(input: $input) { id entityId tagId source }
|
|
197
|
+
}
|
|
198
|
+
`;
|
|
199
|
+
var UNTAG_SCHEDULED_JOB = `
|
|
200
|
+
mutation UntagScheduledJob($input: UntagScheduledJobInput!) {
|
|
201
|
+
untagScheduledJob(input: $input)
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
204
|
+
var REPLACE_SCHEDULED_JOB_TAGS = `
|
|
205
|
+
mutation ReplaceScheduledJobTags($input: ReplaceScheduledJobTagsInput!) {
|
|
206
|
+
replaceScheduledJobTags(input: $input) { id entityId tagId source }
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
209
|
+
var GET_SCHEDULED_JOB_TAGS = `
|
|
210
|
+
query GetScheduledJobTags($input: GetScheduledJobTagsInput!) {
|
|
211
|
+
getScheduledJobTags(input: $input) { id entityId tagId source }
|
|
212
|
+
}
|
|
213
|
+
`;
|
|
214
|
+
var EXECUTION_UPDATED_POLL = `
|
|
215
|
+
query ExecutionUpdatedPoll($id: ID!) {
|
|
216
|
+
jobExecution(id: $id) {
|
|
217
|
+
id scheduleId status attemptNumber startedAt completedAt errorMessage success
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
`;
|
|
221
|
+
var JOB_STATUS_UPDATED_POLL = `
|
|
222
|
+
query JobStatusUpdatedPoll($id: ID!) {
|
|
223
|
+
scheduledJob(id: $id) {
|
|
224
|
+
id name status nextExecutionAt lastExecutionAt updatedAt
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
63
228
|
|
|
64
229
|
// src/modules/scheduler/tools.ts
|
|
65
230
|
function readWorkspaceId(ctx) {
|
|
@@ -294,6 +459,577 @@ function registerSchedulerTools(server, ctx, track) {
|
|
|
294
459
|
}
|
|
295
460
|
}
|
|
296
461
|
);
|
|
462
|
+
for (const [tool, op, title, desc, mutationField] of [
|
|
463
|
+
[
|
|
464
|
+
"scheduler_jobs_pause",
|
|
465
|
+
PAUSE_JOB,
|
|
466
|
+
"Pause Scheduled Job",
|
|
467
|
+
"Pause a scheduled job.",
|
|
468
|
+
"pauseScheduledJob"
|
|
469
|
+
],
|
|
470
|
+
[
|
|
471
|
+
"scheduler_jobs_resume",
|
|
472
|
+
RESUME_JOB,
|
|
473
|
+
"Resume Scheduled Job",
|
|
474
|
+
"Resume a paused scheduled job.",
|
|
475
|
+
"resumeScheduledJob"
|
|
476
|
+
],
|
|
477
|
+
[
|
|
478
|
+
"scheduler_jobs_activate",
|
|
479
|
+
ACTIVATE_SCHEDULE,
|
|
480
|
+
"Activate Schedule",
|
|
481
|
+
"Activate a draft or disabled schedule.",
|
|
482
|
+
"activateSchedule"
|
|
483
|
+
],
|
|
484
|
+
[
|
|
485
|
+
"scheduler_jobs_archive",
|
|
486
|
+
ARCHIVE_SCHEDULE,
|
|
487
|
+
"Archive Schedule",
|
|
488
|
+
"Archive a scheduled job (soft delete).",
|
|
489
|
+
"archiveSchedule"
|
|
490
|
+
]
|
|
491
|
+
]) {
|
|
492
|
+
server.registerTool(
|
|
493
|
+
track(mcpToolName(ctx.productName, tool)),
|
|
494
|
+
{
|
|
495
|
+
title,
|
|
496
|
+
description: desc,
|
|
497
|
+
inputSchema: { id: z.string().describe("Schedule ID") }
|
|
498
|
+
},
|
|
499
|
+
async ({ id }) => {
|
|
500
|
+
try {
|
|
501
|
+
const data = await ctx.gql.workspace.request(op, { id });
|
|
502
|
+
return jsonResult(data[mutationField]);
|
|
503
|
+
} catch (error) {
|
|
504
|
+
ctx.logger.error(`${tool} failed`, { error: String(error) });
|
|
505
|
+
return errorResult(
|
|
506
|
+
`${title} failed: ${error instanceof Error ? error.message : String(error)}`
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
server.registerTool(
|
|
513
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_disable")),
|
|
514
|
+
{
|
|
515
|
+
title: "Disable Schedule",
|
|
516
|
+
description: "Disable a schedule with an optional reason.",
|
|
517
|
+
inputSchema: {
|
|
518
|
+
id: z.string().describe("Schedule ID"),
|
|
519
|
+
reason: z.string().optional().describe("Disable reason (audit trail)")
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
async ({ id, reason }) => {
|
|
523
|
+
try {
|
|
524
|
+
const data = await ctx.gql.workspace.request(
|
|
525
|
+
DISABLE_SCHEDULE,
|
|
526
|
+
{ id, reason: reason ?? null }
|
|
527
|
+
);
|
|
528
|
+
return jsonResult(data.disableSchedule);
|
|
529
|
+
} catch (error) {
|
|
530
|
+
ctx.logger.error("scheduler_jobs_disable failed", { error: String(error) });
|
|
531
|
+
return errorResult(
|
|
532
|
+
`Failed to disable: ${error instanceof Error ? error.message : String(error)}`
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
server.registerTool(
|
|
538
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_clone")),
|
|
539
|
+
{
|
|
540
|
+
title: "Clone Schedule",
|
|
541
|
+
description: "Clone an existing schedule. Optionally move to another workspace and supply override fields.",
|
|
542
|
+
inputSchema: {
|
|
543
|
+
sourceId: z.string().describe("Source schedule ID"),
|
|
544
|
+
newWorkspaceId: z.string().optional().describe("Target workspace (defaults to source)"),
|
|
545
|
+
overrides: z.record(z.string(), z.unknown()).optional().describe("CreateScheduledJobInput overrides")
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
async ({ sourceId, newWorkspaceId, overrides }) => {
|
|
549
|
+
try {
|
|
550
|
+
const data = await ctx.gql.workspace.request(
|
|
551
|
+
CLONE_SCHEDULE,
|
|
552
|
+
{ sourceId, newWorkspaceId: newWorkspaceId ?? null, overrides: overrides ?? null }
|
|
553
|
+
);
|
|
554
|
+
return jsonResult(data.cloneSchedule);
|
|
555
|
+
} catch (error) {
|
|
556
|
+
ctx.logger.error("scheduler_jobs_clone failed", { error: String(error) });
|
|
557
|
+
return errorResult(
|
|
558
|
+
`Failed to clone: ${error instanceof Error ? error.message : String(error)}`
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
server.registerTool(
|
|
564
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_execute_now")),
|
|
565
|
+
{
|
|
566
|
+
title: "Execute Job Now",
|
|
567
|
+
description: "Trigger a scheduled job to execute immediately (out-of-band).",
|
|
568
|
+
inputSchema: { id: z.string().describe("Schedule ID") }
|
|
569
|
+
},
|
|
570
|
+
async ({ id }) => {
|
|
571
|
+
try {
|
|
572
|
+
const data = await ctx.gql.workspace.request(
|
|
573
|
+
EXECUTE_JOB_NOW,
|
|
574
|
+
{ id }
|
|
575
|
+
);
|
|
576
|
+
return jsonResult(data.executeJobNow);
|
|
577
|
+
} catch (error) {
|
|
578
|
+
ctx.logger.error("scheduler_jobs_execute_now failed", { error: String(error) });
|
|
579
|
+
return errorResult(
|
|
580
|
+
`Failed to execute: ${error instanceof Error ? error.message : String(error)}`
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
);
|
|
585
|
+
server.registerTool(
|
|
586
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_preview")),
|
|
587
|
+
{
|
|
588
|
+
title: "Preview Schedule",
|
|
589
|
+
description: "Compute upcoming execution times for a schedule definition without creating it.",
|
|
590
|
+
inputSchema: {
|
|
591
|
+
scheduleType: z.string().describe("CRON | FIXED_INTERVAL | ONE_TIME | RRULE | WINDOWED"),
|
|
592
|
+
cronExpression: z.string().optional(),
|
|
593
|
+
rrule: z.string().optional(),
|
|
594
|
+
interval: z.number().int().optional(),
|
|
595
|
+
intervalUnit: z.string().optional(),
|
|
596
|
+
count: z.number().int().optional().describe("How many upcoming executions to return"),
|
|
597
|
+
startDate: z.string().optional(),
|
|
598
|
+
endDate: z.string().optional(),
|
|
599
|
+
timezone: z.string().optional()
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
async ({
|
|
603
|
+
scheduleType,
|
|
604
|
+
cronExpression,
|
|
605
|
+
rrule,
|
|
606
|
+
interval,
|
|
607
|
+
intervalUnit,
|
|
608
|
+
count,
|
|
609
|
+
startDate,
|
|
610
|
+
endDate,
|
|
611
|
+
timezone
|
|
612
|
+
}) => {
|
|
613
|
+
try {
|
|
614
|
+
const data = await ctx.gql.workspace.request(PREVIEW_SCHEDULE, {
|
|
615
|
+
scheduleType: scheduleType.toUpperCase(),
|
|
616
|
+
cronExpression: cronExpression ?? null,
|
|
617
|
+
rrule: rrule ?? null,
|
|
618
|
+
interval: interval ?? null,
|
|
619
|
+
intervalUnit: intervalUnit ?? null,
|
|
620
|
+
count: count ?? null,
|
|
621
|
+
startDate: startDate ?? null,
|
|
622
|
+
endDate: endDate ?? null,
|
|
623
|
+
timezone: timezone ?? null
|
|
624
|
+
});
|
|
625
|
+
return jsonResult(data.previewSchedule);
|
|
626
|
+
} catch (error) {
|
|
627
|
+
ctx.logger.error("scheduler_jobs_preview failed", { error: String(error) });
|
|
628
|
+
return errorResult(
|
|
629
|
+
`Failed to preview: ${error instanceof Error ? error.message : String(error)}`
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
server.registerTool(
|
|
635
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_list")),
|
|
636
|
+
{
|
|
637
|
+
title: "List Schedule Templates",
|
|
638
|
+
description: "List schedule templates in the active workspace.",
|
|
639
|
+
inputSchema: {
|
|
640
|
+
category: z.string().optional(),
|
|
641
|
+
isPublic: z.boolean().optional(),
|
|
642
|
+
limit: z.number().optional()
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
async ({ category, isPublic, limit }) => {
|
|
646
|
+
try {
|
|
647
|
+
const workspaceId = readWorkspaceId(ctx);
|
|
648
|
+
if (!workspaceId) return errorResult("No workspace set.");
|
|
649
|
+
const filter = {};
|
|
650
|
+
if (category !== void 0) filter.category = category;
|
|
651
|
+
if (isPublic !== void 0) filter.isPublic = isPublic;
|
|
652
|
+
const data = await ctx.gql.workspace.request(LIST_SCHEDULE_TEMPLATES, {
|
|
653
|
+
workspaceId,
|
|
654
|
+
filter: Object.keys(filter).length > 0 ? filter : void 0,
|
|
655
|
+
pagination: { first: limit ?? 100 }
|
|
656
|
+
});
|
|
657
|
+
return jsonResult(data.scheduleTemplates);
|
|
658
|
+
} catch (error) {
|
|
659
|
+
ctx.logger.error("scheduler_templates_list failed", { error: String(error) });
|
|
660
|
+
return errorResult(
|
|
661
|
+
`Failed to list templates: ${error instanceof Error ? error.message : String(error)}`
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
server.registerTool(
|
|
667
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_list_public")),
|
|
668
|
+
{
|
|
669
|
+
title: "List Public Schedule Templates",
|
|
670
|
+
description: "List public (cross-workspace) schedule templates.",
|
|
671
|
+
inputSchema: {
|
|
672
|
+
category: z.string().optional(),
|
|
673
|
+
limit: z.number().optional()
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
async ({ category, limit }) => {
|
|
677
|
+
try {
|
|
678
|
+
const filter = {};
|
|
679
|
+
if (category !== void 0) filter.category = category;
|
|
680
|
+
const data = await ctx.gql.workspace.request(LIST_PUBLIC_SCHEDULE_TEMPLATES, {
|
|
681
|
+
filter: Object.keys(filter).length > 0 ? filter : void 0,
|
|
682
|
+
pagination: { first: limit ?? 100 }
|
|
683
|
+
});
|
|
684
|
+
return jsonResult(data.publicScheduleTemplates);
|
|
685
|
+
} catch (error) {
|
|
686
|
+
ctx.logger.error("scheduler_templates_list_public failed", { error: String(error) });
|
|
687
|
+
return errorResult(
|
|
688
|
+
`Failed to list: ${error instanceof Error ? error.message : String(error)}`
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
);
|
|
693
|
+
server.registerTool(
|
|
694
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_get")),
|
|
695
|
+
{
|
|
696
|
+
title: "Get Schedule Template",
|
|
697
|
+
description: "Get a schedule template by ID.",
|
|
698
|
+
inputSchema: { id: z.string() }
|
|
699
|
+
},
|
|
700
|
+
async ({ id }) => {
|
|
701
|
+
try {
|
|
702
|
+
const data = await ctx.gql.workspace.request(
|
|
703
|
+
GET_SCHEDULE_TEMPLATE,
|
|
704
|
+
{ id }
|
|
705
|
+
);
|
|
706
|
+
if (!data.scheduleTemplate) return errorResult(`Template ${id} not found`);
|
|
707
|
+
return jsonResult(data.scheduleTemplate);
|
|
708
|
+
} catch (error) {
|
|
709
|
+
ctx.logger.error("scheduler_templates_get failed", { error: String(error) });
|
|
710
|
+
return errorResult(
|
|
711
|
+
`Failed to get template: ${error instanceof Error ? error.message : String(error)}`
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
);
|
|
716
|
+
server.registerTool(
|
|
717
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_create")),
|
|
718
|
+
{
|
|
719
|
+
title: "Create Schedule Template",
|
|
720
|
+
description: "Create a reusable schedule template in the active workspace.",
|
|
721
|
+
inputSchema: {
|
|
722
|
+
name: z.string(),
|
|
723
|
+
scheduleType: z.string().describe("CRON | FIXED_INTERVAL | ONE_TIME | RRULE | WINDOWED"),
|
|
724
|
+
executorType: z.string().describe("WEBHOOK | INTERNAL_API | NATS_TOPIC | GRAPHQL"),
|
|
725
|
+
scheduleConfig: z.record(z.string(), z.unknown()),
|
|
726
|
+
executorConfig: z.record(z.string(), z.unknown()),
|
|
727
|
+
description: z.string().optional(),
|
|
728
|
+
category: z.string().optional(),
|
|
729
|
+
isPublic: z.boolean().optional()
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
async ({
|
|
733
|
+
name,
|
|
734
|
+
scheduleType,
|
|
735
|
+
executorType,
|
|
736
|
+
scheduleConfig,
|
|
737
|
+
executorConfig,
|
|
738
|
+
description,
|
|
739
|
+
category,
|
|
740
|
+
isPublic
|
|
741
|
+
}) => {
|
|
742
|
+
try {
|
|
743
|
+
const workspaceId = readWorkspaceId(ctx);
|
|
744
|
+
if (!workspaceId) return errorResult("No workspace set.");
|
|
745
|
+
const input = {
|
|
746
|
+
name,
|
|
747
|
+
scheduleType: scheduleType.toUpperCase(),
|
|
748
|
+
executorType: executorType.toUpperCase(),
|
|
749
|
+
scheduleConfig,
|
|
750
|
+
executorConfig
|
|
751
|
+
};
|
|
752
|
+
if (description !== void 0) input.description = description;
|
|
753
|
+
if (category !== void 0) input.category = category;
|
|
754
|
+
if (isPublic !== void 0) input.isPublic = isPublic;
|
|
755
|
+
const data = await ctx.gql.workspace.request(
|
|
756
|
+
CREATE_SCHEDULE_TEMPLATE,
|
|
757
|
+
{ workspaceId, input }
|
|
758
|
+
);
|
|
759
|
+
return jsonResult(data.createScheduleTemplate);
|
|
760
|
+
} catch (error) {
|
|
761
|
+
ctx.logger.error("scheduler_templates_create failed", { error: String(error) });
|
|
762
|
+
return errorResult(
|
|
763
|
+
`Failed to create template: ${error instanceof Error ? error.message : String(error)}`
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
server.registerTool(
|
|
769
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_update")),
|
|
770
|
+
{
|
|
771
|
+
title: "Update Schedule Template",
|
|
772
|
+
description: "Update a schedule template.",
|
|
773
|
+
inputSchema: {
|
|
774
|
+
id: z.string(),
|
|
775
|
+
name: z.string().optional(),
|
|
776
|
+
description: z.string().optional(),
|
|
777
|
+
category: z.string().optional(),
|
|
778
|
+
isPublic: z.boolean().optional()
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
async ({ id, name, description, category, isPublic }) => {
|
|
782
|
+
try {
|
|
783
|
+
const input = {};
|
|
784
|
+
if (name !== void 0) input.name = name;
|
|
785
|
+
if (description !== void 0) input.description = description;
|
|
786
|
+
if (category !== void 0) input.category = category;
|
|
787
|
+
if (isPublic !== void 0) input.isPublic = isPublic;
|
|
788
|
+
if (Object.keys(input).length === 0) {
|
|
789
|
+
return errorResult("Provide at least one field to update");
|
|
790
|
+
}
|
|
791
|
+
const data = await ctx.gql.workspace.request(
|
|
792
|
+
UPDATE_SCHEDULE_TEMPLATE,
|
|
793
|
+
{ id, input }
|
|
794
|
+
);
|
|
795
|
+
return jsonResult(data.updateScheduleTemplate);
|
|
796
|
+
} catch (error) {
|
|
797
|
+
ctx.logger.error("scheduler_templates_update failed", { error: String(error) });
|
|
798
|
+
return errorResult(
|
|
799
|
+
`Failed to update template: ${error instanceof Error ? error.message : String(error)}`
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
server.registerTool(
|
|
805
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_delete")),
|
|
806
|
+
{
|
|
807
|
+
title: "Delete Schedule Template",
|
|
808
|
+
description: "Delete a schedule template.",
|
|
809
|
+
inputSchema: { id: z.string() }
|
|
810
|
+
},
|
|
811
|
+
async ({ id }) => {
|
|
812
|
+
try {
|
|
813
|
+
const data = await ctx.gql.workspace.request(
|
|
814
|
+
DELETE_SCHEDULE_TEMPLATE,
|
|
815
|
+
{ id }
|
|
816
|
+
);
|
|
817
|
+
return jsonResult({ deleted: data.deleteScheduleTemplate, id });
|
|
818
|
+
} catch (error) {
|
|
819
|
+
ctx.logger.error("scheduler_templates_delete failed", { error: String(error) });
|
|
820
|
+
return errorResult(
|
|
821
|
+
`Failed to delete: ${error instanceof Error ? error.message : String(error)}`
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
);
|
|
826
|
+
server.registerTool(
|
|
827
|
+
track(mcpToolName(ctx.productName, "scheduler_templates_create_from")),
|
|
828
|
+
{
|
|
829
|
+
title: "Create Schedule From Template",
|
|
830
|
+
description: "Instantiate a schedule from a template; optional overrides.",
|
|
831
|
+
inputSchema: {
|
|
832
|
+
templateId: z.string(),
|
|
833
|
+
overrides: z.record(z.string(), z.unknown()).optional()
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
async ({ templateId, overrides }) => {
|
|
837
|
+
try {
|
|
838
|
+
const workspaceId = readWorkspaceId(ctx);
|
|
839
|
+
if (!workspaceId) return errorResult("No workspace set.");
|
|
840
|
+
const data = await ctx.gql.workspace.request(
|
|
841
|
+
CREATE_SCHEDULE_FROM_TEMPLATE,
|
|
842
|
+
{ templateId, workspaceId, overrides: overrides ?? null }
|
|
843
|
+
);
|
|
844
|
+
return jsonResult(data.createScheduleFromTemplate);
|
|
845
|
+
} catch (error) {
|
|
846
|
+
ctx.logger.error("scheduler_templates_create_from failed", { error: String(error) });
|
|
847
|
+
return errorResult(
|
|
848
|
+
`Failed to create: ${error instanceof Error ? error.message : String(error)}`
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
);
|
|
853
|
+
server.registerTool(
|
|
854
|
+
track(mcpToolName(ctx.productName, "scheduler_versions_history")),
|
|
855
|
+
{
|
|
856
|
+
title: "Schedule Version History",
|
|
857
|
+
description: "List version history for a schedule.",
|
|
858
|
+
inputSchema: { scheduleId: z.string() }
|
|
859
|
+
},
|
|
860
|
+
async ({ scheduleId }) => {
|
|
861
|
+
try {
|
|
862
|
+
const data = await ctx.gql.workspace.request(
|
|
863
|
+
SCHEDULE_VERSION_HISTORY,
|
|
864
|
+
{ scheduleId }
|
|
865
|
+
);
|
|
866
|
+
return jsonResult(data.scheduleVersionHistory);
|
|
867
|
+
} catch (error) {
|
|
868
|
+
ctx.logger.error("scheduler_versions_history failed", { error: String(error) });
|
|
869
|
+
return errorResult(
|
|
870
|
+
`Failed to get history: ${error instanceof Error ? error.message : String(error)}`
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
);
|
|
875
|
+
server.registerTool(
|
|
876
|
+
track(mcpToolName(ctx.productName, "scheduler_versions_restore")),
|
|
877
|
+
{
|
|
878
|
+
title: "Restore Schedule Version",
|
|
879
|
+
description: "Restore a schedule to a prior version.",
|
|
880
|
+
inputSchema: { scheduleId: z.string(), versionId: z.string() }
|
|
881
|
+
},
|
|
882
|
+
async ({ scheduleId, versionId }) => {
|
|
883
|
+
try {
|
|
884
|
+
const data = await ctx.gql.workspace.request(
|
|
885
|
+
RESTORE_SCHEDULE_VERSION,
|
|
886
|
+
{ scheduleId, versionId }
|
|
887
|
+
);
|
|
888
|
+
return jsonResult(data.restoreScheduleVersion);
|
|
889
|
+
} catch (error) {
|
|
890
|
+
ctx.logger.error("scheduler_versions_restore failed", { error: String(error) });
|
|
891
|
+
return errorResult(
|
|
892
|
+
`Failed to restore: ${error instanceof Error ? error.message : String(error)}`
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
);
|
|
897
|
+
server.registerTool(
|
|
898
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_tag_add")),
|
|
899
|
+
{
|
|
900
|
+
title: "Tag Scheduled Job",
|
|
901
|
+
description: "Add a tag assignment to a scheduled job.",
|
|
902
|
+
inputSchema: {
|
|
903
|
+
entityId: z.string(),
|
|
904
|
+
tagId: z.string(),
|
|
905
|
+
source: z.string().optional()
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
async ({ entityId, tagId, source }) => {
|
|
909
|
+
try {
|
|
910
|
+
const input = { entityId, tagId };
|
|
911
|
+
if (source !== void 0) input.source = source;
|
|
912
|
+
const data = await ctx.gql.workspace.request(
|
|
913
|
+
TAG_SCHEDULED_JOB,
|
|
914
|
+
{ input }
|
|
915
|
+
);
|
|
916
|
+
return jsonResult(data.tagScheduledJob);
|
|
917
|
+
} catch (error) {
|
|
918
|
+
ctx.logger.error("scheduler_jobs_tag_add failed", { error: String(error) });
|
|
919
|
+
return errorResult(
|
|
920
|
+
`Failed to tag: ${error instanceof Error ? error.message : String(error)}`
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
);
|
|
925
|
+
server.registerTool(
|
|
926
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_tag_remove")),
|
|
927
|
+
{
|
|
928
|
+
title: "Untag Scheduled Job",
|
|
929
|
+
description: "Remove a tag assignment from a scheduled job.",
|
|
930
|
+
inputSchema: { entityId: z.string(), tagId: z.string() }
|
|
931
|
+
},
|
|
932
|
+
async ({ entityId, tagId }) => {
|
|
933
|
+
try {
|
|
934
|
+
const data = await ctx.gql.workspace.request(
|
|
935
|
+
UNTAG_SCHEDULED_JOB,
|
|
936
|
+
{ input: { entityId, tagId } }
|
|
937
|
+
);
|
|
938
|
+
return jsonResult({ removed: data.untagScheduledJob });
|
|
939
|
+
} catch (error) {
|
|
940
|
+
ctx.logger.error("scheduler_jobs_tag_remove failed", { error: String(error) });
|
|
941
|
+
return errorResult(
|
|
942
|
+
`Failed to untag: ${error instanceof Error ? error.message : String(error)}`
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
server.registerTool(
|
|
948
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_tag_replace")),
|
|
949
|
+
{
|
|
950
|
+
title: "Replace Scheduled Job Tags",
|
|
951
|
+
description: "Replace all tag assignments on a scheduled job.",
|
|
952
|
+
inputSchema: { entityId: z.string(), tagIds: z.array(z.string()) }
|
|
953
|
+
},
|
|
954
|
+
async ({ entityId, tagIds }) => {
|
|
955
|
+
try {
|
|
956
|
+
const data = await ctx.gql.workspace.request(
|
|
957
|
+
REPLACE_SCHEDULED_JOB_TAGS,
|
|
958
|
+
{ input: { entityId, tagIds } }
|
|
959
|
+
);
|
|
960
|
+
return jsonResult(data.replaceScheduledJobTags);
|
|
961
|
+
} catch (error) {
|
|
962
|
+
ctx.logger.error("scheduler_jobs_tag_replace failed", { error: String(error) });
|
|
963
|
+
return errorResult(
|
|
964
|
+
`Failed to replace tags: ${error instanceof Error ? error.message : String(error)}`
|
|
965
|
+
);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
server.registerTool(
|
|
970
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_tag_list")),
|
|
971
|
+
{
|
|
972
|
+
title: "List Scheduled Job Tags",
|
|
973
|
+
description: "List tag assignments on a scheduled job.",
|
|
974
|
+
inputSchema: { entityId: z.string() }
|
|
975
|
+
},
|
|
976
|
+
async ({ entityId }) => {
|
|
977
|
+
try {
|
|
978
|
+
const data = await ctx.gql.workspace.request(
|
|
979
|
+
GET_SCHEDULED_JOB_TAGS,
|
|
980
|
+
{ input: { entityId } }
|
|
981
|
+
);
|
|
982
|
+
return jsonResult(data.getScheduledJobTags);
|
|
983
|
+
} catch (error) {
|
|
984
|
+
ctx.logger.error("scheduler_jobs_tag_list failed", { error: String(error) });
|
|
985
|
+
return errorResult(
|
|
986
|
+
`Failed to list tags: ${error instanceof Error ? error.message : String(error)}`
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
);
|
|
991
|
+
server.registerTool(
|
|
992
|
+
track(mcpToolName(ctx.productName, "scheduler_executions_check")),
|
|
993
|
+
{
|
|
994
|
+
title: "Check Execution Status (poll)",
|
|
995
|
+
description: "Polling proxy for the executionUpdated subscription \u2014 returns the current state of an execution.",
|
|
996
|
+
inputSchema: { id: z.string().describe("Execution ID") }
|
|
997
|
+
},
|
|
998
|
+
async ({ id }) => {
|
|
999
|
+
try {
|
|
1000
|
+
const data = await ctx.gql.workspace.request(
|
|
1001
|
+
EXECUTION_UPDATED_POLL,
|
|
1002
|
+
{ id }
|
|
1003
|
+
);
|
|
1004
|
+
if (!data.jobExecution) return errorResult(`Execution ${id} not found`);
|
|
1005
|
+
return jsonResult(data.jobExecution);
|
|
1006
|
+
} catch (error) {
|
|
1007
|
+
ctx.logger.error("scheduler_executions_check failed", { error: String(error) });
|
|
1008
|
+
return errorResult(`Failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
1012
|
+
server.registerTool(
|
|
1013
|
+
track(mcpToolName(ctx.productName, "scheduler_jobs_check")),
|
|
1014
|
+
{
|
|
1015
|
+
title: "Check Job Status (poll)",
|
|
1016
|
+
description: "Polling proxy for the jobStatusUpdated subscription \u2014 returns the current state of a scheduled job.",
|
|
1017
|
+
inputSchema: { id: z.string().describe("Schedule ID") }
|
|
1018
|
+
},
|
|
1019
|
+
async ({ id }) => {
|
|
1020
|
+
try {
|
|
1021
|
+
const data = await ctx.gql.workspace.request(
|
|
1022
|
+
JOB_STATUS_UPDATED_POLL,
|
|
1023
|
+
{ id }
|
|
1024
|
+
);
|
|
1025
|
+
if (!data.scheduledJob) return errorResult(`Job ${id} not found`);
|
|
1026
|
+
return jsonResult(data.scheduledJob);
|
|
1027
|
+
} catch (error) {
|
|
1028
|
+
ctx.logger.error("scheduler_jobs_check failed", { error: String(error) });
|
|
1029
|
+
return errorResult(`Failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
297
1033
|
server.registerTool(
|
|
298
1034
|
track(mcpToolName(ctx.productName, "scheduler_executions_retry")),
|
|
299
1035
|
{
|