@tool-bridge/server 0.1.0 → 0.3.0

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 (107) hide show
  1. package/dist/airtable-V6446SVY.js +792 -0
  2. package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
  3. package/dist/amap-TTTVB6WS.js +755 -0
  4. package/dist/anthropic-JH3RA363.js +224 -0
  5. package/dist/apify-ETNN7ITU.js +262 -0
  6. package/dist/brave_search-3DDR2MMB.js +322 -0
  7. package/dist/chunk-CSJEZHQO.js +252 -0
  8. package/dist/chunk-JLTYA2B3.js +20121 -0
  9. package/dist/chunk-K7FVSFUX.js +333 -0
  10. package/dist/{chunk-6SMIQ6QU.js → chunk-KGYJEEBI.js} +2770 -21574
  11. package/dist/circleci-MX3TX3HC.js +409 -0
  12. package/dist/clerk-MRPORVF4.js +1036 -0
  13. package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
  14. package/dist/cohere-GPECP66S.js +197 -0
  15. package/dist/confluence-BN7LZ6BC.js +436 -0
  16. package/dist/convertapi-SBEOFOFQ.js +161 -0
  17. package/dist/currencyapi-P2YY7Y7P.js +306 -0
  18. package/dist/deepseek-MWB3NYIN.js +205 -0
  19. package/dist/docker_hub-3JSCIGQ3.js +946 -0
  20. package/dist/dropbox-RFIBDAXO.js +1308 -0
  21. package/dist/dub-YVP57ELQ.js +706 -0
  22. package/dist/e2b-NFSUHTZR.js +305 -0
  23. package/dist/exa-KTDY6IV3.js +360 -0
  24. package/dist/fal_ai-OCUENLNQ.js +405 -0
  25. package/dist/feishu-5CWBQ7E5.js +225 -0
  26. package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
  27. package/dist/figma-YULGANSA.js +798 -0
  28. package/dist/firehydrant-2V6YSYAP.js +573 -0
  29. package/dist/fixer-LTCDB3CJ.js +171 -0
  30. package/dist/fly-IXPKMAML.js +478 -0
  31. package/dist/front-KRFB4M5X.js +379 -0
  32. package/dist/geocodio-VVURKYHQ.js +236 -0
  33. package/dist/ghost-6J2RIOUB.js +341 -0
  34. package/dist/github-5Z6KQRYH.js +5410 -0
  35. package/dist/gmail-KU4NZ7VA.js +1894 -0
  36. package/dist/googlecalendar-X44DFFXG.js +2539 -0
  37. package/dist/googledocs-WSGLPKSF.js +1322 -0
  38. package/dist/grafana-4PKSSDXY.js +817 -0
  39. package/dist/graphhopper-DF65ZNGK.js +336 -0
  40. package/dist/index.d.ts +181 -2
  41. package/dist/index.js +2 -1
  42. package/dist/ip2proxy-UCAQ5P2J.js +118 -0
  43. package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
  44. package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
  45. package/dist/jina_ai-MRHPCSV5.js +119 -0
  46. package/dist/jira-EG7ZPOIW.js +627 -0
  47. package/dist/langsmith-FNO3RCOZ.js +597 -0
  48. package/dist/lemlist-SN6BJHSG.js +298 -0
  49. package/dist/linear-H3VU4PSD.js +2163 -0
  50. package/dist/logsnag-OY2JJT2H.js +167 -0
  51. package/dist/main.js +246 -2
  52. package/dist/mattermost-C5SQ7PGD.js +320 -0
  53. package/dist/mem0-LMLE5BFC.js +567 -0
  54. package/dist/memos-UWFAMBZC.js +781 -0
  55. package/dist/metabase-SRYDSDJ6.js +365 -0
  56. package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
  57. package/dist/mother_duck-CPGOFEXE.js +322 -0
  58. package/dist/ngrok-CDJFBSOM.js +375 -0
  59. package/dist/notes-DIVFH3P3.js +109 -0
  60. package/dist/notion-HGDKS4HK.js +945 -0
  61. package/dist/open_exchange_rates-COHHYJDD.js +216 -0
  62. package/dist/openai-4TRT66GW.js +795 -0
  63. package/dist/opengraph_io-YKVW4PXI.js +377 -0
  64. package/dist/openrouter-6CV7B7V5.js +444 -0
  65. package/dist/outline-YWDUK5F7.js +604 -0
  66. package/dist/paddle-MEU7HWDZ.js +464 -0
  67. package/dist/perplexity-MRQUDBIC.js +238 -0
  68. package/dist/pinecone-JI7X2TAF.js +599 -0
  69. package/dist/pipedrive-6JQPAW23.js +453 -0
  70. package/dist/polar-7BF56CMC.js +400 -0
  71. package/dist/posthog-YPU5ADEN.js +3462 -0
  72. package/dist/postmark-BEU5OFKU.js +441 -0
  73. package/dist/prerender-UT5GOOZH.js +180 -0
  74. package/dist/pubmed-3SGOE24Q.js +1052 -0
  75. package/dist/railway-CEK4GLRQ.js +452 -0
  76. package/dist/readwise-DXQUQU67.js +482 -0
  77. package/dist/render-7TGAU5AW.js +473 -0
  78. package/dist/replicate-VICFSQ5A.js +347 -0
  79. package/dist/resend-3E76WK3O.js +100 -0
  80. package/dist/rootly-36GY46BY.js +345 -0
  81. package/dist/scrapfly-VDVUYAHX.js +289 -0
  82. package/dist/scrapingbee-3KTPMAVY.js +247 -0
  83. package/dist/screenshot_fyi-LKG62C3J.js +116 -0
  84. package/dist/semantic_scholar-4WREECYO.js +626 -0
  85. package/dist/sentry-HUQTGXOV.js +1139 -0
  86. package/dist/shodan-SGRKU4KS.js +303 -0
  87. package/dist/shopify-YCZ4L5HT.js +620 -0
  88. package/dist/stripe-OEBKMELB.js +583 -0
  89. package/dist/supabase-I3DBY7L4.js +937 -0
  90. package/dist/tavily-B2YHCNRD.js +349 -0
  91. package/dist/telegram-2VYJELZX.js +1773 -0
  92. package/dist/telnyx-HHXD3CXL.js +237 -0
  93. package/dist/todoist-PHFDEEIS.js +672 -0
  94. package/dist/trello-WUSAK6YN.js +1091 -0
  95. package/dist/turso-FW56U2B3.js +432 -0
  96. package/dist/twilio-M5JI7XHA.js +321 -0
  97. package/dist/umami-HAYODRC4.js +411 -0
  98. package/dist/unsplash-EDPTNEHJ.js +364 -0
  99. package/dist/upstash_redis-GC2CLIWD.js +299 -0
  100. package/dist/uptimerobot-XMSNYLIT.js +481 -0
  101. package/dist/v2ex-KU4ECD65.js +672 -0
  102. package/dist/vercel-THPCEFHW.js +1096 -0
  103. package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
  104. package/dist/wordpress-O6TQEQNF.js +822 -0
  105. package/dist/workos-A3VHHWI3.js +681 -0
  106. package/dist/zhihu-BJAI64YJ.js +273 -0
  107. package/package.json +5 -4
