trigger.dev 4.0.0-v4-beta.28 → 4.0.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/README.md +26 -30
- package/dist/esm/apiClient.d.ts +56 -1
- package/dist/esm/apiClient.js +56 -1
- package/dist/esm/apiClient.js.map +1 -1
- package/dist/esm/cli/common.js +1 -1
- package/dist/esm/cli/common.js.map +1 -1
- package/dist/esm/cli/index.js +13 -9
- package/dist/esm/cli/index.js.map +1 -1
- package/dist/esm/commands/deploy.js +1 -1
- package/dist/esm/commands/deploy.js.map +1 -1
- package/dist/esm/commands/dev.d.ts +17 -5
- package/dist/esm/commands/dev.js +47 -0
- package/dist/esm/commands/dev.js.map +1 -1
- package/dist/esm/commands/init.d.ts +8 -0
- package/dist/esm/commands/init.js +127 -63
- package/dist/esm/commands/init.js.map +1 -1
- package/dist/esm/commands/install-mcp.d.ts +50 -0
- package/dist/esm/commands/install-mcp.js +497 -0
- package/dist/esm/commands/install-mcp.js.map +1 -0
- package/dist/esm/commands/install-rules.d.ts +11 -0
- package/dist/esm/commands/install-rules.js +380 -0
- package/dist/esm/commands/install-rules.js.map +1 -0
- package/dist/esm/commands/login.d.ts +5 -0
- package/dist/esm/commands/login.js +1 -1
- package/dist/esm/commands/login.js.map +1 -1
- package/dist/esm/commands/mcp.d.ts +38 -0
- package/dist/esm/commands/mcp.js +82 -0
- package/dist/esm/commands/mcp.js.map +1 -0
- package/dist/esm/commands/update.d.ts +1 -0
- package/dist/esm/commands/update.js +6 -6
- package/dist/esm/commands/update.js.map +1 -1
- package/dist/esm/dev/devOutput.js +3 -3
- package/dist/esm/dev/devOutput.js.map +1 -1
- package/dist/esm/entryPoints/managed/env.d.ts +5 -5
- package/dist/esm/mcp/auth.d.ts +12 -0
- package/dist/esm/mcp/auth.js +146 -0
- package/dist/esm/mcp/auth.js.map +1 -0
- package/dist/esm/mcp/capabilities.d.ts +4 -0
- package/dist/esm/mcp/capabilities.js +22 -0
- package/dist/esm/mcp/capabilities.js.map +1 -0
- package/dist/esm/mcp/config.d.ts +77 -0
- package/dist/esm/mcp/config.js +82 -0
- package/dist/esm/mcp/config.js.map +1 -0
- package/dist/esm/mcp/context.d.ts +45 -0
- package/dist/esm/mcp/context.js +129 -0
- package/dist/esm/mcp/context.js.map +1 -0
- package/dist/esm/mcp/formatters.d.ts +5 -0
- package/dist/esm/mcp/formatters.js +310 -0
- package/dist/esm/mcp/formatters.js.map +1 -0
- package/dist/esm/mcp/logger.d.ts +11 -0
- package/dist/esm/mcp/logger.js +34 -0
- package/dist/esm/mcp/logger.js.map +1 -0
- package/dist/esm/mcp/mintlifyClient.d.ts +1 -0
- package/dist/esm/mcp/mintlifyClient.js +65 -0
- package/dist/esm/mcp/mintlifyClient.js.map +1 -0
- package/dist/esm/mcp/schemas.d.ts +324 -0
- package/dist/esm/mcp/schemas.js +144 -0
- package/dist/esm/mcp/schemas.js.map +1 -0
- package/dist/esm/mcp/tools/deploys.d.ts +174 -0
- package/dist/esm/mcp/tools/deploys.js +161 -0
- package/dist/esm/mcp/tools/deploys.js.map +1 -0
- package/dist/esm/mcp/tools/docs.d.ts +77 -0
- package/dist/esm/mcp/tools/docs.js +18 -0
- package/dist/esm/mcp/tools/docs.js.map +1 -0
- package/dist/esm/mcp/tools/orgs.d.ts +172 -0
- package/dist/esm/mcp/tools/orgs.js +172 -0
- package/dist/esm/mcp/tools/orgs.js.map +1 -0
- package/dist/esm/mcp/tools/previewBranches.d.ts +78 -0
- package/dist/esm/mcp/tools/previewBranches.js +28 -0
- package/dist/esm/mcp/tools/previewBranches.js.map +1 -0
- package/dist/esm/mcp/tools/runs.d.ts +254 -0
- package/dist/esm/mcp/tools/runs.js +119 -0
- package/dist/esm/mcp/tools/runs.js.map +1 -0
- package/dist/esm/mcp/tools/tasks.d.ts +200 -0
- package/dist/esm/mcp/tools/tasks.js +117 -0
- package/dist/esm/mcp/tools/tasks.js.map +1 -0
- package/dist/esm/mcp/tools.d.ts +2 -0
- package/dist/esm/mcp/tools.js +39 -0
- package/dist/esm/mcp/tools.js.map +1 -0
- package/dist/esm/mcp/types.d.ts +6 -0
- package/dist/esm/mcp/types.js +2 -0
- package/dist/esm/mcp/types.js.map +1 -0
- package/dist/esm/mcp/utils.d.ts +89 -0
- package/dist/esm/mcp/utils.js +95 -0
- package/dist/esm/mcp/utils.js.map +1 -0
- package/dist/esm/rules/install.d.ts +1 -0
- package/dist/esm/rules/install.js +2 -0
- package/dist/esm/rules/install.js.map +1 -0
- package/dist/esm/rules/manifest.d.ts +145 -0
- package/dist/esm/rules/manifest.js +110 -0
- package/dist/esm/rules/manifest.js.map +1 -0
- package/dist/esm/rules/types.d.ts +3 -0
- package/dist/esm/rules/types.js +3 -0
- package/dist/esm/rules/types.js.map +1 -0
- package/dist/esm/utilities/configFiles.d.ts +29 -0
- package/dist/esm/utilities/configFiles.js +51 -0
- package/dist/esm/utilities/configFiles.js.map +1 -1
- package/dist/esm/utilities/fileSystem.d.ts +6 -0
- package/dist/esm/utilities/fileSystem.js +41 -3
- package/dist/esm/utilities/fileSystem.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +11 -7
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { ToolMeta } from "../types.js";
|
|
2
|
+
export declare const getCurrentWorker: {
|
|
3
|
+
name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
projectRef: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
configPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
environment: import("zod").ZodDefault<import("zod").ZodEnum<["dev", "staging", "prod", "preview"]>>;
|
|
10
|
+
branch: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
+
};
|
|
12
|
+
handler: (input: unknown, extra: ToolMeta) => Promise<{
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
content: ({
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
_meta?: {
|
|
19
|
+
[x: string]: unknown;
|
|
20
|
+
} | undefined;
|
|
21
|
+
} | {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
type: "image";
|
|
24
|
+
data: string;
|
|
25
|
+
mimeType: string;
|
|
26
|
+
_meta?: {
|
|
27
|
+
[x: string]: unknown;
|
|
28
|
+
} | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
type: "audio";
|
|
32
|
+
data: string;
|
|
33
|
+
mimeType: string;
|
|
34
|
+
_meta?: {
|
|
35
|
+
[x: string]: unknown;
|
|
36
|
+
} | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
[x: string]: unknown;
|
|
39
|
+
type: "resource_link";
|
|
40
|
+
name: string;
|
|
41
|
+
uri: string;
|
|
42
|
+
description?: string | undefined;
|
|
43
|
+
title?: string | undefined;
|
|
44
|
+
_meta?: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
} | undefined;
|
|
47
|
+
mimeType?: string | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
type: "resource";
|
|
51
|
+
resource: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
text: string;
|
|
54
|
+
uri: string;
|
|
55
|
+
_meta?: {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
} | undefined;
|
|
58
|
+
mimeType?: string | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
[x: string]: unknown;
|
|
61
|
+
uri: string;
|
|
62
|
+
blob: string;
|
|
63
|
+
_meta?: {
|
|
64
|
+
[x: string]: unknown;
|
|
65
|
+
} | undefined;
|
|
66
|
+
mimeType?: string | undefined;
|
|
67
|
+
};
|
|
68
|
+
_meta?: {
|
|
69
|
+
[x: string]: unknown;
|
|
70
|
+
} | undefined;
|
|
71
|
+
})[];
|
|
72
|
+
isError?: boolean | undefined;
|
|
73
|
+
_meta?: {
|
|
74
|
+
[x: string]: unknown;
|
|
75
|
+
} | undefined;
|
|
76
|
+
structuredContent?: {
|
|
77
|
+
[x: string]: unknown;
|
|
78
|
+
} | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
export declare const triggerTaskTool: {
|
|
82
|
+
name: string;
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
inputSchema: {
|
|
86
|
+
projectRef: import("zod").ZodOptional<import("zod").ZodString>;
|
|
87
|
+
configPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
88
|
+
environment: import("zod").ZodDefault<import("zod").ZodEnum<["dev", "staging", "prod", "preview"]>>;
|
|
89
|
+
branch: import("zod").ZodOptional<import("zod").ZodString>;
|
|
90
|
+
} & {
|
|
91
|
+
taskId: import("zod").ZodString;
|
|
92
|
+
payload: import("zod").ZodAny;
|
|
93
|
+
options: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
94
|
+
queue: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
95
|
+
name: import("zod").ZodString;
|
|
96
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
97
|
+
name: string;
|
|
98
|
+
}, {
|
|
99
|
+
name: string;
|
|
100
|
+
}>>;
|
|
101
|
+
delay: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodDate]>>;
|
|
102
|
+
idempotencyKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
103
|
+
machine: import("zod").ZodOptional<import("zod").ZodEnum<["micro", "small-1x", "small-2x", "medium-1x", "medium-2x", "large-1x", "large-2x"]>>;
|
|
104
|
+
maxAttempts: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
105
|
+
maxDuration: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
106
|
+
tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
107
|
+
ttl: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
108
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
109
|
+
ttl: string | number;
|
|
110
|
+
tags?: string[] | undefined;
|
|
111
|
+
idempotencyKey?: string | undefined;
|
|
112
|
+
maxAttempts?: number | undefined;
|
|
113
|
+
maxDuration?: number | undefined;
|
|
114
|
+
queue?: {
|
|
115
|
+
name: string;
|
|
116
|
+
} | undefined;
|
|
117
|
+
machine?: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x" | undefined;
|
|
118
|
+
delay?: string | Date | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
tags?: string[] | undefined;
|
|
121
|
+
idempotencyKey?: string | undefined;
|
|
122
|
+
maxAttempts?: number | undefined;
|
|
123
|
+
maxDuration?: number | undefined;
|
|
124
|
+
queue?: {
|
|
125
|
+
name: string;
|
|
126
|
+
} | undefined;
|
|
127
|
+
machine?: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x" | undefined;
|
|
128
|
+
delay?: string | Date | undefined;
|
|
129
|
+
ttl?: string | number | undefined;
|
|
130
|
+
}>>;
|
|
131
|
+
};
|
|
132
|
+
handler: (input: unknown, extra: ToolMeta) => Promise<{
|
|
133
|
+
[x: string]: unknown;
|
|
134
|
+
content: ({
|
|
135
|
+
[x: string]: unknown;
|
|
136
|
+
type: "text";
|
|
137
|
+
text: string;
|
|
138
|
+
_meta?: {
|
|
139
|
+
[x: string]: unknown;
|
|
140
|
+
} | undefined;
|
|
141
|
+
} | {
|
|
142
|
+
[x: string]: unknown;
|
|
143
|
+
type: "image";
|
|
144
|
+
data: string;
|
|
145
|
+
mimeType: string;
|
|
146
|
+
_meta?: {
|
|
147
|
+
[x: string]: unknown;
|
|
148
|
+
} | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
[x: string]: unknown;
|
|
151
|
+
type: "audio";
|
|
152
|
+
data: string;
|
|
153
|
+
mimeType: string;
|
|
154
|
+
_meta?: {
|
|
155
|
+
[x: string]: unknown;
|
|
156
|
+
} | undefined;
|
|
157
|
+
} | {
|
|
158
|
+
[x: string]: unknown;
|
|
159
|
+
type: "resource_link";
|
|
160
|
+
name: string;
|
|
161
|
+
uri: string;
|
|
162
|
+
description?: string | undefined;
|
|
163
|
+
title?: string | undefined;
|
|
164
|
+
_meta?: {
|
|
165
|
+
[x: string]: unknown;
|
|
166
|
+
} | undefined;
|
|
167
|
+
mimeType?: string | undefined;
|
|
168
|
+
} | {
|
|
169
|
+
[x: string]: unknown;
|
|
170
|
+
type: "resource";
|
|
171
|
+
resource: {
|
|
172
|
+
[x: string]: unknown;
|
|
173
|
+
text: string;
|
|
174
|
+
uri: string;
|
|
175
|
+
_meta?: {
|
|
176
|
+
[x: string]: unknown;
|
|
177
|
+
} | undefined;
|
|
178
|
+
mimeType?: string | undefined;
|
|
179
|
+
} | {
|
|
180
|
+
[x: string]: unknown;
|
|
181
|
+
uri: string;
|
|
182
|
+
blob: string;
|
|
183
|
+
_meta?: {
|
|
184
|
+
[x: string]: unknown;
|
|
185
|
+
} | undefined;
|
|
186
|
+
mimeType?: string | undefined;
|
|
187
|
+
};
|
|
188
|
+
_meta?: {
|
|
189
|
+
[x: string]: unknown;
|
|
190
|
+
} | undefined;
|
|
191
|
+
})[];
|
|
192
|
+
isError?: boolean | undefined;
|
|
193
|
+
_meta?: {
|
|
194
|
+
[x: string]: unknown;
|
|
195
|
+
} | undefined;
|
|
196
|
+
structuredContent?: {
|
|
197
|
+
[x: string]: unknown;
|
|
198
|
+
} | undefined;
|
|
199
|
+
}>;
|
|
200
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { toolsMetadata } from "../config.js";
|
|
2
|
+
import { CommonProjectsInput, TriggerTaskInput } from "../schemas.js";
|
|
3
|
+
import { respondWithError, toolHandler } from "../utils.js";
|
|
4
|
+
export const getCurrentWorker = {
|
|
5
|
+
name: toolsMetadata.get_current_worker.name,
|
|
6
|
+
title: toolsMetadata.get_current_worker.title,
|
|
7
|
+
description: toolsMetadata.get_current_worker.description,
|
|
8
|
+
inputSchema: CommonProjectsInput.shape,
|
|
9
|
+
handler: toolHandler(CommonProjectsInput.shape, async (input, { ctx }) => {
|
|
10
|
+
ctx.logger?.log("calling get_current_worker", { input });
|
|
11
|
+
if (ctx.options.devOnly && input.environment !== "dev") {
|
|
12
|
+
return respondWithError(`This MCP server is only available for the dev environment. You tried to access the ${input.environment} environment. Remove the --dev-only flag to access other environments.`);
|
|
13
|
+
}
|
|
14
|
+
const projectRef = await ctx.getProjectRef({
|
|
15
|
+
projectRef: input.projectRef,
|
|
16
|
+
cwd: input.configPath,
|
|
17
|
+
});
|
|
18
|
+
const cliApiClient = await ctx.getCliApiClient(input.branch);
|
|
19
|
+
const workerResult = await cliApiClient.getWorkerByTag(projectRef, input.environment, "current");
|
|
20
|
+
if (!workerResult.success) {
|
|
21
|
+
return respondWithError(workerResult.error);
|
|
22
|
+
}
|
|
23
|
+
const { worker, urls } = workerResult.data;
|
|
24
|
+
const contents = [
|
|
25
|
+
`Current worker for ${input.environment} is ${worker.version} using ${worker.sdkVersion} of the SDK.`,
|
|
26
|
+
];
|
|
27
|
+
if (worker.tasks.length > 0) {
|
|
28
|
+
contents.push(`The worker has ${worker.tasks.length} tasks registered:`);
|
|
29
|
+
for (const task of worker.tasks) {
|
|
30
|
+
if (task.payloadSchema) {
|
|
31
|
+
contents.push(`- ${task.slug} in ${task.filePath} (payload schema: ${JSON.stringify(task.payloadSchema)})`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
contents.push(`- ${task.slug} in ${task.filePath}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
contents.push(`The worker has no tasks registered.`);
|
|
40
|
+
}
|
|
41
|
+
contents.push(`\n`);
|
|
42
|
+
contents.push(`URLs:`);
|
|
43
|
+
contents.push(`- Runs: ${urls.runs}`);
|
|
44
|
+
contents.push(`\n`);
|
|
45
|
+
contents.push(`You can use the list_runs tool with the version ${worker.version} to get the list of runs for this worker.`);
|
|
46
|
+
if (typeof worker.sdkVersion === "string" &&
|
|
47
|
+
typeof worker.cliVersion === "string" &&
|
|
48
|
+
worker.sdkVersion !== worker.cliVersion) {
|
|
49
|
+
contents.push(`WARNING: The SDK version (${worker.sdkVersion}) is different from the CLI version (${worker.cliVersion}). This might cause issues with the task execution. Make sure to pin the CLI and the SDK versions to ${worker.sdkVersion}.`);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
content: [{ type: "text", text: contents.join("\n") }],
|
|
53
|
+
};
|
|
54
|
+
}),
|
|
55
|
+
};
|
|
56
|
+
export const triggerTaskTool = {
|
|
57
|
+
name: toolsMetadata.trigger_task.name,
|
|
58
|
+
title: toolsMetadata.trigger_task.title,
|
|
59
|
+
description: toolsMetadata.trigger_task.description,
|
|
60
|
+
inputSchema: TriggerTaskInput.shape,
|
|
61
|
+
handler: toolHandler(TriggerTaskInput.shape, async (input, { ctx }) => {
|
|
62
|
+
ctx.logger?.log("calling trigger_task", { input });
|
|
63
|
+
if (ctx.options.devOnly && input.environment !== "dev") {
|
|
64
|
+
return respondWithError(`This MCP server is only available for the dev environment. You tried to access the ${input.environment} environment. Remove the --dev-only flag to access other environments.`);
|
|
65
|
+
}
|
|
66
|
+
const projectRef = await ctx.getProjectRef({
|
|
67
|
+
projectRef: input.projectRef,
|
|
68
|
+
cwd: input.configPath,
|
|
69
|
+
});
|
|
70
|
+
const apiClient = await ctx.getApiClient({
|
|
71
|
+
projectRef,
|
|
72
|
+
environment: input.environment,
|
|
73
|
+
scopes: ["write:tasks"],
|
|
74
|
+
branch: input.branch,
|
|
75
|
+
});
|
|
76
|
+
ctx.logger?.log("triggering task", { input });
|
|
77
|
+
let payload = input.payload;
|
|
78
|
+
if (typeof payload === "string") {
|
|
79
|
+
try {
|
|
80
|
+
payload = JSON.parse(payload);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
ctx.logger?.log("payload is not a valid JSON string, using as is", { payload });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const result = await apiClient.triggerTask(input.taskId, {
|
|
87
|
+
payload,
|
|
88
|
+
options: input.options,
|
|
89
|
+
});
|
|
90
|
+
const taskRunUrl = await ctx.getDashboardUrl(`/projects/v3/${projectRef}/runs/${result.id}`);
|
|
91
|
+
const contents = [
|
|
92
|
+
`Task ${input.taskId} triggered and run with ID created: ${result.id}.`,
|
|
93
|
+
`View the run in the dashboard: ${taskRunUrl}`,
|
|
94
|
+
`You can also use the get_run_details tool to get the details of the run.`,
|
|
95
|
+
];
|
|
96
|
+
if (input.environment === "dev") {
|
|
97
|
+
const cliApiClient = await ctx.getCliApiClient(input.branch);
|
|
98
|
+
const devStatus = await cliApiClient.getDevStatus(projectRef);
|
|
99
|
+
const isConnected = devStatus.success ? devStatus.data.isConnected : false;
|
|
100
|
+
const connectionMessage = isConnected
|
|
101
|
+
? undefined
|
|
102
|
+
: "The dev CLI is not connected to this project, because it is not currently running. Make sure to run the dev command to execute triggered tasks.";
|
|
103
|
+
if (connectionMessage) {
|
|
104
|
+
contents.push(connectionMessage);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
content: [
|
|
109
|
+
{
|
|
110
|
+
type: "text",
|
|
111
|
+
text: contents.join("\n"),
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
};
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../../src/mcp/tools/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE5D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ED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC1B;aACF;SACF,CAAC;IACJ,CAAC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { deployTool, listDeploysTool } from "./tools/deploys.js";
|
|
2
|
+
import { searchDocsTool } from "./tools/docs.js";
|
|
3
|
+
import { createProjectInOrgTool, initializeProjectTool, listOrgsTool, listProjectsTool, } from "./tools/orgs.js";
|
|
4
|
+
import { listPreviewBranchesTool } from "./tools/previewBranches.js";
|
|
5
|
+
import { cancelRunTool, getRunDetailsTool, listRunsTool } from "./tools/runs.js";
|
|
6
|
+
import { getCurrentWorker, triggerTaskTool } from "./tools/tasks.js";
|
|
7
|
+
import { respondWithError } from "./utils.js";
|
|
8
|
+
export function registerTools(context) {
|
|
9
|
+
const tools = [
|
|
10
|
+
searchDocsTool,
|
|
11
|
+
listOrgsTool,
|
|
12
|
+
listProjectsTool,
|
|
13
|
+
createProjectInOrgTool,
|
|
14
|
+
initializeProjectTool,
|
|
15
|
+
getCurrentWorker,
|
|
16
|
+
triggerTaskTool,
|
|
17
|
+
listRunsTool,
|
|
18
|
+
getRunDetailsTool,
|
|
19
|
+
cancelRunTool,
|
|
20
|
+
deployTool,
|
|
21
|
+
listDeploysTool,
|
|
22
|
+
listPreviewBranchesTool,
|
|
23
|
+
];
|
|
24
|
+
for (const tool of tools) {
|
|
25
|
+
context.server.registerTool(tool.name, {
|
|
26
|
+
annotations: { title: tool.title },
|
|
27
|
+
description: tool.description,
|
|
28
|
+
inputSchema: tool.inputSchema,
|
|
29
|
+
}, async (input, extra) => {
|
|
30
|
+
try {
|
|
31
|
+
return tool.handler(input, { ...extra, ctx: context });
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return respondWithError(error);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/mcp/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,aAAa,CAAC,OAAmB;IAC/C,MAAM,KAAK,GAAG;QACZ,cAAc;QACd,YAAY;QACZ,gBAAgB;QAChB,sBAAsB;QACtB,qBAAqB;QACrB,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,iBAAiB;QACjB,aAAa;QACb,UAAU;QACV,eAAe;QACf,uBAAuB;KACxB,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,MAAM,CAAC,YAAY,CACzB,IAAI,CAAC,IAAI,EACT;YACE,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;YAClC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,EACD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACrB,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;YACzD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
2
|
+
import { ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { McpContext } from "./context.js";
|
|
4
|
+
export type ToolMeta = RequestHandlerExtra<ServerRequest, ServerNotification> & {
|
|
5
|
+
ctx: McpContext;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/mcp/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { CallToolResult, ServerNotification } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { ToolMeta } from "./types.js";
|
|
4
|
+
export declare function respondWithError(error: unknown): CallToolResult;
|
|
5
|
+
export type ToolHandlerMeta = ToolMeta & {
|
|
6
|
+
createProgressTracker: (total: number) => ProgressTracker;
|
|
7
|
+
};
|
|
8
|
+
export declare function toolHandler<TInputShape extends z.ZodRawShape>(shape: TInputShape, handler: (input: z.output<z.ZodObject<TInputShape>>, meta: ToolHandlerMeta) => Promise<CallToolResult>): (input: unknown, extra: ToolMeta) => Promise<{
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
content: ({
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
_meta?: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
} | undefined;
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
type: "image";
|
|
20
|
+
data: string;
|
|
21
|
+
mimeType: string;
|
|
22
|
+
_meta?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
type: "audio";
|
|
28
|
+
data: string;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
_meta?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
} | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
type: "resource_link";
|
|
36
|
+
name: string;
|
|
37
|
+
uri: string;
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
_meta?: {
|
|
41
|
+
[x: string]: unknown;
|
|
42
|
+
} | undefined;
|
|
43
|
+
mimeType?: string | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
type: "resource";
|
|
47
|
+
resource: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
text: string;
|
|
50
|
+
uri: string;
|
|
51
|
+
_meta?: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
} | undefined;
|
|
54
|
+
mimeType?: string | undefined;
|
|
55
|
+
} | {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
uri: string;
|
|
58
|
+
blob: string;
|
|
59
|
+
_meta?: {
|
|
60
|
+
[x: string]: unknown;
|
|
61
|
+
} | undefined;
|
|
62
|
+
mimeType?: string | undefined;
|
|
63
|
+
};
|
|
64
|
+
_meta?: {
|
|
65
|
+
[x: string]: unknown;
|
|
66
|
+
} | undefined;
|
|
67
|
+
})[];
|
|
68
|
+
isError?: boolean | undefined;
|
|
69
|
+
_meta?: {
|
|
70
|
+
[x: string]: unknown;
|
|
71
|
+
} | undefined;
|
|
72
|
+
structuredContent?: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
} | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
declare class ProgressTracker {
|
|
77
|
+
#private;
|
|
78
|
+
private progress;
|
|
79
|
+
private progressToken;
|
|
80
|
+
private total;
|
|
81
|
+
private message;
|
|
82
|
+
private sendNotification;
|
|
83
|
+
constructor(total: number, sendNotification: (notification: ServerNotification) => Promise<void>, progressToken?: string | number);
|
|
84
|
+
updateProgress(progress: number, message?: string): Promise<void>;
|
|
85
|
+
incrementProgress(increment: number, message?: string): Promise<void>;
|
|
86
|
+
complete(message?: string): Promise<void>;
|
|
87
|
+
getProgress(): number;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export function respondWithError(error) {
|
|
3
|
+
return {
|
|
4
|
+
isError: true,
|
|
5
|
+
content: [
|
|
6
|
+
{
|
|
7
|
+
type: "text",
|
|
8
|
+
text: JSON.stringify({ error: enumerateError(error) }),
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function enumerateError(error) {
|
|
14
|
+
if (!error) {
|
|
15
|
+
return error;
|
|
16
|
+
}
|
|
17
|
+
if (typeof error !== "object") {
|
|
18
|
+
return error;
|
|
19
|
+
}
|
|
20
|
+
const newError = {};
|
|
21
|
+
const errorProps = ["name", "message"];
|
|
22
|
+
for (const prop of errorProps) {
|
|
23
|
+
if (prop in error) {
|
|
24
|
+
newError[prop] = error[prop];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return newError;
|
|
28
|
+
}
|
|
29
|
+
export function toolHandler(shape, handler) {
|
|
30
|
+
return async (input, extra) => {
|
|
31
|
+
const parsedInput = z.object(shape).safeParse(input);
|
|
32
|
+
if (!parsedInput.success) {
|
|
33
|
+
return respondWithError(parsedInput.error);
|
|
34
|
+
}
|
|
35
|
+
function createProgressTracker(total) {
|
|
36
|
+
return new ProgressTracker(total, extra.sendNotification, extra._meta?.progressToken);
|
|
37
|
+
}
|
|
38
|
+
return handler(parsedInput.data, { ...extra, createProgressTracker });
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
class ProgressTracker {
|
|
42
|
+
progress = 0;
|
|
43
|
+
progressToken;
|
|
44
|
+
total;
|
|
45
|
+
message;
|
|
46
|
+
sendNotification;
|
|
47
|
+
constructor(total, sendNotification, progressToken) {
|
|
48
|
+
this.message = "";
|
|
49
|
+
this.progressToken = progressToken;
|
|
50
|
+
this.progress = 0;
|
|
51
|
+
this.total = total;
|
|
52
|
+
this.sendNotification = sendNotification;
|
|
53
|
+
}
|
|
54
|
+
async updateProgress(progress, message) {
|
|
55
|
+
this.progress = progress;
|
|
56
|
+
if (message) {
|
|
57
|
+
this.message = message;
|
|
58
|
+
}
|
|
59
|
+
await this.#sendNotification(progress, this.message);
|
|
60
|
+
}
|
|
61
|
+
async incrementProgress(increment, message) {
|
|
62
|
+
this.progress += increment;
|
|
63
|
+
// make sure the progress is never greater than the total
|
|
64
|
+
this.progress = Math.min(this.progress, this.total);
|
|
65
|
+
if (message) {
|
|
66
|
+
this.message = message;
|
|
67
|
+
}
|
|
68
|
+
await this.#sendNotification(this.progress, this.message);
|
|
69
|
+
}
|
|
70
|
+
async complete(message) {
|
|
71
|
+
this.progress = this.total;
|
|
72
|
+
if (message) {
|
|
73
|
+
this.message = message;
|
|
74
|
+
}
|
|
75
|
+
await this.#sendNotification(this.progress, this.message);
|
|
76
|
+
}
|
|
77
|
+
getProgress() {
|
|
78
|
+
return this.progress;
|
|
79
|
+
}
|
|
80
|
+
async #sendNotification(progress, message) {
|
|
81
|
+
if (!this.progressToken) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
await this.sendNotification({
|
|
85
|
+
method: "notifications/progress",
|
|
86
|
+
params: {
|
|
87
|
+
progress,
|
|
88
|
+
total: this.total,
|
|
89
|
+
message: this.message,
|
|
90
|
+
progressToken: this.progressToken,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@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