@doist/todoist-ai 8.3.0 → 8.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,OAAO,EAEH,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EAGhB,MAAM,kBAAkB,CAAA;AAgIzB;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EAClB,aAAa,EACb,OAAO,EACP,QAAa,GAChB,EAAE;IACC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB,aA4GA;AAED,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,OAAO,EAEH,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EAGhB,MAAM,kBAAkB,CAAA;AAkIzB;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EAClB,aAAa,EACb,OAAO,EACP,QAAa,GAChB,EAAE;IACC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB,aA+GA;AAED,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,CAAA"}
@@ -1,9 +1,10 @@
1
1
  import { TodoistApi } from '@doist/todoist-api-typescript';
2
- import { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
2
+ import { ContentBlock, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
3
3
  import { z } from 'zod';
4
4
  type ExecuteResult<Output extends z.ZodRawShape> = Promise<{
5
5
  textContent?: string;
6
6
  structuredContent?: z.infer<z.ZodObject<Output>>;
7
+ contentItems?: ContentBlock[];
7
8
  }>;
8
9
  type RequiredToolAnnotations = ToolAnnotations & {
9
10
  readOnlyHint: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"todoist-tool.d.ts","sourceRoot":"","sources":["../src/todoist-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,KAAK,aAAa,CAAC,MAAM,SAAS,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;CACnD,CAAC,CAAA;AAEF,KAAK,uBAAuB,GAAG,eAAe,GAAG;IAC7C,YAAY,EAAE,OAAO,CAAA;IACrB,eAAe,EAAE,OAAO,CAAA;IACxB,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,KAAK,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC,WAAW,EAAE,MAAM,SAAS,CAAC,CAAC,WAAW,IAAI;IAC3E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,YAAY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H,WAAW,EAAE,MAAM,CAAA;IAEnB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,WAAW,EAAE,uBAAuB,CAAA;IAEpC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE/B;;;;;;;;OAQG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,KAAK,aAAa,CAAC,MAAM,CAAC,CAAA;CAC7F,CAAA;AAED,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,48 @@
1
+ import { ContentBlock } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod';
3
+ declare const viewAttachment: {
4
+ name: "view-attachment";
5
+ description: string;
6
+ parameters: {
7
+ fileUrl: z.ZodString;
8
+ };
9
+ outputSchema: {
10
+ fileName: z.ZodOptional<z.ZodString>;
11
+ fileType: z.ZodOptional<z.ZodString>;
12
+ fileSize: z.ZodOptional<z.ZodNumber>;
13
+ contentDelivery: z.ZodEnum<{
14
+ text: "text";
15
+ image: "image";
16
+ embedded_resource: "embedded_resource";
17
+ metadata_only: "metadata_only";
18
+ }>;
19
+ };
20
+ annotations: {
21
+ readOnlyHint: true;
22
+ destructiveHint: false;
23
+ idempotentHint: true;
24
+ };
25
+ execute({ fileUrl }: {
26
+ fileUrl: string;
27
+ }, client: import('@doist/todoist-api-typescript').TodoistApi): Promise<{
28
+ textContent: string;
29
+ structuredContent: {
30
+ fileName: string | undefined;
31
+ fileType: string;
32
+ fileSize: number;
33
+ contentDelivery: "metadata_only";
34
+ };
35
+ contentItems?: undefined;
36
+ } | {
37
+ textContent: string;
38
+ structuredContent: {
39
+ fileName: string | undefined;
40
+ fileType: string;
41
+ fileSize: number;
42
+ contentDelivery: "text" | "image" | "embedded_resource";
43
+ };
44
+ contentItems: ContentBlock[];
45
+ }>;
46
+ };
47
+ export { viewAttachment };
48
+ //# sourceMappingURL=view-attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-attachment.d.ts","sourceRoot":"","sources":["../../src/tools/view-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA8FvB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiG2C,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -25,6 +25,7 @@ export declare const ToolNames: {
25
25
  readonly ADD_COMMENTS: "add-comments";
26
26
  readonly UPDATE_COMMENTS: "update-comments";
27
27
  readonly FIND_COMMENTS: "find-comments";
28
+ readonly VIEW_ATTACHMENT: "view-attachment";
28
29
  readonly FIND_PROJECT_COLLABORATORS: "find-project-collaborators";
29
30
  readonly MANAGE_ASSIGNMENTS: "manage-assignments";
30
31
  readonly FIND_ACTIVITY: "find-activity";
@@ -1 +1 @@
1
- {"version":3,"file":"tool-names.d.ts","sourceRoot":"","sources":["../../src/utils/tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DZ,CAAA;AAGV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA"}
1
+ {"version":3,"file":"tool-names.d.ts","sourceRoot":"","sources":["../../src/utils/tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DZ,CAAA;AAGV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-ai",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -55,7 +55,7 @@
55
55
  "prepare": "husky"
56
56
  },
57
57
  "dependencies": {
58
- "@doist/todoist-api-typescript": "7.1.1",
58
+ "@doist/todoist-api-typescript": "7.2.0",
59
59
  "date-fns": "4.1.0",
60
60
  "dompurify": "3.3.2",
61
61
  "dotenv": "17.3.1",
@@ -52,6 +52,7 @@ import { updateProjects } from '../src/tools/update-projects.js'
52
52
  import { updateSections } from '../src/tools/update-sections.js'
53
53
  import { updateTasks } from '../src/tools/update-tasks.js'
54
54
  import { userInfo } from '../src/tools/user-info.js'
55
+ import { viewAttachment } from '../src/tools/view-attachment.js'
55
56
 
56
57
  config()
57
58
 
@@ -63,7 +64,7 @@ type ExecutableTool = {
63
64
  // biome-ignore lint/suspicious/noExplicitAny: tools have varying parameter schemas
64
65
  args: any,
65
66
  client: TodoistApi,
66
- ) => Promise<{ textContent?: string; structuredContent?: unknown }>
67
+ ) => Promise<{ textContent?: string; structuredContent?: unknown; contentItems?: unknown[] }>
67
68
  }
68
69
 
69
70
  const tools: Record<string, ExecutableTool> = {
@@ -102,6 +103,7 @@ const tools: Record<string, ExecutableTool> = {
102
103
  'update-sections': updateSections,
103
104
  'update-tasks': updateTasks,
104
105
  'user-info': userInfo,
106
+ 'view-attachment': viewAttachment,
105
107
  }
106
108
 
107
109
  function printUsage() {
@@ -190,6 +192,28 @@ async function main() {
190
192
  console.log('\nStructured output:')
191
193
  console.log(JSON.stringify(result.structuredContent, null, 2))
192
194
  }
195
+
196
+ if (result.contentItems?.length) {
197
+ console.log(`\nContent items: ${result.contentItems.length}`)
198
+ for (const item of result.contentItems) {
199
+ const entry = item as Record<string, unknown>
200
+ if (entry.type === 'image') {
201
+ const data = entry.data as string
202
+ console.log(
203
+ ` [image] ${entry.mimeType} (${Math.round((data.length * 0.75) / 1024)}KB base64)`,
204
+ )
205
+ } else if (entry.type === 'text') {
206
+ const text = entry.text as string
207
+ console.log(` [text] ${text.length > 200 ? `${text.slice(0, 200)}...` : text}`)
208
+ } else if (entry.type === 'resource') {
209
+ const resource = entry.resource as Record<string, unknown>
210
+ const blob = resource.blob as string
211
+ console.log(
212
+ ` [resource] ${resource.mimeType} (${Math.round((blob.length * 0.75) / 1024)}KB base64)`,
213
+ )
214
+ }
215
+ }
216
+ }
193
217
  } catch (error) {
194
218
  console.error('Tool execution failed:', error)
195
219
  process.exit(1)