@@ -0,0 +1,672 @@
1
+ import {
2
+ createProviderPlugin,
3
+ guardedFetch,
4
+ requireApiKey,
5
+ upstreamError
6
+ } from "./chunk-CSJEZHQO.js";
7
+ import "./chunk-K7FVSFUX.js";
8
+ import {
9
+ TBError,
10
+ external_exports
11
+ } from "./chunk-JLTYA2B3.js";
12
+ import "./chunk-MLKGABMK.js";
13
+
14
+ // ../plugins/src/todoist/api.ts
15
+ var SERVICE = "todoist";
16
+ var API_BASE = "https://api.todoist.com/api/v1";
17
+ var USER_PATH = "/user";
18
+ function text(value) {
19
+ if (typeof value !== "string") return void 0;
20
+ const trimmed = value.trim();
21
+ return trimmed === "" ? void 0 : trimmed;
22
+ }
23
+ function record(value) {
24
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
25
+ }
26
+ function compact(input) {
27
+ return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
28
+ }
29
+ function requireText(value, field) {
30
+ const result = text(value);
31
+ if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
32
+ return result;
33
+ }
34
+ function stringArray(value) {
35
+ if (!Array.isArray(value)) return void 0;
36
+ const items = value.map((item) => text(item)).filter((item) => item !== void 0);
37
+ return items.length > 0 ? items : void 0;
38
+ }
39
+ function requireRecord(value, label) {
40
+ const result = record(value);
41
+ if (result === void 0) throw new TBError("unavailable", `${label}\u4E0D\u662F\u5BF9\u8C61`, { retryable: true });
42
+ return result;
43
+ }
44
+ function errorMessage(status, payload) {
45
+ const body = record(payload);
46
+ const direct = text(body?.error) ?? text(body?.error_description) ?? text(body?.message) ?? text(body?.detail);
47
+ if (direct !== void 0) return direct;
48
+ if (Array.isArray(body?.errors)) {
49
+ const first = body.errors.find((item) => text(item) !== void 0);
50
+ if (first !== void 0) return first;
51
+ }
52
+ return `todoist request failed with ${status}`;
53
+ }
54
+ async function request(ctx, input) {
55
+ const url = new URL(input.path.replace(/^\/+/, ""), `${API_BASE}/`);
56
+ for (const [key, value] of Object.entries(input.query ?? {})) {
57
+ if (value === void 0) continue;
58
+ url.searchParams.set(key, Array.isArray(value) ? value.join(",") : String(value));
59
+ }
60
+ const hasBody = input.body !== void 0;
61
+ const response = await guardedFetch(url.toString(), {
62
+ method: input.method ?? "GET",
63
+ headers: {
64
+ accept: "application/json",
65
+ authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`,
66
+ ...hasBody ? { "content-type": "application/json" } : {}
67
+ },
68
+ body: hasBody ? JSON.stringify(input.body) : void 0
69
+ });
70
+ const raw = await response.text();
71
+ let payload = {};
72
+ if (raw !== "") {
73
+ try {
74
+ payload = JSON.parse(raw);
75
+ } catch {
76
+ if (response.ok) {
77
+ throw new TBError("unavailable", "Todoist \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
78
+ }
79
+ payload = { message: raw };
80
+ }
81
+ }
82
+ if (!response.ok) throw upstreamError(response.status, errorMessage(response.status, payload));
83
+ return payload;
84
+ }
85
+ function results(payload, label) {
86
+ const body = requireRecord(payload, `${label} \u54CD\u5E94`);
87
+ if (!Array.isArray(body.results)) {
88
+ throw new TBError("unavailable", `${label} \u54CD\u5E94\u7F3A\u5C11 results`, { retryable: true });
89
+ }
90
+ return body.results.map((item) => record(item)).filter((item) => item !== void 0);
91
+ }
92
+ function nextCursor(payload) {
93
+ return text(record(payload)?.next_cursor) ?? null;
94
+ }
95
+ function idValue(value) {
96
+ if (typeof value === "number" && Number.isInteger(value)) return value;
97
+ return text(value);
98
+ }
99
+ function normalizeComment(payload) {
100
+ const comment = requireRecord(payload, "todoist comment");
101
+ return compact({
102
+ ...comment,
103
+ attachment: record(comment.attachment) ?? record(comment.file_attachment)
104
+ });
105
+ }
106
+ function commentAttachment(value) {
107
+ const attachment = record(value);
108
+ if (attachment === void 0) return void 0;
109
+ return compact({
110
+ file_url: text(attachment.fileUrl),
111
+ file_name: text(attachment.fileName),
112
+ file_type: text(attachment.fileType),
113
+ resource_type: text(attachment.resourceType)
114
+ });
115
+ }
116
+ function notifyUserIds(value) {
117
+ if (!Array.isArray(value)) return void 0;
118
+ const ids = value.filter((item) => typeof item === "number" && Number.isInteger(item));
119
+ return ids.length > 0 ? ids : void 0;
120
+ }
121
+ function taskBody(input, isCreate) {
122
+ return compact({
123
+ content: isCreate ? requireText(input.content, "content") : text(input.content),
124
+ description: input.description,
125
+ project_id: text(input.projectId),
126
+ section_id: text(input.sectionId),
127
+ parent_id: text(input.parentId),
128
+ order: input.order,
129
+ labels: stringArray(input.labels),
130
+ priority: input.priority,
131
+ assignee_id: input.assigneeId,
132
+ due_string: text(input.dueString),
133
+ due_date: text(input.dueDate),
134
+ due_datetime: text(input.dueDatetime),
135
+ due_lang: text(input.dueLang),
136
+ duration: input.duration,
137
+ duration_unit: input.durationUnit,
138
+ deadline_date: input.deadlineDate,
139
+ child_order: input.childOrder,
140
+ is_collapsed: input.isCollapsed,
141
+ day_order: input.dayOrder
142
+ });
143
+ }
144
+ async function getCurrentUser(_input, ctx) {
145
+ return { user: requireRecord(await request(ctx, { path: USER_PATH }), "todoist user \u54CD\u5E94") };
146
+ }
147
+ async function listProjects(input, ctx) {
148
+ const payload = await request(ctx, {
149
+ path: "/projects",
150
+ query: {
151
+ folder_id: idValue(input.folderId),
152
+ workspace_id: idValue(input.workspaceId),
153
+ cursor: text(input.cursor),
154
+ limit: input.limit
155
+ }
156
+ });
157
+ return { projects: results(payload, "todoist projects"), nextCursor: nextCursor(payload) };
158
+ }
159
+ async function getProject(input, ctx) {
160
+ const path = `/projects/${encodeURIComponent(requireText(input.projectId, "projectId"))}`;
161
+ return { project: requireRecord(await request(ctx, { path }), "todoist project \u54CD\u5E94") };
162
+ }
163
+ async function createProject(input, ctx) {
164
+ const payload = await request(ctx, {
165
+ path: "/projects",
166
+ method: "POST",
167
+ body: compact({
168
+ name: requireText(input.name, "name"),
169
+ description: text(input.description),
170
+ // 上游显式区分 null(建成顶层项目)与"未给"(不带这个键)。
171
+ parent_id: input.parentId === null ? null : text(input.parentId),
172
+ color: input.color,
173
+ is_favorite: input.isFavorite,
174
+ view_style: text(input.viewStyle),
175
+ workspace_id: idValue(input.workspaceId)
176
+ })
177
+ });
178
+ return { project: requireRecord(payload, "todoist project \u54CD\u5E94") };
179
+ }
180
+ async function updateProject(input, ctx) {
181
+ const payload = await request(ctx, {
182
+ path: `/projects/${encodeURIComponent(requireText(input.projectId, "projectId"))}`,
183
+ method: "POST",
184
+ // 更新是三态字段:未给不改、null 清空、有值改成它 —— 故原样透传。
185
+ body: compact({
186
+ name: input.name,
187
+ description: input.description,
188
+ color: input.color,
189
+ is_favorite: input.isFavorite,
190
+ view_style: input.viewStyle,
191
+ child_order: input.childOrder,
192
+ is_collapsed: input.isCollapsed,
193
+ folder_id: input.folderId
194
+ })
195
+ });
196
+ return { project: requireRecord(payload, "todoist project \u54CD\u5E94") };
197
+ }
198
+ async function listSections(input, ctx) {
199
+ const payload = await request(ctx, {
200
+ path: "/sections",
201
+ query: { project_id: text(input.projectId), cursor: text(input.cursor), limit: input.limit }
202
+ });
203
+ return { sections: results(payload, "todoist sections"), nextCursor: nextCursor(payload) };
204
+ }
205
+ async function getSection(input, ctx) {
206
+ const path = `/sections/${encodeURIComponent(requireText(input.sectionId, "sectionId"))}`;
207
+ return { section: requireRecord(await request(ctx, { path }), "todoist section \u54CD\u5E94") };
208
+ }
209
+ async function createSection(input, ctx) {
210
+ const payload = await request(ctx, {
211
+ path: "/sections",
212
+ method: "POST",
213
+ body: compact({
214
+ name: requireText(input.name, "name"),
215
+ project_id: requireText(input.projectId, "projectId"),
216
+ order: input.order
217
+ })
218
+ });
219
+ return { section: requireRecord(payload, "todoist section \u54CD\u5E94") };
220
+ }
221
+ async function updateSection(input, ctx) {
222
+ const payload = await request(ctx, {
223
+ path: `/sections/${encodeURIComponent(requireText(input.sectionId, "sectionId"))}`,
224
+ method: "POST",
225
+ body: compact({
226
+ name: input.name,
227
+ section_order: input.sectionOrder,
228
+ is_collapsed: input.isCollapsed
229
+ })
230
+ });
231
+ return { section: requireRecord(payload, "todoist section \u54CD\u5E94") };
232
+ }
233
+ async function listTasks(input, ctx) {
234
+ const payload = await request(ctx, {
235
+ path: "/tasks",
236
+ query: {
237
+ project_id: text(input.projectId),
238
+ section_id: text(input.sectionId),
239
+ parent_id: text(input.parentId),
240
+ label: text(input.label),
241
+ ids: stringArray(input.ids),
242
+ goal_id: text(input.goalId),
243
+ cursor: text(input.cursor),
244
+ limit: input.limit
245
+ }
246
+ });
247
+ return { tasks: results(payload, "todoist tasks"), nextCursor: nextCursor(payload) };
248
+ }
249
+ async function getTask(input, ctx) {
250
+ const path = `/tasks/${encodeURIComponent(requireText(input.taskId, "taskId"))}`;
251
+ return { task: requireRecord(await request(ctx, { path }), "todoist task \u54CD\u5E94") };
252
+ }
253
+ async function createTask(input, ctx) {
254
+ const payload = await request(ctx, { path: "/tasks", method: "POST", body: taskBody(input, true) });
255
+ return { task: requireRecord(payload, "todoist task \u54CD\u5E94") };
256
+ }
257
+ async function updateTask(input, ctx) {
258
+ const payload = await request(ctx, {
259
+ path: `/tasks/${encodeURIComponent(requireText(input.taskId, "taskId"))}`,
260
+ method: "POST",
261
+ body: taskBody(input, false)
262
+ });
263
+ return { task: requireRecord(payload, "todoist task \u54CD\u5E94") };
264
+ }
265
+ async function closeTask(input, ctx) {
266
+ await request(ctx, {
267
+ path: `/tasks/${encodeURIComponent(requireText(input.taskId, "taskId"))}/close`,
268
+ method: "POST"
269
+ });
270
+ return { success: true };
271
+ }
272
+ async function listComments(input, ctx) {
273
+ const payload = await request(ctx, {
274
+ path: "/comments",
275
+ query: {
276
+ task_id: text(input.taskId),
277
+ project_id: text(input.projectId),
278
+ cursor: text(input.cursor),
279
+ limit: input.limit
280
+ }
281
+ });
282
+ return {
283
+ comments: results(payload, "todoist comments").map((comment) => normalizeComment(comment)),
284
+ nextCursor: nextCursor(payload)
285
+ };
286
+ }
287
+ async function getComment(input, ctx) {
288
+ const path = `/comments/${encodeURIComponent(requireText(input.commentId, "commentId"))}`;
289
+ return { comment: normalizeComment(await request(ctx, { path })) };
290
+ }
291
+ async function createComment(input, ctx) {
292
+ const payload = await request(ctx, {
293
+ path: "/comments",
294
+ method: "POST",
295
+ body: compact({
296
+ content: requireText(input.content, "content"),
297
+ task_id: text(input.taskId),
298
+ project_id: text(input.projectId),
299
+ attachment: commentAttachment(input.attachment),
300
+ uids_to_notify: notifyUserIds(input.uidsToNotify)
301
+ })
302
+ });
303
+ return { comment: normalizeComment(payload) };
304
+ }
305
+ async function updateComment(input, ctx) {
306
+ const payload = await request(ctx, {
307
+ path: `/comments/${encodeURIComponent(requireText(input.commentId, "commentId"))}`,
308
+ method: "POST",
309
+ // 更新评论只改正文,且正文必填(生成的 schema 里它是 optional,断言留在本层)。
310
+ body: { content: requireText(input.content, "content") }
311
+ });
312
+ return { comment: normalizeComment(payload) };
313
+ }
314
+ async function listLabels(input, ctx) {
315
+ const payload = await request(ctx, {
316
+ path: "/labels",
317
+ query: { cursor: text(input.cursor), limit: input.limit }
318
+ });
319
+ return { labels: results(payload, "todoist labels"), nextCursor: nextCursor(payload) };
320
+ }
321
+
322
+ // ../plugins/src/todoist/schema.ts
323
+ var getCurrentUserInput = external_exports.strictObject({}).describe("The input payload for this action.");
324
+ var getCurrentUserOutput = external_exports.strictObject({
325
+ user: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
326
+ });
327
+ var listProjectsInput = external_exports.strictObject({
328
+ folderId: external_exports.union([external_exports.int().describe("Optional Todoist folder ID to filter projects by."), external_exports.string().min(1).describe("Optional Todoist folder ID to filter projects by.")]).describe("Optional Todoist folder ID to filter projects by.").optional(),
329
+ workspaceId: external_exports.union([external_exports.int().describe("Optional Todoist workspace ID to filter projects by."), external_exports.string().min(1).describe("Optional Todoist workspace ID to filter projects by.")]).describe("Optional Todoist workspace ID to filter projects by.").optional(),
330
+ cursor: external_exports.string().min(1).describe("Opaque pagination cursor returned by a previous Todoist response.").optional(),
331
+ limit: external_exports.int().min(1).max(200).describe("Maximum number of Todoist results to return in one page.").optional()
332
+ }).describe("The input payload for this action.");
333
+ var listProjectsOutput = external_exports.strictObject({
334
+ projects: external_exports.array(external_exports.looseObject({}).describe("A Todoist project.")).describe("The Todoist projects returned for the page.").optional(),
335
+ nextCursor: external_exports.string().describe("Cursor for the next page, or null when no further page exists.").nullable().optional()
336
+ });
337
+ var getProjectInput = external_exports.strictObject({
338
+ projectId: external_exports.string().min(1).describe("Todoist project ID.").optional()
339
+ }).describe("The input payload for this action.");
340
+ var getProjectOutput = external_exports.strictObject({
341
+ project: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
342
+ });
343
+ var createProjectInput = external_exports.strictObject({
344
+ name: external_exports.string().min(1).describe("Todoist project name."),
345
+ description: external_exports.string().describe("Todoist project description.").optional(),
346
+ parentId: external_exports.string().describe("Parent project ID, or null where the API supports clearing it.").nullable().optional(),
347
+ color: external_exports.union([external_exports.enum(["berry_red", "red", "orange", "yellow", "olive_green", "lime_green", "green", "mint_green", "teal", "sky_blue", "light_blue", "blue", "grape", "violet", "lavender", "magenta", "salmon", "charcoal", "grey", "taupe"]).describe("Todoist color name."), external_exports.int().min(30).max(49).describe("Todoist legacy numeric color code.")]).describe("Todoist color value as a named palette entry or legacy numeric code.").optional(),
348
+ isFavorite: external_exports.boolean().describe("Whether the project is a favorite.").optional(),
349
+ viewStyle: external_exports.enum(["list", "board", "calendar"]).describe("Todoist project view style.").optional(),
350
+ workspaceId: external_exports.union([external_exports.int().describe("Todoist workspace ID for creating a workspace-scoped project."), external_exports.string().min(1).describe("Todoist workspace ID for creating a workspace-scoped project.")]).describe("Todoist workspace ID for creating a workspace-scoped project.").optional()
351
+ }).describe("The input payload for this action.");
352
+ var createProjectOutput = external_exports.strictObject({
353
+ project: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
354
+ });
355
+ var updateProjectInput = external_exports.strictObject({
356
+ projectId: external_exports.string().min(1).describe("Todoist project ID."),
357
+ name: external_exports.string().describe("Updated project name.").nullable().optional(),
358
+ description: external_exports.string().describe("Updated project description.").nullable().optional(),
359
+ color: external_exports.union([external_exports.enum(["berry_red", "red", "orange", "yellow", "olive_green", "lime_green", "green", "mint_green", "teal", "sky_blue", "light_blue", "blue", "grape", "violet", "lavender", "magenta", "salmon", "charcoal", "grey", "taupe"]).describe("Todoist color name."), external_exports.int().min(30).max(49).describe("Todoist legacy numeric color code.")]).describe("Todoist color value as a named palette entry or legacy numeric code.").nullable().optional(),
360
+ isFavorite: external_exports.boolean().describe("Updated favorite flag.").nullable().optional(),
361
+ viewStyle: external_exports.enum(["list", "board", "calendar"]).describe("Todoist project view style.").nullable().optional(),
362
+ childOrder: external_exports.int().describe("Updated project order among sibling projects.").nullable().optional(),
363
+ isCollapsed: external_exports.boolean().describe("Updated collapsed state of the project.").nullable().optional(),
364
+ folderId: external_exports.int().describe("Updated folder ID for a workspace project.").nullable().optional()
365
+ }).describe("The input payload for this action.");
366
+ var updateProjectOutput = external_exports.strictObject({
367
+ project: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
368
+ });
369
+ var listSectionsInput = external_exports.strictObject({
370
+ projectId: external_exports.string().min(1).describe("Optional Todoist project ID.").optional(),
371
+ cursor: external_exports.string().min(1).describe("Opaque pagination cursor returned by a previous Todoist response.").optional(),
372
+ limit: external_exports.int().min(1).max(200).describe("Maximum number of Todoist results to return in one page.").optional()
373
+ }).describe("The input payload for this action.");
374
+ var listSectionsOutput = external_exports.strictObject({
375
+ sections: external_exports.array(external_exports.looseObject({}).describe("A Todoist section.")).describe("The Todoist sections returned for the page.").optional(),
376
+ nextCursor: external_exports.string().describe("Cursor for the next page, or null when no further page exists.").nullable().optional()
377
+ });
378
+ var getSectionInput = external_exports.strictObject({
379
+ sectionId: external_exports.string().min(1).describe("Todoist section ID.").optional()
380
+ }).describe("The input payload for this action.");
381
+ var getSectionOutput = external_exports.strictObject({
382
+ section: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
383
+ });
384
+ var createSectionInput = external_exports.strictObject({
385
+ projectId: external_exports.string().min(1).describe("Todoist project ID that will own the section."),
386
+ name: external_exports.string().min(1).describe("Todoist section name."),
387
+ order: external_exports.int().describe("Optional section order within the project.").optional()
388
+ }).describe("The input payload for this action.");
389
+ var createSectionOutput = external_exports.strictObject({
390
+ section: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
391
+ });
392
+ var updateSectionInput = external_exports.strictObject({
393
+ sectionId: external_exports.string().min(1).describe("Todoist section ID."),
394
+ name: external_exports.string().describe("Updated section name.").nullable().optional(),
395
+ sectionOrder: external_exports.int().describe("Updated section order.").nullable().optional(),
396
+ isCollapsed: external_exports.boolean().describe("Updated collapsed state of the section.").nullable().optional()
397
+ }).describe("The input payload for this action.");
398
+ var updateSectionOutput = external_exports.strictObject({
399
+ section: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
400
+ });
401
+ var listTasksInput = external_exports.strictObject({
402
+ projectId: external_exports.string().min(1).describe("Optional Todoist project ID filter.").optional(),
403
+ sectionId: external_exports.string().min(1).describe("Optional Todoist section ID filter.").optional(),
404
+ parentId: external_exports.string().min(1).describe("Optional Todoist parent task ID filter.").optional(),
405
+ label: external_exports.string().min(1).describe("Optional Todoist label name filter.").optional(),
406
+ ids: external_exports.array(external_exports.string().min(1)).min(1).describe("Explicit Todoist task IDs to fetch.").optional(),
407
+ goalId: external_exports.string().min(1).describe("Optional Todoist goal ID filter.").optional(),
408
+ cursor: external_exports.string().min(1).describe("Opaque pagination cursor returned by a previous Todoist response.").optional(),
409
+ limit: external_exports.int().min(1).max(200).describe("Maximum number of Todoist results to return in one page.").optional()
410
+ }).describe("The input payload for this action.");
411
+ var listTasksOutput = external_exports.strictObject({
412
+ tasks: external_exports.array(external_exports.looseObject({}).describe("A Todoist task.")).describe("The Todoist tasks returned for the page.").optional(),
413
+ nextCursor: external_exports.string().describe("Cursor for the next page, or null when no further page exists.").nullable().optional()
414
+ });
415
+ var getTaskInput = external_exports.strictObject({
416
+ taskId: external_exports.string().min(1).describe("Todoist task ID.").optional()
417
+ }).describe("The input payload for this action.");
418
+ var getTaskOutput = external_exports.strictObject({
419
+ task: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
420
+ });
421
+ var createTaskInput = external_exports.strictObject({
422
+ content: external_exports.string().min(1).describe("Todoist task title."),
423
+ description: external_exports.string().describe("Todoist task description.").optional(),
424
+ projectId: external_exports.string().min(1).describe("Project ID that will own the task.").optional(),
425
+ sectionId: external_exports.string().min(1).describe("Section ID that will own the task.").optional(),
426
+ parentId: external_exports.string().min(1).describe("Parent task ID.").optional(),
427
+ order: external_exports.int().describe("Task order.").optional(),
428
+ labels: external_exports.array(external_exports.string().min(1)).min(1).describe("Todoist label names to attach.").optional(),
429
+ priority: external_exports.int().min(1).max(4).describe("Todoist priority from 1 to 4.").optional(),
430
+ assigneeId: external_exports.int().describe("Todoist user ID to assign, or null where supported.").nullable().optional(),
431
+ dueString: external_exports.string().min(1).describe("Natural language due date string.").optional(),
432
+ dueDate: external_exports.iso.date().describe("Due date in YYYY-MM-DD format.").optional(),
433
+ dueDatetime: external_exports.iso.datetime({ offset: true }).describe("Due date-time in RFC 3339 form.").optional(),
434
+ dueLang: external_exports.string().min(1).describe("Language code used to parse the due string.").optional(),
435
+ duration: external_exports.int().describe("Duration amount.").optional(),
436
+ durationUnit: external_exports.enum(["minute", "day"]).describe("Todoist duration unit.").optional(),
437
+ deadlineDate: external_exports.iso.date().describe("Deadline date in YYYY-MM-DD format.").optional(),
438
+ childOrder: external_exports.int().describe("Task order among siblings.").optional(),
439
+ isCollapsed: external_exports.boolean().describe("Whether subtasks are collapsed.").optional(),
440
+ dayOrder: external_exports.int().describe("Task order in Today and Upcoming.").optional()
441
+ }).describe("The input payload for this action.");
442
+ var createTaskOutput = external_exports.strictObject({
443
+ task: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
444
+ });
445
+ var updateTaskInput = external_exports.strictObject({
446
+ taskId: external_exports.string().min(1).describe("Todoist task ID."),
447
+ content: external_exports.string().min(1).describe("Todoist task title.").optional(),
448
+ description: external_exports.string().describe("Todoist task description.").optional(),
449
+ projectId: external_exports.string().min(1).describe("Project ID that will own the task.").optional(),
450
+ sectionId: external_exports.string().min(1).describe("Section ID that will own the task.").optional(),
451
+ parentId: external_exports.string().min(1).describe("Parent task ID.").optional(),
452
+ order: external_exports.int().describe("Task order.").optional(),
453
+ labels: external_exports.array(external_exports.string().min(1)).min(1).describe("Todoist label names to attach.").optional(),
454
+ priority: external_exports.int().min(1).max(4).describe("Todoist priority from 1 to 4.").optional(),
455
+ assigneeId: external_exports.int().describe("Todoist user ID to assign, or null where supported.").nullable().optional(),
456
+ dueString: external_exports.string().min(1).describe("Natural language due date string.").optional(),
457
+ dueDate: external_exports.iso.date().describe("Due date in YYYY-MM-DD format.").optional(),
458
+ dueDatetime: external_exports.iso.datetime({ offset: true }).describe("Due date-time in RFC 3339 form.").optional(),
459
+ dueLang: external_exports.string().min(1).describe("Language code used to parse the due string.").optional(),
460
+ duration: external_exports.int().describe("Duration amount.").optional(),
461
+ durationUnit: external_exports.enum(["minute", "day"]).describe("Todoist duration unit.").optional(),
462
+ deadlineDate: external_exports.iso.date().describe("Deadline date in YYYY-MM-DD format.").optional(),
463
+ childOrder: external_exports.int().describe("Task order among siblings.").optional(),
464
+ isCollapsed: external_exports.boolean().describe("Whether subtasks are collapsed.").optional(),
465
+ dayOrder: external_exports.int().describe("Task order in Today and Upcoming.").optional()
466
+ }).describe("The input payload for this action.");
467
+ var updateTaskOutput = external_exports.strictObject({
468
+ task: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
469
+ });
470
+ var closeTaskInput = external_exports.strictObject({
471
+ taskId: external_exports.string().min(1).describe("Todoist task ID.").optional()
472
+ }).describe("The input payload for this action.");
473
+ var closeTaskOutput = external_exports.strictObject({
474
+ success: external_exports.literal(true).optional()
475
+ });
476
+ var listCommentsInput = external_exports.strictObject({
477
+ taskId: external_exports.string().min(1).describe("Optional task ID filter.").optional(),
478
+ projectId: external_exports.string().min(1).describe("Optional project ID filter.").optional(),
479
+ cursor: external_exports.string().min(1).describe("Opaque pagination cursor returned by a previous Todoist response.").optional(),
480
+ limit: external_exports.int().min(1).max(200).describe("Maximum number of Todoist results to return in one page.").optional()
481
+ }).describe("The input payload for this action.");
482
+ var listCommentsOutput = external_exports.strictObject({
483
+ comments: external_exports.array(external_exports.looseObject({}).describe("A Todoist comment.")).describe("The Todoist comments returned for the page.").optional(),
484
+ nextCursor: external_exports.string().describe("Cursor for the next page, or null when no further page exists.").nullable().optional()
485
+ });
486
+ var getCommentInput = external_exports.strictObject({
487
+ commentId: external_exports.string().min(1).describe("Todoist comment ID.").optional()
488
+ }).describe("The input payload for this action.");
489
+ var getCommentOutput = external_exports.strictObject({
490
+ comment: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
491
+ });
492
+ var createCommentInput = external_exports.strictObject({
493
+ content: external_exports.string().min(1).describe("Todoist comment content."),
494
+ taskId: external_exports.string().min(1).describe("Task ID that owns the comment.").optional(),
495
+ projectId: external_exports.string().min(1).describe("Project ID that owns the comment.").optional(),
496
+ attachment: external_exports.strictObject({
497
+ fileUrl: external_exports.url().describe("Attachment download URL.").optional(),
498
+ fileName: external_exports.string().describe("Attachment file name.").optional(),
499
+ fileType: external_exports.string().describe("Attachment MIME type.").optional(),
500
+ resourceType: external_exports.string().describe("Attachment resource type.").optional()
501
+ }).describe("Todoist comment attachment metadata.").optional(),
502
+ uidsToNotify: external_exports.array(external_exports.int().describe("A Todoist user ID.")).min(1).describe("Todoist user IDs to notify.").optional()
503
+ }).describe("The input payload for this action.");
504
+ var createCommentOutput = external_exports.strictObject({
505
+ comment: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
506
+ });
507
+ var updateCommentInput = external_exports.strictObject({
508
+ commentId: external_exports.string().min(1).describe("Todoist comment ID.").optional(),
509
+ content: external_exports.string().min(1).describe("Updated Todoist comment content.").optional()
510
+ }).describe("The input payload for this action.");
511
+ var updateCommentOutput = external_exports.strictObject({
512
+ comment: external_exports.looseObject({}).describe("The raw Todoist object returned by the API.").optional()
513
+ });
514
+ var listLabelsInput = external_exports.strictObject({
515
+ cursor: external_exports.string().min(1).describe("Opaque pagination cursor returned by a previous Todoist response.").optional(),
516
+ limit: external_exports.int().min(1).max(200).describe("Maximum number of Todoist results to return in one page.").optional()
517
+ }).describe("The input payload for this action.");
518
+ var listLabelsOutput = external_exports.strictObject({
519
+ labels: external_exports.array(external_exports.looseObject({}).describe("A Todoist label.")).describe("The Todoist labels returned for the page.").optional(),
520
+ nextCursor: external_exports.string().describe("Cursor for the next page, or null when no further page exists.").nullable().optional()
521
+ });
522
+ var todoistActions = {
523
+ get_current_user: {
524
+ description: "Get the current Todoist user profile.",
525
+ effect: "read",
526
+ inputSchema: getCurrentUserInput,
527
+ outputSchema: external_exports.toJSONSchema(getCurrentUserOutput, { io: "output", unrepresentable: "any" })
528
+ },
529
+ list_projects: {
530
+ description: "List Todoist projects visible to the connected account.",
531
+ effect: "read",
532
+ inputSchema: listProjectsInput,
533
+ outputSchema: external_exports.toJSONSchema(listProjectsOutput, { io: "output", unrepresentable: "any" })
534
+ },
535
+ get_project: {
536
+ description: "Get one Todoist project by ID.",
537
+ effect: "read",
538
+ inputSchema: getProjectInput,
539
+ outputSchema: external_exports.toJSONSchema(getProjectOutput, { io: "output", unrepresentable: "any" })
540
+ },
541
+ create_project: {
542
+ description: "Create a Todoist project.",
543
+ effect: "write",
544
+ inputSchema: createProjectInput,
545
+ outputSchema: external_exports.toJSONSchema(createProjectOutput, { io: "output", unrepresentable: "any" })
546
+ },
547
+ update_project: {
548
+ description: "Update a Todoist project.",
549
+ effect: "write",
550
+ inputSchema: updateProjectInput,
551
+ outputSchema: external_exports.toJSONSchema(updateProjectOutput, { io: "output", unrepresentable: "any" })
552
+ },
553
+ list_sections: {
554
+ description: "List Todoist sections, optionally scoped to a project.",
555
+ effect: "read",
556
+ inputSchema: listSectionsInput,
557
+ outputSchema: external_exports.toJSONSchema(listSectionsOutput, { io: "output", unrepresentable: "any" })
558
+ },
559
+ get_section: {
560
+ description: "Get one Todoist section by ID.",
561
+ effect: "read",
562
+ inputSchema: getSectionInput,
563
+ outputSchema: external_exports.toJSONSchema(getSectionOutput, { io: "output", unrepresentable: "any" })
564
+ },
565
+ create_section: {
566
+ description: "Create a Todoist section.",
567
+ effect: "write",
568
+ inputSchema: createSectionInput,
569
+ outputSchema: external_exports.toJSONSchema(createSectionOutput, { io: "output", unrepresentable: "any" })
570
+ },
571
+ update_section: {
572
+ description: "Update a Todoist section.",
573
+ effect: "write",
574
+ inputSchema: updateSectionInput,
575
+ outputSchema: external_exports.toJSONSchema(updateSectionOutput, { io: "output", unrepresentable: "any" })
576
+ },
577
+ list_tasks: {
578
+ description: "List Todoist tasks using the API v1 filters.",
579
+ effect: "read",
580
+ inputSchema: listTasksInput,
581
+ outputSchema: external_exports.toJSONSchema(listTasksOutput, { io: "output", unrepresentable: "any" })
582
+ },
583
+ get_task: {
584
+ description: "Get one Todoist task by ID.",
585
+ effect: "read",
586
+ inputSchema: getTaskInput,
587
+ outputSchema: external_exports.toJSONSchema(getTaskOutput, { io: "output", unrepresentable: "any" })
588
+ },
589
+ create_task: {
590
+ description: "Create a Todoist task.",
591
+ effect: "write",
592
+ inputSchema: createTaskInput,
593
+ outputSchema: external_exports.toJSONSchema(createTaskOutput, { io: "output", unrepresentable: "any" })
594
+ },
595
+ update_task: {
596
+ description: "Update a Todoist task.",
597
+ effect: "write",
598
+ inputSchema: updateTaskInput,
599
+ outputSchema: external_exports.toJSONSchema(updateTaskOutput, { io: "output", unrepresentable: "any" })
600
+ },
601
+ close_task: {
602
+ description: "Close a Todoist task.",
603
+ effect: "write",
604
+ inputSchema: closeTaskInput,
605
+ outputSchema: external_exports.toJSONSchema(closeTaskOutput, { io: "output", unrepresentable: "any" })
606
+ },
607
+ list_comments: {
608
+ description: "List Todoist comments by task or project.",
609
+ effect: "read",
610
+ inputSchema: listCommentsInput,
611
+ outputSchema: external_exports.toJSONSchema(listCommentsOutput, { io: "output", unrepresentable: "any" })
612
+ },
613
+ get_comment: {
614
+ description: "Get one Todoist comment by ID.",
615
+ effect: "read",
616
+ inputSchema: getCommentInput,
617
+ outputSchema: external_exports.toJSONSchema(getCommentOutput, { io: "output", unrepresentable: "any" })
618
+ },
619
+ create_comment: {
620
+ description: "Create a Todoist comment on a task or project.",
621
+ effect: "write",
622
+ inputSchema: createCommentInput,
623
+ outputSchema: external_exports.toJSONSchema(createCommentOutput, { io: "output", unrepresentable: "any" })
624
+ },
625
+ update_comment: {
626
+ description: "Update a Todoist comment.",
627
+ effect: "write",
628
+ inputSchema: updateCommentInput,
629
+ outputSchema: external_exports.toJSONSchema(updateCommentOutput, { io: "output", unrepresentable: "any" })
630
+ },
631
+ list_labels: {
632
+ description: "List Todoist labels visible to the connected account.",
633
+ effect: "read",
634
+ inputSchema: listLabelsInput,
635
+ outputSchema: external_exports.toJSONSchema(listLabelsOutput, { io: "output", unrepresentable: "any" })
636
+ }
637
+ };
638
+
639
+ // ../plugins/src/todoist/index.ts
640
+ function createTodoistPlugin() {
641
+ return createProviderPlugin({
642
+ description: "Todoist",
643
+ actions: todoistActions,
644
+ credentialProbe: "get_current_user",
645
+ handlers: {
646
+ get_current_user: getCurrentUser,
647
+ list_projects: listProjects,
648
+ get_project: getProject,
649
+ create_project: createProject,
650
+ update_project: updateProject,
651
+ list_sections: listSections,
652
+ get_section: getSection,
653
+ create_section: createSection,
654
+ update_section: updateSection,
655
+ list_tasks: listTasks,
656
+ get_task: getTask,
657
+ create_task: createTask,
658
+ update_task: updateTask,
659
+ close_task: closeTask,
660
+ list_comments: listComments,
661
+ get_comment: getComment,
662
+ create_comment: createComment,
663
+ update_comment: updateComment,
664
+ list_labels: listLabels
665
+ }
666
+ });
667
+ }
668
+ var todoist_default = createTodoistPlugin();
669
+ export {
670
+ createTodoistPlugin,
671
+ todoist_default as default
672
+ };