@devpad/api 2.0.1 → 2.0.3
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-5X36WMYQ.js +130 -0
- package/dist/chunk-INGCIUMX.js +166 -0
- package/dist/errors.d-C73AkrdX.d.ts +159 -0
- package/dist/index.d.ts +541 -13
- package/dist/index.js +1587 -6
- package/dist/media.d-CQ56ckoR.d.ts +1047 -0
- package/dist/schema/blog.d.ts +5032 -0
- package/dist/schema/blog.js +277 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/index.js +106 -0
- package/dist/schema/media.d.ts +1675 -0
- package/dist/schema/media.js +680 -0
- package/dist/schema.d-DALWdx-o.d.ts +2666 -0
- package/dist/types.d-B1VbnHQT.d.ts +6146 -0
- package/dist/types.d-Bj4FU9Op.d.ts +539 -0
- package/dist/types.d-DLE9TSql.d.ts +684 -0
- package/package.json +17 -4
- package/dist/api-client.d.ts +0 -470
- package/dist/api-client.d.ts.map +0 -1
- package/dist/api-client.js +0 -530
- package/dist/error-handlers.d.ts +0 -55
- package/dist/error-handlers.d.ts.map +0 -1
- package/dist/error-handlers.js +0 -217
- package/dist/errors.d.ts +0 -19
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -28
- package/dist/index.d.ts.map +0 -1
- package/dist/request.d.ts +0 -51
- package/dist/request.d.ts.map +0 -1
- package/dist/request.js +0 -197
- package/dist/result.d.ts +0 -10
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -11
- package/dist/tools.d.ts +0 -84
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -474
package/dist/tools.js
DELETED
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
import { save_config_request, save_tags_request, upsert_goal, upsert_milestone, upsert_project, upsert_todo } from "@devpad/schema";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
function unwrap(result) {
|
|
4
|
-
if (!result.ok)
|
|
5
|
-
throw new Error(result.error?.message ?? "Unknown error");
|
|
6
|
-
return result.value;
|
|
7
|
-
}
|
|
8
|
-
// Filter schemas that aren't in @devpad/schema yet
|
|
9
|
-
export const project_filters = z.object({
|
|
10
|
-
private: z.boolean().optional().describe("Include private projects (default: true)"),
|
|
11
|
-
});
|
|
12
|
-
export const project_by_id_or_name = z
|
|
13
|
-
.object({
|
|
14
|
-
id: z.string().optional().describe("Project ID"),
|
|
15
|
-
name: z.string().optional().describe("Project name"),
|
|
16
|
-
})
|
|
17
|
-
.refine(data => data.id || data.name, {
|
|
18
|
-
message: "Either 'id' or 'name' must be provided",
|
|
19
|
-
});
|
|
20
|
-
export const task_filters = z.object({
|
|
21
|
-
project_id: z.string().optional().describe("Filter by project ID"),
|
|
22
|
-
tag_id: z.string().optional().describe("Filter by tag ID"),
|
|
23
|
-
});
|
|
24
|
-
export const task_by_id = z.object({
|
|
25
|
-
id: z.string().describe("Task ID"),
|
|
26
|
-
});
|
|
27
|
-
export const milestone_filters = z.object({
|
|
28
|
-
project_id: z.string().optional().describe("Filter by project ID"),
|
|
29
|
-
});
|
|
30
|
-
export const milestone_by_id = z.object({
|
|
31
|
-
id: z.string().describe("Milestone ID"),
|
|
32
|
-
});
|
|
33
|
-
export const goal_by_id = z.object({
|
|
34
|
-
id: z.string().describe("Goal ID"),
|
|
35
|
-
});
|
|
36
|
-
export const github_branches = z.object({
|
|
37
|
-
owner: z.string().describe("Repository owner"),
|
|
38
|
-
repo: z.string().describe("Repository name"),
|
|
39
|
-
});
|
|
40
|
-
// Tool definitions
|
|
41
|
-
export const tools = {
|
|
42
|
-
// Projects
|
|
43
|
-
devpad_projects_list: {
|
|
44
|
-
name: "devpad_projects_list",
|
|
45
|
-
description: "List all projects (or only public ones)",
|
|
46
|
-
inputSchema: project_filters,
|
|
47
|
-
execute: async (client, input) => unwrap(await client.projects.list(input)),
|
|
48
|
-
},
|
|
49
|
-
devpad_projects_get: {
|
|
50
|
-
name: "devpad_projects_get",
|
|
51
|
-
description: "Get project by ID or name",
|
|
52
|
-
inputSchema: project_by_id_or_name,
|
|
53
|
-
execute: async (client, input) => unwrap(input.id ? await client.projects.getById(input.id) : await client.projects.getByName(input.name)),
|
|
54
|
-
},
|
|
55
|
-
devpad_projects_upsert: {
|
|
56
|
-
name: "devpad_projects_upsert",
|
|
57
|
-
description: "Create or update a project (set deleted=true to delete)",
|
|
58
|
-
inputSchema: upsert_project,
|
|
59
|
-
execute: async (client, input) => unwrap(await client.projects.upsert(input)),
|
|
60
|
-
},
|
|
61
|
-
devpad_projects_config_save: {
|
|
62
|
-
name: "devpad_projects_config_save",
|
|
63
|
-
description: "Save project configuration",
|
|
64
|
-
inputSchema: save_config_request,
|
|
65
|
-
execute: async (client, input) => {
|
|
66
|
-
unwrap(await client.projects.config.save(input));
|
|
67
|
-
return { success: true };
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
// Tasks
|
|
71
|
-
devpad_tasks_list: {
|
|
72
|
-
name: "devpad_tasks_list",
|
|
73
|
-
description: "List tasks, optionally filtered by project or tag",
|
|
74
|
-
inputSchema: task_filters,
|
|
75
|
-
execute: async (client, input) => unwrap(await client.tasks.list(input)),
|
|
76
|
-
},
|
|
77
|
-
devpad_tasks_get: {
|
|
78
|
-
name: "devpad_tasks_get",
|
|
79
|
-
description: "Get task by ID",
|
|
80
|
-
inputSchema: task_by_id,
|
|
81
|
-
execute: async (client, input) => unwrap(await client.tasks.find(input.id)),
|
|
82
|
-
},
|
|
83
|
-
devpad_tasks_upsert: {
|
|
84
|
-
name: "devpad_tasks_upsert",
|
|
85
|
-
description: "Create or update a task (set deleted=true to delete)",
|
|
86
|
-
inputSchema: upsert_todo,
|
|
87
|
-
execute: async (client, input) => unwrap(await client.tasks.upsert(input)),
|
|
88
|
-
},
|
|
89
|
-
devpad_tasks_save_tags: {
|
|
90
|
-
name: "devpad_tasks_save_tags",
|
|
91
|
-
description: "Save tags for tasks",
|
|
92
|
-
inputSchema: save_tags_request,
|
|
93
|
-
execute: async (client, input) => {
|
|
94
|
-
unwrap(await client.tasks.saveTags(input));
|
|
95
|
-
return { success: true };
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
// Milestones
|
|
99
|
-
devpad_milestones_list: {
|
|
100
|
-
name: "devpad_milestones_list",
|
|
101
|
-
description: "List milestones for authenticated user or by project",
|
|
102
|
-
inputSchema: milestone_filters,
|
|
103
|
-
execute: async (client, input) => unwrap(input.project_id ? await client.milestones.getByProject(input.project_id) : await client.milestones.list()),
|
|
104
|
-
},
|
|
105
|
-
devpad_milestones_get: {
|
|
106
|
-
name: "devpad_milestones_get",
|
|
107
|
-
description: "Get milestone by ID",
|
|
108
|
-
inputSchema: milestone_by_id,
|
|
109
|
-
execute: async (client, input) => unwrap(await client.milestones.find(input.id)),
|
|
110
|
-
},
|
|
111
|
-
devpad_milestones_upsert: {
|
|
112
|
-
name: "devpad_milestones_upsert",
|
|
113
|
-
description: "Create or update a milestone",
|
|
114
|
-
inputSchema: upsert_milestone,
|
|
115
|
-
execute: async (client, input) => unwrap(input.id
|
|
116
|
-
? await client.milestones.update(input.id, {
|
|
117
|
-
name: input.name,
|
|
118
|
-
description: input.description,
|
|
119
|
-
target_time: input.target_time,
|
|
120
|
-
target_version: input.target_version,
|
|
121
|
-
})
|
|
122
|
-
: await client.milestones.create({
|
|
123
|
-
project_id: input.project_id,
|
|
124
|
-
name: input.name,
|
|
125
|
-
description: input.description,
|
|
126
|
-
target_time: input.target_time,
|
|
127
|
-
target_version: input.target_version,
|
|
128
|
-
})),
|
|
129
|
-
},
|
|
130
|
-
// Goals
|
|
131
|
-
devpad_goals_list: {
|
|
132
|
-
name: "devpad_goals_list",
|
|
133
|
-
description: "List goals for authenticated user",
|
|
134
|
-
inputSchema: z.object({}),
|
|
135
|
-
execute: async (client) => unwrap(await client.goals.list()),
|
|
136
|
-
},
|
|
137
|
-
devpad_goals_get: {
|
|
138
|
-
name: "devpad_goals_get",
|
|
139
|
-
description: "Get goal by ID",
|
|
140
|
-
inputSchema: goal_by_id,
|
|
141
|
-
execute: async (client, input) => unwrap(await client.goals.find(input.id)),
|
|
142
|
-
},
|
|
143
|
-
devpad_goals_upsert: {
|
|
144
|
-
name: "devpad_goals_upsert",
|
|
145
|
-
description: "Create or update a goal",
|
|
146
|
-
inputSchema: upsert_goal,
|
|
147
|
-
execute: async (client, input) => unwrap(input.id
|
|
148
|
-
? await client.goals.update(input.id, {
|
|
149
|
-
name: input.name,
|
|
150
|
-
description: input.description,
|
|
151
|
-
target_time: input.target_time,
|
|
152
|
-
})
|
|
153
|
-
: await client.goals.create({
|
|
154
|
-
milestone_id: input.milestone_id,
|
|
155
|
-
name: input.name,
|
|
156
|
-
description: input.description,
|
|
157
|
-
target_time: input.target_time,
|
|
158
|
-
})),
|
|
159
|
-
},
|
|
160
|
-
// Tags
|
|
161
|
-
devpad_tags_list: {
|
|
162
|
-
name: "devpad_tags_list",
|
|
163
|
-
description: "List tags for authenticated user",
|
|
164
|
-
inputSchema: z.object({}),
|
|
165
|
-
execute: async (client) => unwrap(await client.tags.list()),
|
|
166
|
-
},
|
|
167
|
-
// GitHub integration
|
|
168
|
-
devpad_github_repos: {
|
|
169
|
-
name: "devpad_github_repos",
|
|
170
|
-
description: "List GitHub repositories for authenticated user",
|
|
171
|
-
inputSchema: z.object({}),
|
|
172
|
-
execute: async (client) => unwrap(await client.github.repos()),
|
|
173
|
-
},
|
|
174
|
-
devpad_github_branches: {
|
|
175
|
-
name: "devpad_github_branches",
|
|
176
|
-
description: "List branches for a GitHub repository",
|
|
177
|
-
inputSchema: github_branches,
|
|
178
|
-
execute: async (client, input) => unwrap(await client.github.branches(input.owner, input.repo)),
|
|
179
|
-
},
|
|
180
|
-
// Additional project operations
|
|
181
|
-
devpad_projects_delete: {
|
|
182
|
-
name: "devpad_projects_delete",
|
|
183
|
-
description: "Delete a project",
|
|
184
|
-
inputSchema: z.object({
|
|
185
|
-
id: z.string().describe("Project ID"),
|
|
186
|
-
}),
|
|
187
|
-
execute: async (client, input) => {
|
|
188
|
-
const project = unwrap(await client.projects.find(input.id));
|
|
189
|
-
if (!project)
|
|
190
|
-
throw new Error(`Project ${input.id} not found`);
|
|
191
|
-
unwrap(await client.projects.deleteProject(project));
|
|
192
|
-
return { success: true };
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
devpad_projects_history: {
|
|
196
|
-
name: "devpad_projects_history",
|
|
197
|
-
description: "Get project history",
|
|
198
|
-
inputSchema: z.object({
|
|
199
|
-
project_id: z.string().describe("Project ID"),
|
|
200
|
-
}),
|
|
201
|
-
execute: async (client, input) => unwrap(await client.projects.history(input.project_id)),
|
|
202
|
-
},
|
|
203
|
-
devpad_projects_specification: {
|
|
204
|
-
name: "devpad_projects_specification",
|
|
205
|
-
description: "Fetch project specification from GitHub",
|
|
206
|
-
inputSchema: z.object({
|
|
207
|
-
project_id: z.string().describe("Project ID"),
|
|
208
|
-
}),
|
|
209
|
-
execute: async (client, input) => unwrap(await client.projects.specification(input.project_id)),
|
|
210
|
-
},
|
|
211
|
-
devpad_projects_config_load: {
|
|
212
|
-
name: "devpad_projects_config_load",
|
|
213
|
-
description: "Load project configuration",
|
|
214
|
-
inputSchema: z.object({
|
|
215
|
-
project_id: z.string().describe("Project ID"),
|
|
216
|
-
}),
|
|
217
|
-
execute: async (client, input) => unwrap(await client.projects.config.load(input.project_id)),
|
|
218
|
-
},
|
|
219
|
-
// Additional milestone operations
|
|
220
|
-
devpad_milestones_delete: {
|
|
221
|
-
name: "devpad_milestones_delete",
|
|
222
|
-
description: "Delete a milestone",
|
|
223
|
-
inputSchema: z.object({
|
|
224
|
-
id: z.string().describe("Milestone ID"),
|
|
225
|
-
}),
|
|
226
|
-
execute: async (client, input) => unwrap(await client.milestones.delete(input.id)),
|
|
227
|
-
},
|
|
228
|
-
devpad_milestones_goals: {
|
|
229
|
-
name: "devpad_milestones_goals",
|
|
230
|
-
description: "Get goals for a milestone",
|
|
231
|
-
inputSchema: z.object({
|
|
232
|
-
id: z.string().describe("Milestone ID"),
|
|
233
|
-
}),
|
|
234
|
-
execute: async (client, input) => unwrap(await client.milestones.goals(input.id)),
|
|
235
|
-
},
|
|
236
|
-
// Additional goal operations
|
|
237
|
-
devpad_goals_delete: {
|
|
238
|
-
name: "devpad_goals_delete",
|
|
239
|
-
description: "Delete a goal",
|
|
240
|
-
inputSchema: z.object({
|
|
241
|
-
id: z.string().describe("Goal ID"),
|
|
242
|
-
}),
|
|
243
|
-
execute: async (client, input) => unwrap(await client.goals.delete(input.id)),
|
|
244
|
-
},
|
|
245
|
-
// Additional task operations
|
|
246
|
-
devpad_tasks_delete: {
|
|
247
|
-
name: "devpad_tasks_delete",
|
|
248
|
-
description: "Delete a task",
|
|
249
|
-
inputSchema: z.object({
|
|
250
|
-
id: z.string().describe("Task ID"),
|
|
251
|
-
}),
|
|
252
|
-
execute: async (client, input) => {
|
|
253
|
-
const task = unwrap(await client.tasks.find(input.id));
|
|
254
|
-
if (!task)
|
|
255
|
-
throw new Error(`Task ${input.id} not found`);
|
|
256
|
-
unwrap(await client.tasks.deleteTask(task));
|
|
257
|
-
return { success: true };
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
devpad_tasks_history: {
|
|
261
|
-
name: "devpad_tasks_history",
|
|
262
|
-
description: "Get task history",
|
|
263
|
-
inputSchema: z.object({
|
|
264
|
-
task_id: z.string().describe("Task ID"),
|
|
265
|
-
}),
|
|
266
|
-
execute: async (client, input) => unwrap(await client.tasks.history.get(input.task_id)),
|
|
267
|
-
},
|
|
268
|
-
// User operations
|
|
269
|
-
devpad_user_history: {
|
|
270
|
-
name: "devpad_user_history",
|
|
271
|
-
description: "Get user activity history",
|
|
272
|
-
inputSchema: z.object({}),
|
|
273
|
-
execute: async (client) => unwrap(await client.user.history()),
|
|
274
|
-
},
|
|
275
|
-
devpad_user_preferences: {
|
|
276
|
-
name: "devpad_user_preferences",
|
|
277
|
-
description: "Update user preferences",
|
|
278
|
-
inputSchema: z.object({
|
|
279
|
-
id: z.string().describe("User ID"),
|
|
280
|
-
task_view: z.enum(["list", "grid"]).describe("Task view preference"),
|
|
281
|
-
}),
|
|
282
|
-
execute: async (client, input) => unwrap(await client.user.preferences(input)),
|
|
283
|
-
},
|
|
284
|
-
devpad_blog_posts_list: {
|
|
285
|
-
name: "devpad_blog_posts_list",
|
|
286
|
-
description: "List blog posts with optional filters",
|
|
287
|
-
inputSchema: z.object({
|
|
288
|
-
category: z.string().optional().describe("Filter by category"),
|
|
289
|
-
tag: z.string().optional().describe("Filter by tag"),
|
|
290
|
-
project: z.string().optional().describe("Filter by project ID"),
|
|
291
|
-
status: z.enum(["draft", "published"]).optional().describe("Filter by status"),
|
|
292
|
-
archived: z.boolean().optional().describe("Filter by archived state"),
|
|
293
|
-
limit: z.number().optional().describe("Max posts to return"),
|
|
294
|
-
offset: z.number().optional().describe("Offset for pagination"),
|
|
295
|
-
sort: z.string().optional().describe("Sort order"),
|
|
296
|
-
}),
|
|
297
|
-
execute: async (client, input) => unwrap(await client.blog.posts.list(input)),
|
|
298
|
-
},
|
|
299
|
-
devpad_blog_posts_get: {
|
|
300
|
-
name: "devpad_blog_posts_get",
|
|
301
|
-
description: "Get a blog post by slug",
|
|
302
|
-
inputSchema: z.object({
|
|
303
|
-
slug: z.string().describe("Post slug"),
|
|
304
|
-
}),
|
|
305
|
-
execute: async (client, input) => unwrap(await client.blog.posts.getBySlug(input.slug)),
|
|
306
|
-
},
|
|
307
|
-
devpad_blog_posts_create: {
|
|
308
|
-
name: "devpad_blog_posts_create",
|
|
309
|
-
description: "Create a new blog post",
|
|
310
|
-
inputSchema: z.object({
|
|
311
|
-
title: z.string().describe("Post title"),
|
|
312
|
-
content: z.string().describe("Post content"),
|
|
313
|
-
format: z.enum(["markdown", "html"]).describe("Content format"),
|
|
314
|
-
slug: z.string().optional().describe("Custom slug"),
|
|
315
|
-
category: z.string().optional().describe("Category name"),
|
|
316
|
-
tags: z.array(z.string()).optional().describe("Tag names"),
|
|
317
|
-
description: z.string().optional().describe("Post description"),
|
|
318
|
-
publish_at: z.string().optional().describe("Scheduled publish date (ISO string)"),
|
|
319
|
-
project_ids: z.array(z.string()).optional().describe("Associated project IDs"),
|
|
320
|
-
archived: z.boolean().optional().describe("Whether post is archived"),
|
|
321
|
-
}),
|
|
322
|
-
execute: async (client, input) => unwrap(await client.blog.posts.create(input)),
|
|
323
|
-
},
|
|
324
|
-
devpad_blog_posts_update: {
|
|
325
|
-
name: "devpad_blog_posts_update",
|
|
326
|
-
description: "Update a blog post by UUID",
|
|
327
|
-
inputSchema: z.object({
|
|
328
|
-
uuid: z.string().describe("Post UUID"),
|
|
329
|
-
title: z.string().optional().describe("Post title"),
|
|
330
|
-
content: z.string().optional().describe("Post content"),
|
|
331
|
-
format: z.enum(["markdown", "html"]).optional().describe("Content format"),
|
|
332
|
-
slug: z.string().optional().describe("Custom slug"),
|
|
333
|
-
category: z.string().optional().describe("Category name"),
|
|
334
|
-
tags: z.array(z.string()).optional().describe("Tag names"),
|
|
335
|
-
description: z.string().optional().describe("Post description"),
|
|
336
|
-
publish_at: z.string().optional().describe("Scheduled publish date (ISO string)"),
|
|
337
|
-
project_ids: z.array(z.string()).optional().describe("Associated project IDs"),
|
|
338
|
-
archived: z.boolean().optional().describe("Whether post is archived"),
|
|
339
|
-
}),
|
|
340
|
-
execute: async (client, input) => {
|
|
341
|
-
const { uuid, ...data } = input;
|
|
342
|
-
return unwrap(await client.blog.posts.update(uuid, data));
|
|
343
|
-
},
|
|
344
|
-
},
|
|
345
|
-
devpad_blog_posts_delete: {
|
|
346
|
-
name: "devpad_blog_posts_delete",
|
|
347
|
-
description: "Delete a blog post by UUID",
|
|
348
|
-
inputSchema: z.object({
|
|
349
|
-
uuid: z.string().describe("Post UUID"),
|
|
350
|
-
}),
|
|
351
|
-
execute: async (client, input) => unwrap(await client.blog.posts.delete(input.uuid)),
|
|
352
|
-
},
|
|
353
|
-
devpad_blog_tags_list: {
|
|
354
|
-
name: "devpad_blog_tags_list",
|
|
355
|
-
description: "List all blog tags with post counts",
|
|
356
|
-
inputSchema: z.object({}),
|
|
357
|
-
execute: async (client) => unwrap(await client.blog.tags.list()),
|
|
358
|
-
},
|
|
359
|
-
devpad_blog_categories_tree: {
|
|
360
|
-
name: "devpad_blog_categories_tree",
|
|
361
|
-
description: "Get the blog category tree",
|
|
362
|
-
inputSchema: z.object({}),
|
|
363
|
-
execute: async (client) => unwrap(await client.blog.categories.tree()),
|
|
364
|
-
},
|
|
365
|
-
devpad_blog_categories_create: {
|
|
366
|
-
name: "devpad_blog_categories_create",
|
|
367
|
-
description: "Create a blog category",
|
|
368
|
-
inputSchema: z.object({
|
|
369
|
-
name: z.string().describe("Category name"),
|
|
370
|
-
parent: z.string().optional().describe("Parent category name"),
|
|
371
|
-
}),
|
|
372
|
-
execute: async (client, input) => unwrap(await client.blog.categories.create(input)),
|
|
373
|
-
},
|
|
374
|
-
devpad_blog_tokens_list: {
|
|
375
|
-
name: "devpad_blog_tokens_list",
|
|
376
|
-
description: "List blog access tokens",
|
|
377
|
-
inputSchema: z.object({}),
|
|
378
|
-
execute: async (client) => unwrap(await client.blog.tokens.list()),
|
|
379
|
-
},
|
|
380
|
-
devpad_blog_tokens_create: {
|
|
381
|
-
name: "devpad_blog_tokens_create",
|
|
382
|
-
description: "Create a blog access token",
|
|
383
|
-
inputSchema: z.object({
|
|
384
|
-
name: z.string().describe("Token name"),
|
|
385
|
-
note: z.string().optional().describe("Optional note"),
|
|
386
|
-
}),
|
|
387
|
-
execute: async (client, input) => unwrap(await client.blog.tokens.create(input)),
|
|
388
|
-
},
|
|
389
|
-
devpad_media_profiles_list: {
|
|
390
|
-
name: "devpad_media_profiles_list",
|
|
391
|
-
description: "List media profiles",
|
|
392
|
-
inputSchema: z.object({}),
|
|
393
|
-
execute: async (client) => unwrap(await client.media.profiles.list()),
|
|
394
|
-
},
|
|
395
|
-
devpad_media_profiles_create: {
|
|
396
|
-
name: "devpad_media_profiles_create",
|
|
397
|
-
description: "Create a media profile",
|
|
398
|
-
inputSchema: z.object({
|
|
399
|
-
name: z.string().describe("Profile name"),
|
|
400
|
-
slug: z.string().describe("Profile slug"),
|
|
401
|
-
}),
|
|
402
|
-
execute: async (client, input) => unwrap(await client.media.profiles.create(input)),
|
|
403
|
-
},
|
|
404
|
-
devpad_media_profiles_get: {
|
|
405
|
-
name: "devpad_media_profiles_get",
|
|
406
|
-
description: "Get a media profile by ID",
|
|
407
|
-
inputSchema: z.object({
|
|
408
|
-
id: z.string().describe("Profile ID"),
|
|
409
|
-
}),
|
|
410
|
-
execute: async (client, input) => unwrap(await client.media.profiles.get(input.id)),
|
|
411
|
-
},
|
|
412
|
-
devpad_media_profiles_update: {
|
|
413
|
-
name: "devpad_media_profiles_update",
|
|
414
|
-
description: "Update a media profile by ID",
|
|
415
|
-
inputSchema: z.object({
|
|
416
|
-
id: z.string().describe("Profile ID"),
|
|
417
|
-
name: z.string().optional().describe("Profile name"),
|
|
418
|
-
slug: z.string().optional().describe("Profile slug"),
|
|
419
|
-
}),
|
|
420
|
-
execute: async (client, input) => {
|
|
421
|
-
const { id, ...data } = input;
|
|
422
|
-
return unwrap(await client.media.profiles.update(id, data));
|
|
423
|
-
},
|
|
424
|
-
},
|
|
425
|
-
devpad_media_profiles_delete: {
|
|
426
|
-
name: "devpad_media_profiles_delete",
|
|
427
|
-
description: "Delete a media profile by ID",
|
|
428
|
-
inputSchema: z.object({
|
|
429
|
-
id: z.string().describe("Profile ID"),
|
|
430
|
-
}),
|
|
431
|
-
execute: async (client, input) => unwrap(await client.media.profiles.delete(input.id)),
|
|
432
|
-
},
|
|
433
|
-
devpad_media_connections_list: {
|
|
434
|
-
name: "devpad_media_connections_list",
|
|
435
|
-
description: "List connections for a media profile",
|
|
436
|
-
inputSchema: z.object({
|
|
437
|
-
profile_id: z.string().describe("Profile ID"),
|
|
438
|
-
}),
|
|
439
|
-
execute: async (client, input) => unwrap(await client.media.connections.list(input.profile_id)),
|
|
440
|
-
},
|
|
441
|
-
devpad_media_connections_refresh: {
|
|
442
|
-
name: "devpad_media_connections_refresh",
|
|
443
|
-
description: "Refresh a media connection",
|
|
444
|
-
inputSchema: z.object({
|
|
445
|
-
account_id: z.string().describe("Account/connection ID"),
|
|
446
|
-
}),
|
|
447
|
-
execute: async (client, input) => unwrap(await client.media.connections.refresh(input.account_id)),
|
|
448
|
-
},
|
|
449
|
-
devpad_media_timeline_get: {
|
|
450
|
-
name: "devpad_media_timeline_get",
|
|
451
|
-
description: "Get media timeline for a user",
|
|
452
|
-
inputSchema: z.object({
|
|
453
|
-
user_id: z.string().describe("User ID"),
|
|
454
|
-
from: z.string().optional().describe("Start date (ISO string)"),
|
|
455
|
-
to: z.string().optional().describe("End date (ISO string)"),
|
|
456
|
-
}),
|
|
457
|
-
execute: async (client, input) => {
|
|
458
|
-
const { user_id, ...params } = input;
|
|
459
|
-
return unwrap(await client.media.timeline.get(user_id, params));
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
};
|
|
463
|
-
// Helper to convert Zod schema to JSON Schema for MCP
|
|
464
|
-
export function zodToMCPSchema(schema) {
|
|
465
|
-
// This will be imported from zod-to-json-schema for MCP server
|
|
466
|
-
// For now, returning a placeholder
|
|
467
|
-
return schema;
|
|
468
|
-
}
|
|
469
|
-
// Get all tool names
|
|
470
|
-
export const toolNames = Object.keys(tools);
|
|
471
|
-
// Get tool by name
|
|
472
|
-
export function getTool(name) {
|
|
473
|
-
return tools[name];
|
|
474
|
-
}
|