@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,247 @@
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
+ * Calendar-related MCP tools.
7
+ *
8
+ * Provides tools for listing calendars, events, and searching.
9
+ */
10
+ import { z } from 'zod';
11
+ import { appleTimestampToIso, isoToAppleTimestamp } from '../utils/dates.js';
12
+ // =============================================================================
13
+ // Input Schemas
14
+ // =============================================================================
15
+ export const ListCalendarsInput = z.strictObject({});
16
+ export const ListEventsInput = z.strictObject({
17
+ calendar_id: z.number().int().positive().optional().describe('Optional calendar folder ID'),
18
+ start_date: z.string().optional().describe('Start date filter (ISO 8601 format)'),
19
+ end_date: z.string().optional().describe('End date filter (ISO 8601 format)'),
20
+ limit: z
21
+ .number()
22
+ .int()
23
+ .min(1)
24
+ .max(100)
25
+ .default(50)
26
+ .describe('Maximum number of events to return (1-100)'),
27
+ });
28
+ export const GetEventInput = z.strictObject({
29
+ event_id: z.number().int().positive().describe('The event ID to retrieve'),
30
+ });
31
+ export const SearchEventsInput = z.strictObject({
32
+ query: z.string().min(1).optional().describe('Search query for event titles'),
33
+ start_date: z.string().optional().describe('Start date filter (ISO 8601 format) - events starting on or after this date'),
34
+ end_date: z.string().optional().describe('End date filter (ISO 8601 format) - events ending on or before this date'),
35
+ limit: z
36
+ .number()
37
+ .int()
38
+ .min(1)
39
+ .max(100)
40
+ .default(50)
41
+ .describe('Maximum number of events to return (1-100)'),
42
+ }).refine((data) => data.query != null || data.start_date != null || data.end_date != null, { message: 'At least one of query, start_date, or end_date must be provided' });
43
+ export const RespondToEventInput = z.strictObject({
44
+ event_id: z.number().int().positive().describe('The event ID to respond to'),
45
+ response: z.enum(['accept', 'decline', 'tentative']).describe('Your response to the invitation'),
46
+ send_response: z.boolean().default(true).describe('Whether to send response to organizer'),
47
+ comment: z.string().optional().describe('Optional comment to include with response'),
48
+ });
49
+ const DayOfWeek = z.enum([
50
+ 'sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday',
51
+ ]);
52
+ const RecurrenceEndInput = z.discriminatedUnion('type', [
53
+ z.strictObject({ type: z.literal('no_end') }),
54
+ z.strictObject({
55
+ type: z.literal('end_date'),
56
+ date: z.string().describe('End date in ISO 8601 format'),
57
+ }),
58
+ z.strictObject({
59
+ type: z.literal('end_after_count'),
60
+ count: z.number().int().min(1).max(999).describe('Number of occurrences'),
61
+ }),
62
+ ]);
63
+ export const RecurrenceInput = z.strictObject({
64
+ frequency: z.enum(['daily', 'weekly', 'monthly', 'yearly']).describe('How often the event repeats'),
65
+ interval: z.number().int().min(1).max(999).default(1).describe('Number of frequency units between occurrences (e.g., 2 for every 2 weeks)'),
66
+ days_of_week: z.array(DayOfWeek).min(1).optional().describe('Days of the week for weekly recurrence (e.g., ["monday", "wednesday"])'),
67
+ day_of_month: z.number().int().min(1).max(31).optional().describe('Day of the month for monthly recurrence (e.g., 15 for the 15th)'),
68
+ week_of_month: z.enum(['first', 'second', 'third', 'fourth', 'last']).optional().describe('Week of the month for ordinal monthly recurrence (e.g., "third" for 3rd Thursday)'),
69
+ day_of_week_monthly: DayOfWeek.optional().describe('Day of week for ordinal monthly recurrence (used with week_of_month)'),
70
+ end: RecurrenceEndInput.default({ type: 'no_end' }).describe('When the recurrence ends'),
71
+ }).superRefine((data, ctx) => {
72
+ if (data.frequency === 'weekly' && (data.days_of_week == null || data.days_of_week.length === 0)) {
73
+ ctx.addIssue({
74
+ code: z.ZodIssueCode.custom,
75
+ message: 'days_of_week is required for weekly recurrence',
76
+ path: ['days_of_week'],
77
+ });
78
+ }
79
+ if (data.frequency === 'monthly') {
80
+ const hasOrdinal = data.week_of_month != null;
81
+ const hasDayOfWeekMonthly = data.day_of_week_monthly != null;
82
+ if (hasOrdinal !== hasDayOfWeekMonthly) {
83
+ ctx.addIssue({
84
+ code: z.ZodIssueCode.custom,
85
+ message: 'week_of_month and day_of_week_monthly must both be provided for ordinal monthly recurrence',
86
+ path: ['week_of_month'],
87
+ });
88
+ }
89
+ }
90
+ if (data.frequency !== 'monthly') {
91
+ if (data.day_of_month != null || data.week_of_month != null || data.day_of_week_monthly != null) {
92
+ ctx.addIssue({
93
+ code: z.ZodIssueCode.custom,
94
+ message: 'day_of_month, week_of_month, and day_of_week_monthly are only valid for monthly recurrence',
95
+ path: ['frequency'],
96
+ });
97
+ }
98
+ }
99
+ if (data.frequency !== 'weekly' && data.days_of_week != null) {
100
+ ctx.addIssue({
101
+ code: z.ZodIssueCode.custom,
102
+ message: 'days_of_week is only valid for weekly recurrence',
103
+ path: ['days_of_week'],
104
+ });
105
+ }
106
+ });
107
+ const isoDateString = z
108
+ .string()
109
+ .refine((s) => !isNaN(Date.parse(s)), { message: 'Must be a valid ISO 8601 date string' });
110
+ export const CreateEventInput = z.strictObject({
111
+ title: z.string().min(1).describe('Event title/subject'),
112
+ start_date: isoDateString.describe('Start date in ISO 8601 UTC format'),
113
+ end_date: isoDateString.describe('End date in ISO 8601 UTC format'),
114
+ calendar_id: z.number().int().positive().optional().describe('Optional calendar ID to create the event in'),
115
+ location: z.string().optional().describe('Event location'),
116
+ description: z.string().optional().describe('Event description/body text'),
117
+ is_all_day: z.boolean().optional().default(false).describe('Whether this is an all-day event'),
118
+ recurrence: RecurrenceInput.optional().describe('Recurrence pattern to make this a repeating event'),
119
+ }).refine((data) => new Date(data.start_date).getTime() < new Date(data.end_date).getTime(), { message: 'start_date must be before end_date', path: ['start_date'] });
120
+ /**
121
+ * Default event content reader that returns null.
122
+ */
123
+ export const nullEventContentReader = {
124
+ readEventDetails: () => null,
125
+ };
126
+ // =============================================================================
127
+ // Transformers
128
+ // =============================================================================
129
+ /**
130
+ * Transforms a database folder row to CalendarFolder.
131
+ */
132
+ function transformCalendar(row) {
133
+ return {
134
+ id: row.id,
135
+ name: row.name ?? 'Unnamed',
136
+ accountId: row.accountId,
137
+ };
138
+ }
139
+ /**
140
+ * Transforms a database event row to EventSummary.
141
+ */
142
+ function transformEventSummary(row, title = null) {
143
+ return {
144
+ id: row.id,
145
+ folderId: row.folderId,
146
+ title: title,
147
+ startDate: appleTimestampToIso(row.startDate),
148
+ endDate: appleTimestampToIso(row.endDate),
149
+ isRecurring: row.isRecurring === 1,
150
+ hasReminder: row.hasReminder === 1,
151
+ attendeeCount: row.attendeeCount,
152
+ uid: row.uid,
153
+ };
154
+ }
155
+ /**
156
+ * Transforms a database event row to full Event.
157
+ */
158
+ function transformEvent(row, details) {
159
+ const summary = transformEventSummary(row, details?.title ?? null);
160
+ return {
161
+ ...summary,
162
+ location: details?.location ?? null,
163
+ description: details?.description ?? null,
164
+ organizer: details?.organizer ?? null,
165
+ attendees: details?.attendees ?? [],
166
+ masterRecordId: row.masterRecordId ?? null,
167
+ recurrenceId: row.recurrenceId ?? null,
168
+ };
169
+ }
170
+ // =============================================================================
171
+ // Calendar Tools Class
172
+ // =============================================================================
173
+ /**
174
+ * Calendar tools implementation with dependency injection.
175
+ */
176
+ export class CalendarTools {
177
+ repository;
178
+ contentReader;
179
+ constructor(repository, contentReader = nullEventContentReader) {
180
+ this.repository = repository;
181
+ this.contentReader = contentReader;
182
+ }
183
+ /**
184
+ * Lists all calendar folders.
185
+ */
186
+ listCalendars(_params) {
187
+ const rows = this.repository.listCalendars();
188
+ return rows.map(transformCalendar);
189
+ }
190
+ /**
191
+ * Lists events with optional filtering.
192
+ */
193
+ listEvents(params) {
194
+ const { calendar_id, start_date, end_date, limit } = params;
195
+ let rows;
196
+ if (start_date != null && end_date != null) {
197
+ const startTimestamp = isoToAppleTimestamp(start_date);
198
+ const endTimestamp = isoToAppleTimestamp(end_date);
199
+ if (startTimestamp != null && endTimestamp != null) {
200
+ rows = this.repository.listEventsByDateRange(startTimestamp, endTimestamp, limit);
201
+ }
202
+ else {
203
+ rows = this.repository.listEvents(limit);
204
+ }
205
+ }
206
+ else if (calendar_id != null) {
207
+ rows = this.repository.listEventsByFolder(calendar_id, limit);
208
+ }
209
+ else {
210
+ rows = this.repository.listEvents(limit);
211
+ }
212
+ return rows.map((row) => {
213
+ const details = this.contentReader.readEventDetails(row.dataFilePath);
214
+ return transformEventSummary(row, details?.title ?? null);
215
+ });
216
+ }
217
+ /**
218
+ * Gets a single event by ID.
219
+ */
220
+ getEvent(params) {
221
+ const { event_id } = params;
222
+ const row = this.repository.getEvent(event_id);
223
+ if (row == null) {
224
+ return null;
225
+ }
226
+ const details = this.contentReader.readEventDetails(row.dataFilePath);
227
+ return transformEvent(row, details);
228
+ }
229
+ /**
230
+ * Searches events by title and/or date range.
231
+ */
232
+ searchEvents(params) {
233
+ const { query, start_date, end_date, limit } = params;
234
+ const rows = this.repository.searchEvents(query ?? null, start_date ?? null, end_date ?? null, limit);
235
+ return rows.map((row) => {
236
+ const details = this.contentReader.readEventDetails(row.dataFilePath);
237
+ return transformEventSummary(row, details?.title ?? null);
238
+ });
239
+ }
240
+ }
241
+ /**
242
+ * Creates calendar tools with the given repository.
243
+ */
244
+ export function createCalendarTools(repository, contentReader = nullEventContentReader) {
245
+ return new CalendarTools(repository, contentReader);
246
+ }
247
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/tools/calendar.ts"],"names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M,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACtE,OAAO,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,MAA0B;QACrC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QAEtD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CACvC,KAAK,IAAI,IAAI,EACb,UAAU,IAAI,IAAI,EAClB,QAAQ,IAAI,IAAI,EAChB,KAAK,CACN,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACtB,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACtE,OAAO,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAuB,EACvB,gBAAqC,sBAAsB;IAE3D,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,94 @@
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
+ * Master category management MCP tools.
7
+ *
8
+ * Provides tools for managing Outlook master categories 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 CreateCategoryInput: z.ZodObject<{
14
+ name: z.ZodString;
15
+ color: z.ZodEnum<{
16
+ none: "none";
17
+ preset0: "preset0";
18
+ preset1: "preset1";
19
+ preset2: "preset2";
20
+ preset3: "preset3";
21
+ preset4: "preset4";
22
+ preset5: "preset5";
23
+ preset6: "preset6";
24
+ preset7: "preset7";
25
+ preset8: "preset8";
26
+ preset9: "preset9";
27
+ preset10: "preset10";
28
+ preset11: "preset11";
29
+ preset12: "preset12";
30
+ preset13: "preset13";
31
+ preset14: "preset14";
32
+ preset15: "preset15";
33
+ preset16: "preset16";
34
+ preset17: "preset17";
35
+ preset18: "preset18";
36
+ preset19: "preset19";
37
+ preset20: "preset20";
38
+ preset21: "preset21";
39
+ preset22: "preset22";
40
+ preset23: "preset23";
41
+ preset24: "preset24";
42
+ }>;
43
+ }, z.core.$strict>;
44
+ export declare const PrepareDeleteCategoryInput: z.ZodObject<{
45
+ category_id: z.ZodNumber;
46
+ }, z.core.$strict>;
47
+ export declare const ConfirmDeleteCategoryInput: z.ZodObject<{
48
+ approval_token: z.ZodString;
49
+ }, z.core.$strict>;
50
+ export type CreateCategoryParams = z.infer<typeof CreateCategoryInput>;
51
+ export type PrepareDeleteCategoryParams = z.infer<typeof PrepareDeleteCategoryInput>;
52
+ export type ConfirmDeleteCategoryParams = z.infer<typeof ConfirmDeleteCategoryInput>;
53
+ export interface ICategoriesRepository {
54
+ listCategoriesAsync(): Promise<Array<{
55
+ id: number;
56
+ name: string;
57
+ color: string;
58
+ }>>;
59
+ createCategoryAsync(name: string, color: string): Promise<number>;
60
+ deleteCategoryAsync(categoryId: number): Promise<void>;
61
+ }
62
+ /**
63
+ * Master category tools with two-phase approval for delete operations.
64
+ */
65
+ export declare class CategoriesTools {
66
+ private readonly repo;
67
+ private readonly tokenManager;
68
+ constructor(repo: ICategoriesRepository, tokenManager: ApprovalTokenManager);
69
+ listCategories(): Promise<{
70
+ content: Array<{
71
+ type: 'text';
72
+ text: string;
73
+ }>;
74
+ }>;
75
+ createCategory(params: CreateCategoryParams): Promise<{
76
+ content: Array<{
77
+ type: 'text';
78
+ text: string;
79
+ }>;
80
+ }>;
81
+ prepareDeleteCategory(params: PrepareDeleteCategoryParams): {
82
+ content: Array<{
83
+ type: 'text';
84
+ text: string;
85
+ }>;
86
+ };
87
+ confirmDeleteCategory(params: ConfirmDeleteCategoryParams): Promise<{
88
+ content: Array<{
89
+ type: 'text';
90
+ text: string;
91
+ }>;
92
+ }>;
93
+ }
94
+ //# sourceMappingURL=categories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/tools/categories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAG9B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;kBAErC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;kBAErC,CAAC;AAMH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACvE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACrF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAMrF,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACnF,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAMD;;GAEG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,IAAI,EAAE,qBAAqB,EAC3B,YAAY,EAAE,oBAAoB;IAG/C,cAAc,IAAI,OAAO,CAAC;QAC9B,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;IAUI,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAC1D,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;IAUF,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG;QAC1D,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD;IAqBK,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC;QACxE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;CA2CH"}
@@ -0,0 +1,117 @@
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
+ * Master category management MCP tools.
7
+ *
8
+ * Provides tools for managing Outlook master categories 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 CreateCategoryInput = z.strictObject({
16
+ name: z.string().min(1).describe('Category name'),
17
+ color: z.enum(['preset0', 'preset1', 'preset2', 'preset3', 'preset4', 'preset5', 'preset6', 'preset7', 'preset8', 'preset9', 'preset10', 'preset11', 'preset12', 'preset13', 'preset14', 'preset15', 'preset16', 'preset17', 'preset18', 'preset19', 'preset20', 'preset21', 'preset22', 'preset23', 'preset24', 'none']).describe('Category color preset'),
18
+ });
19
+ export const PrepareDeleteCategoryInput = z.strictObject({
20
+ category_id: z.number().int().positive().describe('Category ID to delete'),
21
+ });
22
+ export const ConfirmDeleteCategoryInput = z.strictObject({
23
+ approval_token: z.string().describe('Approval token from prepare_delete_category'),
24
+ });
25
+ // =============================================================================
26
+ // Categories Tools
27
+ // =============================================================================
28
+ /**
29
+ * Master category tools with two-phase approval for delete operations.
30
+ */
31
+ export class CategoriesTools {
32
+ repo;
33
+ tokenManager;
34
+ constructor(repo, tokenManager) {
35
+ this.repo = repo;
36
+ this.tokenManager = tokenManager;
37
+ }
38
+ async listCategories() {
39
+ const categories = await this.repo.listCategoriesAsync();
40
+ return {
41
+ content: [{
42
+ type: 'text',
43
+ text: JSON.stringify({ categories }, null, 2),
44
+ }],
45
+ };
46
+ }
47
+ async createCategory(params) {
48
+ const categoryId = await this.repo.createCategoryAsync(params.name, params.color);
49
+ return {
50
+ content: [{
51
+ type: 'text',
52
+ text: JSON.stringify({ success: true, category_id: categoryId, message: 'Category created' }, null, 2),
53
+ }],
54
+ };
55
+ }
56
+ prepareDeleteCategory(params) {
57
+ const token = this.tokenManager.generateToken({
58
+ operation: 'delete_category',
59
+ targetType: 'category',
60
+ targetId: params.category_id,
61
+ targetHash: String(params.category_id),
62
+ });
63
+ return {
64
+ content: [{
65
+ type: 'text',
66
+ text: JSON.stringify({
67
+ approval_token: token.tokenId,
68
+ expires_at: new Date(token.expiresAt).toISOString(),
69
+ category_id: params.category_id,
70
+ action: `To confirm deleting category ${params.category_id}, call confirm_delete_category with the approval_token.`,
71
+ }, null, 2),
72
+ }],
73
+ };
74
+ }
75
+ async confirmDeleteCategory(params) {
76
+ // Look up the token to get the targetId, then consume it
77
+ const token = this.tokenManager.lookupToken(params.approval_token);
78
+ if (token == null) {
79
+ return {
80
+ content: [{
81
+ type: 'text',
82
+ text: JSON.stringify({
83
+ success: false,
84
+ error: 'Token not found or already used',
85
+ }, null, 2),
86
+ }],
87
+ };
88
+ }
89
+ const result = this.tokenManager.consumeToken(params.approval_token, 'delete_category', token.targetId);
90
+ if (!result.valid) {
91
+ const errorMessages = {
92
+ NOT_FOUND: 'Token not found or already used',
93
+ EXPIRED: 'Token has expired. Please call prepare_delete_category again.',
94
+ OPERATION_MISMATCH: 'Token was not generated for delete_category',
95
+ TARGET_MISMATCH: 'Token was generated for a different category',
96
+ ALREADY_CONSUMED: 'Token has already been used',
97
+ };
98
+ return {
99
+ content: [{
100
+ type: 'text',
101
+ text: JSON.stringify({
102
+ success: false,
103
+ error: errorMessages[result.error ?? ''] ?? 'Invalid token',
104
+ }, null, 2),
105
+ }],
106
+ };
107
+ }
108
+ await this.repo.deleteCategoryAsync(result.token.targetId);
109
+ return {
110
+ content: [{
111
+ type: 'text',
112
+ text: JSON.stringify({ success: true, message: 'Category deleted' }, null, 2),
113
+ }],
114
+ };
115
+ }
116
+ }
117
+ //# sourceMappingURL=categories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/tools/categories.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,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjD,KAAK,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,89 @@
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
+ * Checklist Item (subtask) MCP tools for Microsoft To Do.
7
+ *
8
+ * Provides tools for managing checklist items 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 ListChecklistItemsInput: z.ZodObject<{
14
+ task_id: z.ZodNumber;
15
+ }, z.core.$strict>;
16
+ export declare const CreateChecklistItemInput: z.ZodObject<{
17
+ task_id: z.ZodNumber;
18
+ display_name: z.ZodString;
19
+ is_checked: z.ZodOptional<z.ZodBoolean>;
20
+ }, z.core.$strict>;
21
+ export declare const UpdateChecklistItemInput: z.ZodObject<{
22
+ checklist_item_id: z.ZodNumber;
23
+ display_name: z.ZodOptional<z.ZodString>;
24
+ is_checked: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strict>;
26
+ export declare const PrepareDeleteChecklistItemInput: z.ZodObject<{
27
+ checklist_item_id: z.ZodNumber;
28
+ }, z.core.$strict>;
29
+ export declare const ConfirmDeleteChecklistItemInput: z.ZodObject<{
30
+ approval_token: z.ZodString;
31
+ }, z.core.$strict>;
32
+ export type ListChecklistItemsParams = z.infer<typeof ListChecklistItemsInput>;
33
+ export type CreateChecklistItemParams = z.infer<typeof CreateChecklistItemInput>;
34
+ export type UpdateChecklistItemParams = z.infer<typeof UpdateChecklistItemInput>;
35
+ export type PrepareDeleteChecklistItemParams = z.infer<typeof PrepareDeleteChecklistItemInput>;
36
+ export type ConfirmDeleteChecklistItemParams = z.infer<typeof ConfirmDeleteChecklistItemInput>;
37
+ export interface IChecklistItemsRepository {
38
+ listChecklistItemsAsync(taskId: number): Promise<Array<{
39
+ id: number;
40
+ displayName: string;
41
+ isChecked: boolean;
42
+ createdDateTime: string;
43
+ }>>;
44
+ createChecklistItemAsync(taskId: number, displayName: string, isChecked?: boolean): Promise<number>;
45
+ updateChecklistItemAsync(checklistItemId: number, updates: {
46
+ displayName?: string;
47
+ isChecked?: boolean;
48
+ }): Promise<void>;
49
+ deleteChecklistItemAsync(checklistItemId: number): Promise<void>;
50
+ }
51
+ /**
52
+ * Checklist item tools with two-phase approval for delete operations.
53
+ */
54
+ export declare class ChecklistItemsTools {
55
+ private readonly repo;
56
+ private readonly tokenManager;
57
+ constructor(repo: IChecklistItemsRepository, tokenManager: ApprovalTokenManager);
58
+ listChecklistItems(params: ListChecklistItemsParams): Promise<{
59
+ content: Array<{
60
+ type: 'text';
61
+ text: string;
62
+ }>;
63
+ }>;
64
+ createChecklistItem(params: CreateChecklistItemParams): Promise<{
65
+ content: Array<{
66
+ type: 'text';
67
+ text: string;
68
+ }>;
69
+ }>;
70
+ updateChecklistItem(params: UpdateChecklistItemParams): Promise<{
71
+ content: Array<{
72
+ type: 'text';
73
+ text: string;
74
+ }>;
75
+ }>;
76
+ prepareDeleteChecklistItem(params: PrepareDeleteChecklistItemParams): {
77
+ content: Array<{
78
+ type: 'text';
79
+ text: string;
80
+ }>;
81
+ };
82
+ confirmDeleteChecklistItem(params: ConfirmDeleteChecklistItemParams): Promise<{
83
+ content: Array<{
84
+ type: 'text';
85
+ text: string;
86
+ }>;
87
+ }>;
88
+ }
89
+ //# sourceMappingURL=checklist-items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist-items.d.ts","sourceRoot":"","sources":["../../src/tools/checklist-items.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,eAAO,MAAM,uBAAuB;;kBAElC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;kBAInC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;kBAInC,CAAC;AAEH,eAAO,MAAM,+B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