@jbctechsolutions/mcp-office365 2.5.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.
Files changed (339) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +667 -0
  3. package/dist/applescript/account-repository.d.ts +30 -0
  4. package/dist/applescript/account-repository.d.ts.map +1 -0
  5. package/dist/applescript/account-repository.js +38 -0
  6. package/dist/applescript/account-repository.js.map +1 -0
  7. package/dist/applescript/account-scripts.d.ts +21 -0
  8. package/dist/applescript/account-scripts.d.ts.map +1 -0
  9. package/dist/applescript/account-scripts.js +180 -0
  10. package/dist/applescript/account-scripts.js.map +1 -0
  11. package/dist/applescript/calendar-manager.d.ts +44 -0
  12. package/dist/applescript/calendar-manager.d.ts.map +1 -0
  13. package/dist/applescript/calendar-manager.js +92 -0
  14. package/dist/applescript/calendar-manager.js.map +1 -0
  15. package/dist/applescript/calendar-writer.d.ts +36 -0
  16. package/dist/applescript/calendar-writer.d.ts.map +1 -0
  17. package/dist/applescript/calendar-writer.js +94 -0
  18. package/dist/applescript/calendar-writer.js.map +1 -0
  19. package/dist/applescript/content-readers.d.ts +114 -0
  20. package/dist/applescript/content-readers.d.ts.map +1 -0
  21. package/dist/applescript/content-readers.js +328 -0
  22. package/dist/applescript/content-readers.js.map +1 -0
  23. package/dist/applescript/executor.d.ts +60 -0
  24. package/dist/applescript/executor.d.ts.map +1 -0
  25. package/dist/applescript/executor.js +173 -0
  26. package/dist/applescript/executor.js.map +1 -0
  27. package/dist/applescript/index.d.ts +20 -0
  28. package/dist/applescript/index.d.ts.map +1 -0
  29. package/dist/applescript/index.js +29 -0
  30. package/dist/applescript/index.js.map +1 -0
  31. package/dist/applescript/mail-sender.d.ts +38 -0
  32. package/dist/applescript/mail-sender.d.ts.map +1 -0
  33. package/dist/applescript/mail-sender.js +67 -0
  34. package/dist/applescript/mail-sender.js.map +1 -0
  35. package/dist/applescript/parser.d.ts +235 -0
  36. package/dist/applescript/parser.d.ts.map +1 -0
  37. package/dist/applescript/parser.js +496 -0
  38. package/dist/applescript/parser.js.map +1 -0
  39. package/dist/applescript/repository.d.ts +64 -0
  40. package/dist/applescript/repository.d.ts.map +1 -0
  41. package/dist/applescript/repository.js +444 -0
  42. package/dist/applescript/repository.js.map +1 -0
  43. package/dist/applescript/scripts.d.ts +265 -0
  44. package/dist/applescript/scripts.d.ts.map +1 -0
  45. package/dist/applescript/scripts.js +1483 -0
  46. package/dist/applescript/scripts.js.map +1 -0
  47. package/dist/approval/hash.d.ts +87 -0
  48. package/dist/approval/hash.d.ts.map +1 -0
  49. package/dist/approval/hash.js +102 -0
  50. package/dist/approval/hash.js.map +1 -0
  51. package/dist/approval/index.d.ts +13 -0
  52. package/dist/approval/index.d.ts.map +1 -0
  53. package/dist/approval/index.js +7 -0
  54. package/dist/approval/index.js.map +1 -0
  55. package/dist/approval/token-manager.d.ts +51 -0
  56. package/dist/approval/token-manager.d.ts.map +1 -0
  57. package/dist/approval/token-manager.js +111 -0
  58. package/dist/approval/token-manager.js.map +1 -0
  59. package/dist/approval/types.d.ts +44 -0
  60. package/dist/approval/types.d.ts.map +1 -0
  61. package/dist/approval/types.js +6 -0
  62. package/dist/approval/types.js.map +1 -0
  63. package/dist/cli.d.ts +30 -0
  64. package/dist/cli.d.ts.map +1 -0
  65. package/dist/cli.js +143 -0
  66. package/dist/cli.js.map +1 -0
  67. package/dist/config.d.ts +27 -0
  68. package/dist/config.d.ts.map +1 -0
  69. package/dist/config.js +42 -0
  70. package/dist/config.js.map +1 -0
  71. package/dist/database/connection.d.ts +77 -0
  72. package/dist/database/connection.d.ts.map +1 -0
  73. package/dist/database/connection.js +130 -0
  74. package/dist/database/connection.js.map +1 -0
  75. package/dist/database/index.d.ts +11 -0
  76. package/dist/database/index.d.ts.map +1 -0
  77. package/dist/database/index.js +11 -0
  78. package/dist/database/index.js.map +1 -0
  79. package/dist/database/queries.d.ts +93 -0
  80. package/dist/database/queries.d.ts.map +1 -0
  81. package/dist/database/queries.js +430 -0
  82. package/dist/database/queries.js.map +1 -0
  83. package/dist/database/repository.d.ts +198 -0
  84. package/dist/database/repository.d.ts.map +1 -0
  85. package/dist/database/repository.js +199 -0
  86. package/dist/database/repository.js.map +1 -0
  87. package/dist/graph/attachments.d.ts +72 -0
  88. package/dist/graph/attachments.d.ts.map +1 -0
  89. package/dist/graph/attachments.js +207 -0
  90. package/dist/graph/attachments.js.map +1 -0
  91. package/dist/graph/auth/config.d.ts +34 -0
  92. package/dist/graph/auth/config.d.ts.map +1 -0
  93. package/dist/graph/auth/config.js +78 -0
  94. package/dist/graph/auth/config.js.map +1 -0
  95. package/dist/graph/auth/device-code-flow.d.ts +55 -0
  96. package/dist/graph/auth/device-code-flow.d.ts.map +1 -0
  97. package/dist/graph/auth/device-code-flow.js +180 -0
  98. package/dist/graph/auth/device-code-flow.js.map +1 -0
  99. package/dist/graph/auth/index.d.ts +13 -0
  100. package/dist/graph/auth/index.d.ts.map +1 -0
  101. package/dist/graph/auth/index.js +13 -0
  102. package/dist/graph/auth/index.js.map +1 -0
  103. package/dist/graph/auth/token-cache.d.ts +41 -0
  104. package/dist/graph/auth/token-cache.d.ts.map +1 -0
  105. package/dist/graph/auth/token-cache.js +105 -0
  106. package/dist/graph/auth/token-cache.js.map +1 -0
  107. package/dist/graph/client/batch.d.ts +38 -0
  108. package/dist/graph/client/batch.d.ts.map +1 -0
  109. package/dist/graph/client/batch.js +33 -0
  110. package/dist/graph/client/batch.js.map +1 -0
  111. package/dist/graph/client/cache.d.ts +64 -0
  112. package/dist/graph/client/cache.d.ts.map +1 -0
  113. package/dist/graph/client/cache.js +108 -0
  114. package/dist/graph/client/cache.js.map +1 -0
  115. package/dist/graph/client/graph-client.d.ts +630 -0
  116. package/dist/graph/client/graph-client.d.ts.map +1 -0
  117. package/dist/graph/client/graph-client.js +1771 -0
  118. package/dist/graph/client/graph-client.js.map +1 -0
  119. package/dist/graph/client/index.d.ts +12 -0
  120. package/dist/graph/client/index.d.ts.map +1 -0
  121. package/dist/graph/client/index.js +12 -0
  122. package/dist/graph/client/index.js.map +1 -0
  123. package/dist/graph/content-readers.d.ts +106 -0
  124. package/dist/graph/content-readers.d.ts.map +1 -0
  125. package/dist/graph/content-readers.js +321 -0
  126. package/dist/graph/content-readers.js.map +1 -0
  127. package/dist/graph/index.d.ts +18 -0
  128. package/dist/graph/index.d.ts.map +1 -0
  129. package/dist/graph/index.js +23 -0
  130. package/dist/graph/index.js.map +1 -0
  131. package/dist/graph/mailbox-adapter.d.ts +30 -0
  132. package/dist/graph/mailbox-adapter.d.ts.map +1 -0
  133. package/dist/graph/mailbox-adapter.js +59 -0
  134. package/dist/graph/mailbox-adapter.js.map +1 -0
  135. package/dist/graph/mappers/contact-mapper.d.ts +14 -0
  136. package/dist/graph/mappers/contact-mapper.d.ts.map +1 -0
  137. package/dist/graph/mappers/contact-mapper.js +20 -0
  138. package/dist/graph/mappers/contact-mapper.js.map +1 -0
  139. package/dist/graph/mappers/email-mapper.d.ts +14 -0
  140. package/dist/graph/mappers/email-mapper.d.ts.map +1 -0
  141. package/dist/graph/mappers/email-mapper.js +44 -0
  142. package/dist/graph/mappers/email-mapper.js.map +1 -0
  143. package/dist/graph/mappers/event-mapper.d.ts +14 -0
  144. package/dist/graph/mappers/event-mapper.d.ts.map +1 -0
  145. package/dist/graph/mappers/event-mapper.js +31 -0
  146. package/dist/graph/mappers/event-mapper.js.map +1 -0
  147. package/dist/graph/mappers/folder-mapper.d.ts +22 -0
  148. package/dist/graph/mappers/folder-mapper.d.ts.map +1 -0
  149. package/dist/graph/mappers/folder-mapper.js +51 -0
  150. package/dist/graph/mappers/folder-mapper.js.map +1 -0
  151. package/dist/graph/mappers/index.d.ts +16 -0
  152. package/dist/graph/mappers/index.d.ts.map +1 -0
  153. package/dist/graph/mappers/index.js +16 -0
  154. package/dist/graph/mappers/index.js.map +1 -0
  155. package/dist/graph/mappers/task-mapper.d.ts +20 -0
  156. package/dist/graph/mappers/task-mapper.d.ts.map +1 -0
  157. package/dist/graph/mappers/task-mapper.js +27 -0
  158. package/dist/graph/mappers/task-mapper.js.map +1 -0
  159. package/dist/graph/mappers/utils.d.ts +97 -0
  160. package/dist/graph/mappers/utils.d.ts.map +1 -0
  161. package/dist/graph/mappers/utils.js +186 -0
  162. package/dist/graph/mappers/utils.js.map +1 -0
  163. package/dist/graph/repository.d.ts +1104 -0
  164. package/dist/graph/repository.d.ts.map +1 -0
  165. package/dist/graph/repository.js +2999 -0
  166. package/dist/graph/repository.js.map +1 -0
  167. package/dist/index.d.ts +21 -0
  168. package/dist/index.d.ts.map +1 -0
  169. package/dist/index.js +6052 -0
  170. package/dist/index.js.map +1 -0
  171. package/dist/parsers/html-stripper.d.ts +41 -0
  172. package/dist/parsers/html-stripper.d.ts.map +1 -0
  173. package/dist/parsers/html-stripper.js +179 -0
  174. package/dist/parsers/html-stripper.js.map +1 -0
  175. package/dist/parsers/index.d.ts +12 -0
  176. package/dist/parsers/index.d.ts.map +1 -0
  177. package/dist/parsers/index.js +12 -0
  178. package/dist/parsers/index.js.map +1 -0
  179. package/dist/parsers/olk15.d.ts +87 -0
  180. package/dist/parsers/olk15.d.ts.map +1 -0
  181. package/dist/parsers/olk15.js +368 -0
  182. package/dist/parsers/olk15.js.map +1 -0
  183. package/dist/signature.d.ts +22 -0
  184. package/dist/signature.d.ts.map +1 -0
  185. package/dist/signature.js +89 -0
  186. package/dist/signature.js.map +1 -0
  187. package/dist/tools/calendar-permissions.d.ts +79 -0
  188. package/dist/tools/calendar-permissions.d.ts.map +1 -0
  189. package/dist/tools/calendar-permissions.js +121 -0
  190. package/dist/tools/calendar-permissions.js.map +1 -0
  191. package/dist/tools/calendar.d.ts +208 -0
  192. package/dist/tools/calendar.d.ts.map +1 -0
  193. package/dist/tools/calendar.js +247 -0
  194. package/dist/tools/calendar.js.map +1 -0
  195. package/dist/tools/categories.d.ts +94 -0
  196. package/dist/tools/categories.d.ts.map +1 -0
  197. package/dist/tools/categories.js +117 -0
  198. package/dist/tools/categories.js.map +1 -0
  199. package/dist/tools/checklist-items.d.ts +89 -0
  200. package/dist/tools/checklist-items.d.ts.map +1 -0
  201. package/dist/tools/checklist-items.js +140 -0
  202. package/dist/tools/checklist-items.js.map +1 -0
  203. package/dist/tools/contacts.d.ts +94 -0
  204. package/dist/tools/contacts.d.ts.map +1 -0
  205. package/dist/tools/contacts.js +134 -0
  206. package/dist/tools/contacts.js.map +1 -0
  207. package/dist/tools/excel.d.ts +96 -0
  208. package/dist/tools/excel.d.ts.map +1 -0
  209. package/dist/tools/excel.js +165 -0
  210. package/dist/tools/excel.js.map +1 -0
  211. package/dist/tools/focused-overrides.d.ts +70 -0
  212. package/dist/tools/focused-overrides.d.ts.map +1 -0
  213. package/dist/tools/focused-overrides.js +117 -0
  214. package/dist/tools/focused-overrides.js.map +1 -0
  215. package/dist/tools/index.d.ts +22 -0
  216. package/dist/tools/index.d.ts.map +1 -0
  217. package/dist/tools/index.js +34 -0
  218. package/dist/tools/index.js.map +1 -0
  219. package/dist/tools/linked-resources.d.ts +74 -0
  220. package/dist/tools/linked-resources.d.ts.map +1 -0
  221. package/dist/tools/linked-resources.js +122 -0
  222. package/dist/tools/linked-resources.js.map +1 -0
  223. package/dist/tools/mail-rules.d.ts +98 -0
  224. package/dist/tools/mail-rules.d.ts.map +1 -0
  225. package/dist/tools/mail-rules.js +169 -0
  226. package/dist/tools/mail-rules.js.map +1 -0
  227. package/dist/tools/mail-send.d.ts +314 -0
  228. package/dist/tools/mail-send.d.ts.map +1 -0
  229. package/dist/tools/mail-send.js +555 -0
  230. package/dist/tools/mail-send.js.map +1 -0
  231. package/dist/tools/mail.d.ts +127 -0
  232. package/dist/tools/mail.d.ts.map +1 -0
  233. package/dist/tools/mail.js +311 -0
  234. package/dist/tools/mail.js.map +1 -0
  235. package/dist/tools/mailbox-organization.d.ts +301 -0
  236. package/dist/tools/mailbox-organization.d.ts.map +1 -0
  237. package/dist/tools/mailbox-organization.js +541 -0
  238. package/dist/tools/mailbox-organization.js.map +1 -0
  239. package/dist/tools/meetings.d.ts +114 -0
  240. package/dist/tools/meetings.d.ts.map +1 -0
  241. package/dist/tools/meetings.js +110 -0
  242. package/dist/tools/meetings.js.map +1 -0
  243. package/dist/tools/notes.d.ts +74 -0
  244. package/dist/tools/notes.d.ts.map +1 -0
  245. package/dist/tools/notes.js +136 -0
  246. package/dist/tools/notes.js.map +1 -0
  247. package/dist/tools/onedrive.d.ts +194 -0
  248. package/dist/tools/onedrive.d.ts.map +1 -0
  249. package/dist/tools/onedrive.js +257 -0
  250. package/dist/tools/onedrive.js.map +1 -0
  251. package/dist/tools/people.d.ts +129 -0
  252. package/dist/tools/people.d.ts.map +1 -0
  253. package/dist/tools/people.js +195 -0
  254. package/dist/tools/people.js.map +1 -0
  255. package/dist/tools/planner-visualization.d.ts +91 -0
  256. package/dist/tools/planner-visualization.d.ts.map +1 -0
  257. package/dist/tools/planner-visualization.js +192 -0
  258. package/dist/tools/planner-visualization.js.map +1 -0
  259. package/dist/tools/planner.d.ts +288 -0
  260. package/dist/tools/planner.d.ts.map +1 -0
  261. package/dist/tools/planner.js +368 -0
  262. package/dist/tools/planner.js.map +1 -0
  263. package/dist/tools/scheduling.d.ts +49 -0
  264. package/dist/tools/scheduling.d.ts.map +1 -0
  265. package/dist/tools/scheduling.js +115 -0
  266. package/dist/tools/scheduling.js.map +1 -0
  267. package/dist/tools/sharepoint.d.ts +115 -0
  268. package/dist/tools/sharepoint.d.ts.map +1 -0
  269. package/dist/tools/sharepoint.js +99 -0
  270. package/dist/tools/sharepoint.js.map +1 -0
  271. package/dist/tools/task-attachments.d.ts +74 -0
  272. package/dist/tools/task-attachments.d.ts.map +1 -0
  273. package/dist/tools/task-attachments.js +122 -0
  274. package/dist/tools/task-attachments.js.map +1 -0
  275. package/dist/tools/tasks.d.ts +74 -0
  276. package/dist/tools/tasks.d.ts.map +1 -0
  277. package/dist/tools/tasks.js +126 -0
  278. package/dist/tools/tasks.js.map +1 -0
  279. package/dist/tools/teams.d.ts +389 -0
  280. package/dist/tools/teams.d.ts.map +1 -0
  281. package/dist/tools/teams.js +546 -0
  282. package/dist/tools/teams.js.map +1 -0
  283. package/dist/types/calendar.d.ts +60 -0
  284. package/dist/types/calendar.d.ts.map +1 -0
  285. package/dist/types/calendar.js +15 -0
  286. package/dist/types/calendar.js.map +1 -0
  287. package/dist/types/contacts.d.ts +96 -0
  288. package/dist/types/contacts.d.ts.map +1 -0
  289. package/dist/types/contacts.js +41 -0
  290. package/dist/types/contacts.js.map +1 -0
  291. package/dist/types/index.d.ts +15 -0
  292. package/dist/types/index.d.ts.map +1 -0
  293. package/dist/types/index.js +16 -0
  294. package/dist/types/index.js.map +1 -0
  295. package/dist/types/mail.d.ts +108 -0
  296. package/dist/types/mail.d.ts.map +1 -0
  297. package/dist/types/mail.js +40 -0
  298. package/dist/types/mail.js.map +1 -0
  299. package/dist/types/notes.d.ts +26 -0
  300. package/dist/types/notes.d.ts.map +1 -0
  301. package/dist/types/notes.js +6 -0
  302. package/dist/types/notes.js.map +1 -0
  303. package/dist/types/tasks.d.ts +31 -0
  304. package/dist/types/tasks.d.ts.map +1 -0
  305. package/dist/types/tasks.js +6 -0
  306. package/dist/types/tasks.js.map +1 -0
  307. package/dist/utils/dates.d.ts +66 -0
  308. package/dist/utils/dates.d.ts.map +1 -0
  309. package/dist/utils/dates.js +94 -0
  310. package/dist/utils/dates.js.map +1 -0
  311. package/dist/utils/errors.d.ts +218 -0
  312. package/dist/utils/errors.d.ts.map +1 -0
  313. package/dist/utils/errors.js +306 -0
  314. package/dist/utils/errors.js.map +1 -0
  315. package/dist/utils/index.d.ts +10 -0
  316. package/dist/utils/index.d.ts.map +1 -0
  317. package/dist/utils/index.js +10 -0
  318. package/dist/utils/index.js.map +1 -0
  319. package/dist/visualization/html.d.ts +26 -0
  320. package/dist/visualization/html.d.ts.map +1 -0
  321. package/dist/visualization/html.js +306 -0
  322. package/dist/visualization/html.js.map +1 -0
  323. package/dist/visualization/markdown.d.ts +25 -0
  324. package/dist/visualization/markdown.d.ts.map +1 -0
  325. package/dist/visualization/markdown.js +186 -0
  326. package/dist/visualization/markdown.js.map +1 -0
  327. package/dist/visualization/mermaid.d.ts +25 -0
  328. package/dist/visualization/mermaid.d.ts.map +1 -0
  329. package/dist/visualization/mermaid.js +158 -0
  330. package/dist/visualization/mermaid.js.map +1 -0
  331. package/dist/visualization/svg.d.ts +25 -0
  332. package/dist/visualization/svg.d.ts.map +1 -0
  333. package/dist/visualization/svg.js +282 -0
  334. package/dist/visualization/svg.js.map +1 -0
  335. package/dist/visualization/types.d.ts +43 -0
  336. package/dist/visualization/types.d.ts.map +1 -0
  337. package/dist/visualization/types.js +34 -0
  338. package/dist/visualization/types.js.map +1 -0
  339. package/package.json +88 -0
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * SharePoint Document Library MCP tools.
7
+ *
8
+ * Provides read-only tools for browsing SharePoint sites, document libraries,
9
+ * and downloading files from team document libraries.
10
+ */
11
+ import { z } from 'zod';
12
+ export declare const ListSitesInput: z.ZodObject<{}, z.core.$strict>;
13
+ export declare const SearchSitesInput: z.ZodObject<{
14
+ query: z.ZodString;
15
+ }, z.core.$strict>;
16
+ export declare const GetSiteInput: z.ZodObject<{
17
+ site_id: z.ZodNumber;
18
+ }, z.core.$strict>;
19
+ export declare const ListDocumentLibrariesInput: z.ZodObject<{
20
+ site_id: z.ZodNumber;
21
+ }, z.core.$strict>;
22
+ export declare const ListLibraryItemsInput: z.ZodObject<{
23
+ library_id: z.ZodNumber;
24
+ folder_id: z.ZodOptional<z.ZodNumber>;
25
+ }, z.core.$strict>;
26
+ export declare const DownloadLibraryFileInput: z.ZodObject<{
27
+ item_id: z.ZodNumber;
28
+ output_path: z.ZodString;
29
+ }, z.core.$strict>;
30
+ export type ListSitesParams = z.infer<typeof ListSitesInput>;
31
+ export type SearchSitesParams = z.infer<typeof SearchSitesInput>;
32
+ export type GetSiteParams = z.infer<typeof GetSiteInput>;
33
+ export type ListDocumentLibrariesParams = z.infer<typeof ListDocumentLibrariesInput>;
34
+ export type ListLibraryItemsParams = z.infer<typeof ListLibraryItemsInput>;
35
+ export type DownloadLibraryFileParams = z.infer<typeof DownloadLibraryFileInput>;
36
+ export interface ISharePointRepository {
37
+ listSitesAsync(): Promise<Array<{
38
+ id: number;
39
+ name: string;
40
+ webUrl: string;
41
+ displayName: string;
42
+ }>>;
43
+ searchSitesAsync(query: string): Promise<Array<{
44
+ id: number;
45
+ name: string;
46
+ webUrl: string;
47
+ displayName: string;
48
+ }>>;
49
+ getSiteAsync(siteId: number): Promise<{
50
+ id: number;
51
+ name: string;
52
+ webUrl: string;
53
+ displayName: string;
54
+ description: string;
55
+ }>;
56
+ listDocumentLibrariesAsync(siteId: number): Promise<Array<{
57
+ id: number;
58
+ name: string;
59
+ webUrl: string;
60
+ driveType: string;
61
+ }>>;
62
+ listLibraryItemsAsync(libraryId: number, folderId?: number): Promise<Array<{
63
+ id: number;
64
+ name: string;
65
+ size: number;
66
+ webUrl: string;
67
+ lastModifiedDateTime: string;
68
+ isFolder: boolean;
69
+ }>>;
70
+ downloadLibraryFileAsync(itemId: number, outputPath: string): Promise<string>;
71
+ }
72
+ /**
73
+ * SharePoint document library tools for browsing sites, libraries, and files.
74
+ */
75
+ export declare class SharePointTools {
76
+ private readonly repo;
77
+ constructor(repo: ISharePointRepository);
78
+ listSites(): Promise<{
79
+ content: Array<{
80
+ type: 'text';
81
+ text: string;
82
+ }>;
83
+ }>;
84
+ searchSites(params: SearchSitesParams): Promise<{
85
+ content: Array<{
86
+ type: 'text';
87
+ text: string;
88
+ }>;
89
+ }>;
90
+ getSite(params: GetSiteParams): Promise<{
91
+ content: Array<{
92
+ type: 'text';
93
+ text: string;
94
+ }>;
95
+ }>;
96
+ listDocumentLibraries(params: ListDocumentLibrariesParams): Promise<{
97
+ content: Array<{
98
+ type: 'text';
99
+ text: string;
100
+ }>;
101
+ }>;
102
+ listLibraryItems(params: ListLibraryItemsParams): Promise<{
103
+ content: Array<{
104
+ type: 'text';
105
+ text: string;
106
+ }>;
107
+ }>;
108
+ downloadLibraryFile(params: DownloadLibraryFileParams): Promise<{
109
+ content: Array<{
110
+ type: 'text';
111
+ text: string;
112
+ }>;
113
+ }>;
114
+ }
115
+ //# sourceMappingURL=sharepoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharepoint.d.ts","sourceRoot":"","sources":["../../src/tools/sharepoint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,cAAc,iCAAqB,CAAC;AAEjD,eAAO,MAAM,gBAAgB;;kBAE3B,CAAC;AAEH,eAAO,MAAM,YAAY;;kBAEvB,CAAC;AAEH,eAAO,MAAM,0BAA0B;;kBAErC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;kBAGhC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;kBAGnC,CAAC;AAMH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACrF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAMjF,MAAM,WAAW,qBAAqB;IACpC,cAAc,IA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IT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * SharePoint Document Library MCP tools.
7
+ *
8
+ * Provides read-only tools for browsing SharePoint sites, document libraries,
9
+ * and downloading files from team document libraries.
10
+ */
11
+ import { z } from 'zod';
12
+ // =============================================================================
13
+ // Input Schemas
14
+ // =============================================================================
15
+ export const ListSitesInput = z.strictObject({});
16
+ export const SearchSitesInput = z.strictObject({
17
+ query: z.string().min(1).describe('Search keyword for SharePoint sites'),
18
+ });
19
+ export const GetSiteInput = z.strictObject({
20
+ site_id: z.number().int().positive().describe('Site ID from list_sites or search_sites'),
21
+ });
22
+ export const ListDocumentLibrariesInput = z.strictObject({
23
+ site_id: z.number().int().positive().describe('Site ID from list_sites or search_sites'),
24
+ });
25
+ export const ListLibraryItemsInput = z.strictObject({
26
+ library_id: z.number().int().positive().describe('Library ID from list_document_libraries'),
27
+ folder_id: z.number().int().positive().optional().describe('Folder ID to browse into (from a previous list_library_items call)'),
28
+ });
29
+ export const DownloadLibraryFileInput = z.strictObject({
30
+ item_id: z.number().int().positive().describe('Item ID from list_library_items'),
31
+ output_path: z.string().min(1).describe('Local file path to save the downloaded file'),
32
+ });
33
+ // =============================================================================
34
+ // SharePoint Tools
35
+ // =============================================================================
36
+ /**
37
+ * SharePoint document library tools for browsing sites, libraries, and files.
38
+ */
39
+ export class SharePointTools {
40
+ repo;
41
+ constructor(repo) {
42
+ this.repo = repo;
43
+ }
44
+ async listSites() {
45
+ const sites = await this.repo.listSitesAsync();
46
+ return {
47
+ content: [{
48
+ type: 'text',
49
+ text: JSON.stringify({ sites }, null, 2),
50
+ }],
51
+ };
52
+ }
53
+ async searchSites(params) {
54
+ const sites = await this.repo.searchSitesAsync(params.query);
55
+ return {
56
+ content: [{
57
+ type: 'text',
58
+ text: JSON.stringify({ sites }, null, 2),
59
+ }],
60
+ };
61
+ }
62
+ async getSite(params) {
63
+ const site = await this.repo.getSiteAsync(params.site_id);
64
+ return {
65
+ content: [{
66
+ type: 'text',
67
+ text: JSON.stringify({ site }, null, 2),
68
+ }],
69
+ };
70
+ }
71
+ async listDocumentLibraries(params) {
72
+ const libraries = await this.repo.listDocumentLibrariesAsync(params.site_id);
73
+ return {
74
+ content: [{
75
+ type: 'text',
76
+ text: JSON.stringify({ libraries }, null, 2),
77
+ }],
78
+ };
79
+ }
80
+ async listLibraryItems(params) {
81
+ const items = await this.repo.listLibraryItemsAsync(params.library_id, params.folder_id);
82
+ return {
83
+ content: [{
84
+ type: 'text',
85
+ text: JSON.stringify({ items }, null, 2),
86
+ }],
87
+ };
88
+ }
89
+ async downloadLibraryFile(params) {
90
+ const savedPath = await this.repo.downloadLibraryFileAsync(params.item_id, params.output_path);
91
+ return {
92
+ content: [{
93
+ type: 'text',
94
+ text: JSON.stringify({ success: true, path: savedPath, message: 'File downloaded' }, null, 2),
95
+ }],
96
+ };
97
+ }
98
+ }
99
+ //# sourceMappingURL=sharepoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharepoint.js","sourceRoot":"","sources":["../../src/tools/sharepoint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;CACzE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACzF,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;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACzC,CAAC;SACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAAiC;QAGzD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/F,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC9F,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Task Attachment MCP tools for Microsoft To Do.
7
+ *
8
+ * Provides tools for managing attachments on To Do tasks with a two-phase
9
+ * approval pattern for destructive delete operations.
10
+ */
11
+ import { z } from 'zod';
12
+ import type { ApprovalTokenManager } from '../approval/index.js';
13
+ export declare const ListTaskAttachmentsInput: z.ZodObject<{
14
+ task_id: z.ZodNumber;
15
+ }, z.core.$strict>;
16
+ export declare const CreateTaskAttachmentInput: z.ZodObject<{
17
+ task_id: z.ZodNumber;
18
+ name: z.ZodString;
19
+ content_bytes: z.ZodString;
20
+ content_type: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strict>;
22
+ export declare const PrepareDeleteTaskAttachmentInput: z.ZodObject<{
23
+ task_attachment_id: z.ZodNumber;
24
+ }, z.core.$strict>;
25
+ export declare const ConfirmDeleteTaskAttachmentInput: z.ZodObject<{
26
+ approval_token: z.ZodString;
27
+ }, z.core.$strict>;
28
+ export type ListTaskAttachmentsParams = z.infer<typeof ListTaskAttachmentsInput>;
29
+ export type CreateTaskAttachmentParams = z.infer<typeof CreateTaskAttachmentInput>;
30
+ export type PrepareDeleteTaskAttachmentParams = z.infer<typeof PrepareDeleteTaskAttachmentInput>;
31
+ export type ConfirmDeleteTaskAttachmentParams = z.infer<typeof ConfirmDeleteTaskAttachmentInput>;
32
+ export interface ITaskAttachmentsRepository {
33
+ listTaskAttachmentsAsync(taskId: number): Promise<Array<{
34
+ id: number;
35
+ name: string;
36
+ size: number;
37
+ contentType: string;
38
+ }>>;
39
+ createTaskAttachmentAsync(taskId: number, name: string, contentBytes: string, contentType?: string): Promise<number>;
40
+ deleteTaskAttachmentAsync(taskAttachmentId: number): Promise<void>;
41
+ }
42
+ /**
43
+ * Task attachment tools with two-phase approval for delete operations.
44
+ */
45
+ export declare class TaskAttachmentsTools {
46
+ private readonly repo;
47
+ private readonly tokenManager;
48
+ constructor(repo: ITaskAttachmentsRepository, tokenManager: ApprovalTokenManager);
49
+ listTaskAttachments(params: ListTaskAttachmentsParams): Promise<{
50
+ content: Array<{
51
+ type: 'text';
52
+ text: string;
53
+ }>;
54
+ }>;
55
+ createTaskAttachment(params: CreateTaskAttachmentParams): Promise<{
56
+ content: Array<{
57
+ type: 'text';
58
+ text: string;
59
+ }>;
60
+ }>;
61
+ prepareDeleteTaskAttachment(params: PrepareDeleteTaskAttachmentParams): {
62
+ content: Array<{
63
+ type: 'text';
64
+ text: string;
65
+ }>;
66
+ };
67
+ confirmDeleteTaskAttachment(params: ConfirmDeleteTaskAttachmentParams): Promise<{
68
+ content: Array<{
69
+ type: 'text';
70
+ text: string;
71
+ }>;
72
+ }>;
73
+ }
74
+ //# sourceMappingURL=task-attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-attachments.d.ts","sourceRoot":"","sources":["../../src/tools/task-attachments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,CA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;IAG/C,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC;QACpE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;IAUI,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC;QACtE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;IAUF,2BAA2B,CAAC,MAAM,EAAE,iCAAiC,GAAG;QACtE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD;IAqBK,2BAA2B,CAAC,MAAM,EAAE,iCAAiC,GAAG,OAAO,CAAC;QACpF,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;CA2CH"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Task Attachment MCP tools for Microsoft To Do.
7
+ *
8
+ * Provides tools for managing attachments on To Do tasks with a two-phase
9
+ * approval pattern for destructive delete operations.
10
+ */
11
+ import { z } from 'zod';
12
+ // =============================================================================
13
+ // Input Schemas
14
+ // =============================================================================
15
+ export const ListTaskAttachmentsInput = z.strictObject({
16
+ task_id: z.number().int().positive().describe('Task ID from list_tasks or search_tasks'),
17
+ });
18
+ export const CreateTaskAttachmentInput = z.strictObject({
19
+ task_id: z.number().int().positive().describe('Task ID'),
20
+ name: z.string().min(1).describe('File name of the attachment'),
21
+ content_bytes: z.string().min(1).describe('Base64-encoded file content'),
22
+ content_type: z.string().optional().describe('MIME type (default: application/octet-stream)'),
23
+ });
24
+ export const PrepareDeleteTaskAttachmentInput = z.strictObject({
25
+ task_attachment_id: z.number().int().positive().describe('Task attachment ID to delete'),
26
+ });
27
+ export const ConfirmDeleteTaskAttachmentInput = z.strictObject({
28
+ approval_token: z.string().describe('Approval token from prepare_delete_task_attachment'),
29
+ });
30
+ // =============================================================================
31
+ // Task Attachments Tools
32
+ // =============================================================================
33
+ /**
34
+ * Task attachment tools with two-phase approval for delete operations.
35
+ */
36
+ export class TaskAttachmentsTools {
37
+ repo;
38
+ tokenManager;
39
+ constructor(repo, tokenManager) {
40
+ this.repo = repo;
41
+ this.tokenManager = tokenManager;
42
+ }
43
+ async listTaskAttachments(params) {
44
+ const items = await this.repo.listTaskAttachmentsAsync(params.task_id);
45
+ return {
46
+ content: [{
47
+ type: 'text',
48
+ text: JSON.stringify({ task_attachments: items }, null, 2),
49
+ }],
50
+ };
51
+ }
52
+ async createTaskAttachment(params) {
53
+ const itemId = await this.repo.createTaskAttachmentAsync(params.task_id, params.name, params.content_bytes, params.content_type);
54
+ return {
55
+ content: [{
56
+ type: 'text',
57
+ text: JSON.stringify({ success: true, task_attachment_id: itemId, message: 'Task attachment created' }, null, 2),
58
+ }],
59
+ };
60
+ }
61
+ prepareDeleteTaskAttachment(params) {
62
+ const token = this.tokenManager.generateToken({
63
+ operation: 'delete_task_attachment',
64
+ targetType: 'task_attachment',
65
+ targetId: params.task_attachment_id,
66
+ targetHash: String(params.task_attachment_id),
67
+ });
68
+ return {
69
+ content: [{
70
+ type: 'text',
71
+ text: JSON.stringify({
72
+ approval_token: token.tokenId,
73
+ expires_at: new Date(token.expiresAt).toISOString(),
74
+ task_attachment_id: params.task_attachment_id,
75
+ action: `To confirm deleting task attachment ${params.task_attachment_id}, call confirm_delete_task_attachment with the approval_token.`,
76
+ }, null, 2),
77
+ }],
78
+ };
79
+ }
80
+ async confirmDeleteTaskAttachment(params) {
81
+ // Look up the token to get the targetId, then consume it
82
+ const token = this.tokenManager.lookupToken(params.approval_token);
83
+ if (token == null) {
84
+ return {
85
+ content: [{
86
+ type: 'text',
87
+ text: JSON.stringify({
88
+ success: false,
89
+ error: 'Token not found or already used',
90
+ }, null, 2),
91
+ }],
92
+ };
93
+ }
94
+ const result = this.tokenManager.consumeToken(params.approval_token, 'delete_task_attachment', token.targetId);
95
+ if (!result.valid) {
96
+ const errorMessages = {
97
+ NOT_FOUND: 'Token not found or already used',
98
+ EXPIRED: 'Token has expired. Please call prepare_delete_task_attachment again.',
99
+ OPERATION_MISMATCH: 'Token was not generated for delete_task_attachment',
100
+ TARGET_MISMATCH: 'Token was generated for a different task attachment',
101
+ ALREADY_CONSUMED: 'Token has already been used',
102
+ };
103
+ return {
104
+ content: [{
105
+ type: 'text',
106
+ text: JSON.stringify({
107
+ success: false,
108
+ error: errorMessages[result.error ?? ''] ?? 'Invalid token',
109
+ }, null, 2),
110
+ }],
111
+ };
112
+ }
113
+ await this.repo.deleteTaskAttachmentAsync(result.token.targetId);
114
+ return {
115
+ content: [{
116
+ type: 'text',
117
+ text: JSON.stringify({ success: true, message: 'Task attachment deleted' }, null, 2),
118
+ }],
119
+ };
120
+ }
121
+ }
122
+ //# sourceMappingURL=task-attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-attachments.js","sourceRoot":"","sources":["../../src/tools/task-attachments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACzF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,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AE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,yBAAyB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACrF,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Task-related MCP tools.
7
+ *
8
+ * Provides tools for listing, searching, and getting tasks.
9
+ */
10
+ import { z } from 'zod';
11
+ import type { IRepository } from '../database/repository.js';
12
+ import type { TaskSummary, Task } from '../types/index.js';
13
+ export declare const ListTasksInput: z.ZodObject<{
14
+ limit: z.ZodDefault<z.ZodNumber>;
15
+ offset: z.ZodDefault<z.ZodNumber>;
16
+ include_completed: z.ZodDefault<z.ZodBoolean>;
17
+ }, z.core.$strict>;
18
+ export declare const SearchTasksInput: z.ZodObject<{
19
+ query: z.ZodString;
20
+ limit: z.ZodDefault<z.ZodNumber>;
21
+ }, z.core.$strict>;
22
+ export declare const GetTaskInput: z.ZodObject<{
23
+ task_id: z.ZodNumber;
24
+ }, z.core.$strict>;
25
+ export type ListTasksParams = z.infer<typeof ListTasksInput>;
26
+ export type SearchTasksParams = z.infer<typeof SearchTasksInput>;
27
+ export type GetTaskParams = z.infer<typeof GetTaskInput>;
28
+ /**
29
+ * Interface for reading task content from data files.
30
+ */
31
+ export interface ITaskContentReader {
32
+ /**
33
+ * Reads task details from the given data file path.
34
+ */
35
+ readTaskDetails(dataFilePath: string | null): TaskDetails | null;
36
+ }
37
+ /**
38
+ * Task details from content file.
39
+ */
40
+ export interface TaskDetails {
41
+ readonly body: string | null;
42
+ readonly completedDate: string | null;
43
+ readonly reminderDate: string | null;
44
+ readonly categories: readonly string[];
45
+ }
46
+ /**
47
+ * Default task content reader that returns null.
48
+ */
49
+ export declare const nullTaskContentReader: ITaskContentReader;
50
+ /**
51
+ * Tasks tools implementation with dependency injection.
52
+ */
53
+ export declare class TasksTools {
54
+ private readonly repository;
55
+ private readonly contentReader;
56
+ constructor(repository: IRepository, contentReader?: ITaskContentReader);
57
+ /**
58
+ * Lists tasks with pagination and filtering.
59
+ */
60
+ listTasks(params: ListTasksParams): TaskSummary[];
61
+ /**
62
+ * Searches tasks by name.
63
+ */
64
+ searchTasks(params: SearchTasksParams): TaskSummary[];
65
+ /**
66
+ * Gets a single task by ID.
67
+ */
68
+ getTask(params: GetTaskParams): Task | null;
69
+ }
70
+ /**
71
+ * Creates tasks tools with the given repository.
72
+ */
73
+ export declare function createTasksTools(repository: IRepository, contentReader?: ITaskContentReader): TasksTools;
74
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAW,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AAO1E,eAAO,MAAM,cAAc;;;;kBAUzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;kBAS3B,CAAC;AAEH,eAAO,MAAM,YAAY;;kBAEvB,CAAC;AAMH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAMzD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,kBAEnC,CAAC;AAyCF;;GAEG;AACH,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,UAAU,EAAE,WAAW,EACvB,aAAa,GAAE,kBAA0C;IAG5E;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,EAAE;IAUjD;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW,EAAE;IAMrD;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;CAW5C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,WAAW,EACvB,aAAa,GAAE,kBAA0C,GACxD,UAAU,CAEZ"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Task-related MCP tools.
7
+ *
8
+ * Provides tools for listing, searching, and getting tasks.
9
+ */
10
+ import { z } from 'zod';
11
+ import { appleTimestampToIso } from '../utils/dates.js';
12
+ // =============================================================================
13
+ // Input Schemas
14
+ // =============================================================================
15
+ export const ListTasksInput = z.strictObject({
16
+ limit: z
17
+ .number()
18
+ .int()
19
+ .min(1)
20
+ .max(100)
21
+ .default(50)
22
+ .describe('Maximum number of tasks to return (1-100)'),
23
+ offset: z.number().int().min(0).default(0).describe('Number of tasks to skip'),
24
+ include_completed: z.boolean().default(true).describe('Include completed tasks'),
25
+ });
26
+ export const SearchTasksInput = z.strictObject({
27
+ query: z.string().min(1).describe('Search query for task names'),
28
+ limit: z
29
+ .number()
30
+ .int()
31
+ .min(1)
32
+ .max(100)
33
+ .default(50)
34
+ .describe('Maximum number of tasks to return (1-100)'),
35
+ });
36
+ export const GetTaskInput = z.strictObject({
37
+ task_id: z.number().int().positive().describe('The task ID to retrieve'),
38
+ });
39
+ /**
40
+ * Default task content reader that returns null.
41
+ */
42
+ export const nullTaskContentReader = {
43
+ readTaskDetails: () => null,
44
+ };
45
+ // =============================================================================
46
+ // Transformers
47
+ // =============================================================================
48
+ /**
49
+ * Transforms a database task row to TaskSummary.
50
+ */
51
+ function transformTaskSummary(row) {
52
+ return {
53
+ id: row.id,
54
+ folderId: row.folderId,
55
+ name: row.name,
56
+ isCompleted: row.isCompleted === 1,
57
+ dueDate: appleTimestampToIso(row.dueDate),
58
+ priority: row.priority,
59
+ };
60
+ }
61
+ /**
62
+ * Transforms a database task row to full Task.
63
+ */
64
+ function transformTask(row, details) {
65
+ const summary = transformTaskSummary(row);
66
+ return {
67
+ ...summary,
68
+ startDate: appleTimestampToIso(row.startDate),
69
+ completedDate: details?.completedDate ?? null,
70
+ hasReminder: row.hasReminder === 1,
71
+ reminderDate: details?.reminderDate ?? null,
72
+ body: details?.body ?? null,
73
+ categories: details?.categories ?? [],
74
+ };
75
+ }
76
+ // =============================================================================
77
+ // Tasks Tools Class
78
+ // =============================================================================
79
+ /**
80
+ * Tasks tools implementation with dependency injection.
81
+ */
82
+ export class TasksTools {
83
+ repository;
84
+ contentReader;
85
+ constructor(repository, contentReader = nullTaskContentReader) {
86
+ this.repository = repository;
87
+ this.contentReader = contentReader;
88
+ }
89
+ /**
90
+ * Lists tasks with pagination and filtering.
91
+ */
92
+ listTasks(params) {
93
+ const { limit, offset, include_completed } = params;
94
+ const rows = include_completed
95
+ ? this.repository.listTasks(limit, offset)
96
+ : this.repository.listIncompleteTasks(limit, offset);
97
+ return rows.map(transformTaskSummary);
98
+ }
99
+ /**
100
+ * Searches tasks by name.
101
+ */
102
+ searchTasks(params) {
103
+ const { query, limit } = params;
104
+ const rows = this.repository.searchTasks(query, limit);
105
+ return rows.map(transformTaskSummary);
106
+ }
107
+ /**
108
+ * Gets a single task by ID.
109
+ */
110
+ getTask(params) {
111
+ const { task_id } = params;
112
+ const row = this.repository.getTask(task_id);
113
+ if (row == null) {
114
+ return null;
115
+ }
116
+ const details = this.contentReader.readTaskDetails(row.dataFilePath);
117
+ return transformTask(row, details);
118
+ }
119
+ }
120
+ /**
121
+ * Creates tasks tools with the given repository.
122
+ */
123
+ export function createTasksTools(repository, contentReader = nullTaskContentReader) {
124
+ return new TasksTools(repository, contentReader);
125
+ }
126
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,2CAA2C,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAC9E,iBAAiB,EAAE,CAAC,CAAC,OAAO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