@jbctechsolutions/mcp-office365 2.5.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/README.md +66 -57
  2. package/dist/approval/hash.d.ts +8 -8
  3. package/dist/approval/token-manager.d.ts +37 -19
  4. package/dist/approval/token-manager.d.ts.map +1 -1
  5. package/dist/approval/token-manager.js +133 -37
  6. package/dist/approval/token-manager.js.map +1 -1
  7. package/dist/approval/types.d.ts +7 -3
  8. package/dist/approval/types.d.ts.map +1 -1
  9. package/dist/cli.d.ts +21 -0
  10. package/dist/cli.d.ts.map +1 -1
  11. package/dist/cli.js +100 -2
  12. package/dist/cli.js.map +1 -1
  13. package/dist/database/repository.d.ts +48 -48
  14. package/dist/database/repository.d.ts.map +1 -1
  15. package/dist/database/repository.js.map +1 -1
  16. package/dist/delta/mirror.d.ts +67 -0
  17. package/dist/delta/mirror.d.ts.map +1 -0
  18. package/dist/delta/mirror.js +183 -0
  19. package/dist/delta/mirror.js.map +1 -0
  20. package/dist/graph/auth/account-id.d.ts +19 -0
  21. package/dist/graph/auth/account-id.d.ts.map +1 -0
  22. package/dist/graph/auth/account-id.js +55 -0
  23. package/dist/graph/auth/account-id.js.map +1 -0
  24. package/dist/graph/auth/config.d.ts +1 -1
  25. package/dist/graph/auth/config.d.ts.map +1 -1
  26. package/dist/graph/auth/config.js +13 -1
  27. package/dist/graph/auth/config.js.map +1 -1
  28. package/dist/graph/auth/device-code-flow.d.ts +3 -1
  29. package/dist/graph/auth/device-code-flow.d.ts.map +1 -1
  30. package/dist/graph/auth/device-code-flow.js +42 -14
  31. package/dist/graph/auth/device-code-flow.js.map +1 -1
  32. package/dist/graph/auth/index.d.ts +1 -0
  33. package/dist/graph/auth/index.d.ts.map +1 -1
  34. package/dist/graph/auth/index.js +1 -0
  35. package/dist/graph/auth/index.js.map +1 -1
  36. package/dist/graph/auth/token-cache.js +2 -2
  37. package/dist/graph/auth/token-cache.js.map +1 -1
  38. package/dist/graph/client/graph-client.d.ts +141 -8
  39. package/dist/graph/client/graph-client.d.ts.map +1 -1
  40. package/dist/graph/client/graph-client.js +536 -48
  41. package/dist/graph/client/graph-client.js.map +1 -1
  42. package/dist/graph/client/immutable-id-middleware.d.ts +50 -0
  43. package/dist/graph/client/immutable-id-middleware.d.ts.map +1 -0
  44. package/dist/graph/client/immutable-id-middleware.js +137 -0
  45. package/dist/graph/client/immutable-id-middleware.js.map +1 -0
  46. package/dist/graph/content-readers.d.ts +0 -12
  47. package/dist/graph/content-readers.d.ts.map +1 -1
  48. package/dist/graph/content-readers.js +0 -21
  49. package/dist/graph/content-readers.js.map +1 -1
  50. package/dist/graph/index.d.ts +5 -6
  51. package/dist/graph/index.d.ts.map +1 -1
  52. package/dist/graph/index.js +5 -6
  53. package/dist/graph/index.js.map +1 -1
  54. package/dist/graph/mailbox-adapter.d.ts +15 -15
  55. package/dist/graph/mappers/contact-mapper.d.ts +4 -1
  56. package/dist/graph/mappers/contact-mapper.d.ts.map +1 -1
  57. package/dist/graph/mappers/contact-mapper.js +7 -3
  58. package/dist/graph/mappers/contact-mapper.js.map +1 -1
  59. package/dist/graph/mappers/email-mapper.d.ts.map +1 -1
  60. package/dist/graph/mappers/email-mapper.js +7 -4
  61. package/dist/graph/mappers/email-mapper.js.map +1 -1
  62. package/dist/graph/mappers/event-mapper.d.ts.map +1 -1
  63. package/dist/graph/mappers/event-mapper.js +6 -3
  64. package/dist/graph/mappers/event-mapper.js.map +1 -1
  65. package/dist/graph/mappers/folder-mapper.d.ts +0 -4
  66. package/dist/graph/mappers/folder-mapper.d.ts.map +1 -1
  67. package/dist/graph/mappers/folder-mapper.js +9 -19
  68. package/dist/graph/mappers/folder-mapper.js.map +1 -1
  69. package/dist/graph/mappers/index.d.ts +2 -2
  70. package/dist/graph/mappers/index.d.ts.map +1 -1
  71. package/dist/graph/mappers/index.js +2 -2
  72. package/dist/graph/mappers/index.js.map +1 -1
  73. package/dist/graph/mappers/task-mapper.d.ts +4 -2
  74. package/dist/graph/mappers/task-mapper.d.ts.map +1 -1
  75. package/dist/graph/mappers/task-mapper.js +7 -5
  76. package/dist/graph/mappers/task-mapper.js.map +1 -1
  77. package/dist/graph/mappers/utils.d.ts +0 -10
  78. package/dist/graph/mappers/utils.d.ts.map +1 -1
  79. package/dist/graph/mappers/utils.js +0 -19
  80. package/dist/graph/mappers/utils.js.map +1 -1
  81. package/dist/graph/repository.d.ts +409 -276
  82. package/dist/graph/repository.d.ts.map +1 -1
  83. package/dist/graph/repository.js +772 -1082
  84. package/dist/graph/repository.js.map +1 -1
  85. package/dist/ids/mint.d.ts +31 -0
  86. package/dist/ids/mint.d.ts.map +1 -0
  87. package/dist/ids/mint.js +36 -0
  88. package/dist/ids/mint.js.map +1 -0
  89. package/dist/ids/next-action.d.ts +29 -0
  90. package/dist/ids/next-action.d.ts.map +1 -0
  91. package/dist/ids/next-action.js +58 -0
  92. package/dist/ids/next-action.js.map +1 -0
  93. package/dist/ids/resolver.d.ts +31 -0
  94. package/dist/ids/resolver.d.ts.map +1 -0
  95. package/dist/ids/resolver.js +52 -0
  96. package/dist/ids/resolver.js.map +1 -0
  97. package/dist/ids/schema.d.ts +91 -0
  98. package/dist/ids/schema.d.ts.map +1 -0
  99. package/dist/ids/schema.js +131 -0
  100. package/dist/ids/schema.js.map +1 -0
  101. package/dist/ids/token.d.ts +62 -0
  102. package/dist/ids/token.d.ts.map +1 -0
  103. package/dist/ids/token.js +225 -0
  104. package/dist/ids/token.js.map +1 -0
  105. package/dist/index.d.ts +10 -6
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +255 -5925
  108. package/dist/index.js.map +1 -1
  109. package/dist/parsers/index.d.ts +0 -1
  110. package/dist/parsers/index.d.ts.map +1 -1
  111. package/dist/parsers/index.js +0 -1
  112. package/dist/parsers/index.js.map +1 -1
  113. package/dist/registry/all-tools.d.ts +14 -0
  114. package/dist/registry/all-tools.d.ts.map +1 -0
  115. package/dist/registry/all-tools.js +68 -0
  116. package/dist/registry/all-tools.js.map +1 -0
  117. package/dist/registry/context.d.ts +19 -0
  118. package/dist/registry/context.d.ts.map +1 -0
  119. package/dist/registry/context.js +20 -0
  120. package/dist/registry/context.js.map +1 -0
  121. package/dist/registry/define-tool.d.ts +15 -0
  122. package/dist/registry/define-tool.d.ts.map +1 -0
  123. package/dist/registry/define-tool.js +8 -0
  124. package/dist/registry/define-tool.js.map +1 -0
  125. package/dist/registry/elicit-links.d.ts +35 -0
  126. package/dist/registry/elicit-links.d.ts.map +1 -0
  127. package/dist/registry/elicit-links.js +102 -0
  128. package/dist/registry/elicit-links.js.map +1 -0
  129. package/dist/registry/elicitor.d.ts +24 -0
  130. package/dist/registry/elicitor.d.ts.map +1 -0
  131. package/dist/registry/elicitor.js +51 -0
  132. package/dist/registry/elicitor.js.map +1 -0
  133. package/dist/registry/index.d.ts +13 -0
  134. package/dist/registry/index.d.ts.map +1 -0
  135. package/dist/registry/index.js +8 -0
  136. package/dist/registry/index.js.map +1 -0
  137. package/dist/registry/registry.d.ts +73 -0
  138. package/dist/registry/registry.d.ts.map +1 -0
  139. package/dist/registry/registry.js +221 -0
  140. package/dist/registry/registry.js.map +1 -0
  141. package/dist/registry/types.d.ts +146 -0
  142. package/dist/registry/types.d.ts.map +1 -0
  143. package/dist/registry/types.js +6 -0
  144. package/dist/registry/types.js.map +1 -0
  145. package/dist/search/compiler.d.ts +49 -0
  146. package/dist/search/compiler.d.ts.map +1 -0
  147. package/dist/search/compiler.js +168 -0
  148. package/dist/search/compiler.js.map +1 -0
  149. package/dist/signature.js +2 -2
  150. package/dist/signature.js.map +1 -1
  151. package/dist/state/delta-store.d.ts +85 -0
  152. package/dist/state/delta-store.d.ts.map +1 -0
  153. package/dist/state/delta-store.js +124 -0
  154. package/dist/state/delta-store.js.map +1 -0
  155. package/dist/state/migrate.d.ts +23 -0
  156. package/dist/state/migrate.d.ts.map +1 -0
  157. package/dist/state/migrate.js +81 -0
  158. package/dist/state/migrate.js.map +1 -0
  159. package/dist/state/schema.d.ts +26 -0
  160. package/dist/state/schema.d.ts.map +1 -0
  161. package/dist/state/schema.js +77 -0
  162. package/dist/state/schema.js.map +1 -0
  163. package/dist/state/store.d.ts +155 -0
  164. package/dist/state/store.d.ts.map +1 -0
  165. package/dist/state/store.js +321 -0
  166. package/dist/state/store.js.map +1 -0
  167. package/dist/tools/calendar-graph.d.ts +41 -0
  168. package/dist/tools/calendar-graph.d.ts.map +1 -0
  169. package/dist/tools/calendar-graph.js +299 -0
  170. package/dist/tools/calendar-graph.js.map +1 -0
  171. package/dist/tools/calendar-permissions.d.ts +17 -7
  172. package/dist/tools/calendar-permissions.d.ts.map +1 -1
  173. package/dist/tools/calendar-permissions.js +60 -4
  174. package/dist/tools/calendar-permissions.js.map +1 -1
  175. package/dist/tools/calendar.d.ts +133 -82
  176. package/dist/tools/calendar.d.ts.map +1 -1
  177. package/dist/tools/calendar.js +249 -136
  178. package/dist/tools/calendar.js.map +1 -1
  179. package/dist/tools/categories.d.ts +14 -4
  180. package/dist/tools/categories.d.ts.map +1 -1
  181. package/dist/tools/categories.js +59 -2
  182. package/dist/tools/categories.js.map +1 -1
  183. package/dist/tools/checklist-items.d.ts +19 -9
  184. package/dist/tools/checklist-items.d.ts.map +1 -1
  185. package/dist/tools/checklist-items.js +71 -5
  186. package/dist/tools/checklist-items.js.map +1 -1
  187. package/dist/tools/contact-folders.d.ts +50 -0
  188. package/dist/tools/contact-folders.d.ts.map +1 -0
  189. package/dist/tools/contact-folders.js +136 -0
  190. package/dist/tools/contact-folders.js.map +1 -0
  191. package/dist/tools/contacts-graph.d.ts +45 -0
  192. package/dist/tools/contacts-graph.d.ts.map +1 -0
  193. package/dist/tools/contacts-graph.js +174 -0
  194. package/dist/tools/contacts-graph.js.map +1 -0
  195. package/dist/tools/contacts.d.ts +61 -30
  196. package/dist/tools/contacts.d.ts.map +1 -1
  197. package/dist/tools/contacts.js +150 -93
  198. package/dist/tools/contacts.js.map +1 -1
  199. package/dist/tools/excel.d.ts +20 -10
  200. package/dist/tools/excel.d.ts.map +1 -1
  201. package/dist/tools/excel.js +82 -6
  202. package/dist/tools/excel.js.map +1 -1
  203. package/dist/tools/focused-overrides.d.ts +14 -4
  204. package/dist/tools/focused-overrides.d.ts.map +1 -1
  205. package/dist/tools/focused-overrides.js +59 -2
  206. package/dist/tools/focused-overrides.js.map +1 -1
  207. package/dist/tools/index.d.ts +4 -5
  208. package/dist/tools/index.d.ts.map +1 -1
  209. package/dist/tools/index.js +4 -6
  210. package/dist/tools/index.js.map +1 -1
  211. package/dist/tools/linked-resources.d.ts +17 -7
  212. package/dist/tools/linked-resources.d.ts.map +1 -1
  213. package/dist/tools/linked-resources.js +60 -4
  214. package/dist/tools/linked-resources.js.map +1 -1
  215. package/dist/tools/mail-graph.d.ts +38 -0
  216. package/dist/tools/mail-graph.d.ts.map +1 -0
  217. package/dist/tools/mail-graph.js +187 -0
  218. package/dist/tools/mail-graph.js.map +1 -0
  219. package/dist/tools/mail-rules.d.ts +20 -8
  220. package/dist/tools/mail-rules.d.ts.map +1 -1
  221. package/dist/tools/mail-rules.js +63 -7
  222. package/dist/tools/mail-rules.js.map +1 -1
  223. package/dist/tools/mail-send.d.ts +39 -27
  224. package/dist/tools/mail-send.d.ts.map +1 -1
  225. package/dist/tools/mail-send.js +249 -24
  226. package/dist/tools/mail-send.js.map +1 -1
  227. package/dist/tools/mail.d.ts +91 -68
  228. package/dist/tools/mail.d.ts.map +1 -1
  229. package/dist/tools/mail.js +232 -243
  230. package/dist/tools/mail.js.map +1 -1
  231. package/dist/tools/mailbox-organization.d.ts +51 -34
  232. package/dist/tools/mailbox-organization.d.ts.map +1 -1
  233. package/dist/tools/mailbox-organization.js +318 -35
  234. package/dist/tools/mailbox-organization.js.map +1 -1
  235. package/dist/tools/mailbox-settings.d.ts +59 -0
  236. package/dist/tools/mailbox-settings.d.ts.map +1 -0
  237. package/dist/tools/mailbox-settings.js +136 -0
  238. package/dist/tools/mailbox-settings.js.map +1 -0
  239. package/dist/tools/meetings.d.ts +24 -14
  240. package/dist/tools/meetings.d.ts.map +1 -1
  241. package/dist/tools/meetings.js +82 -6
  242. package/dist/tools/meetings.js.map +1 -1
  243. package/dist/tools/onedrive.d.ts +26 -16
  244. package/dist/tools/onedrive.d.ts.map +1 -1
  245. package/dist/tools/onedrive.js +140 -11
  246. package/dist/tools/onedrive.js.map +1 -1
  247. package/dist/tools/onenote.d.ts +63 -0
  248. package/dist/tools/onenote.d.ts.map +1 -0
  249. package/dist/tools/onenote.js +221 -0
  250. package/dist/tools/onenote.js.map +1 -0
  251. package/dist/tools/people.d.ts +10 -0
  252. package/dist/tools/people.d.ts.map +1 -1
  253. package/dist/tools/people.js +94 -0
  254. package/dist/tools/people.js.map +1 -1
  255. package/dist/tools/planner-visualization.d.ts +15 -5
  256. package/dist/tools/planner-visualization.d.ts.map +1 -1
  257. package/dist/tools/planner-visualization.js +58 -4
  258. package/dist/tools/planner-visualization.js.map +1 -1
  259. package/dist/tools/planner.d.ts +69 -39
  260. package/dist/tools/planner.d.ts.map +1 -1
  261. package/dist/tools/planner.js +231 -23
  262. package/dist/tools/planner.js.map +1 -1
  263. package/dist/tools/scheduling.d.ts +12 -0
  264. package/dist/tools/scheduling.d.ts.map +1 -1
  265. package/dist/tools/scheduling.js +38 -0
  266. package/dist/tools/scheduling.js.map +1 -1
  267. package/dist/tools/shared-mailbox.d.ts +164 -0
  268. package/dist/tools/shared-mailbox.d.ts.map +1 -0
  269. package/dist/tools/shared-mailbox.js +318 -0
  270. package/dist/tools/shared-mailbox.js.map +1 -0
  271. package/dist/tools/sharepoint-lists.d.ts +131 -0
  272. package/dist/tools/sharepoint-lists.d.ts.map +1 -0
  273. package/dist/tools/sharepoint-lists.js +246 -0
  274. package/dist/tools/sharepoint-lists.js.map +1 -0
  275. package/dist/tools/sharepoint.d.ts +24 -14
  276. package/dist/tools/sharepoint.d.ts.map +1 -1
  277. package/dist/tools/sharepoint.js +85 -9
  278. package/dist/tools/sharepoint.js.map +1 -1
  279. package/dist/tools/task-attachments.d.ts +17 -7
  280. package/dist/tools/task-attachments.d.ts.map +1 -1
  281. package/dist/tools/task-attachments.js +60 -4
  282. package/dist/tools/task-attachments.js.map +1 -1
  283. package/dist/tools/task-lists.d.ts +56 -0
  284. package/dist/tools/task-lists.d.ts.map +1 -0
  285. package/dist/tools/task-lists.js +155 -0
  286. package/dist/tools/task-lists.js.map +1 -0
  287. package/dist/tools/tasks-graph.d.ts +49 -0
  288. package/dist/tools/tasks-graph.d.ts.map +1 -0
  289. package/dist/tools/tasks-graph.js +193 -0
  290. package/dist/tools/tasks-graph.js.map +1 -0
  291. package/dist/tools/tasks.d.ts +121 -29
  292. package/dist/tools/tasks.d.ts.map +1 -1
  293. package/dist/tools/tasks.js +136 -84
  294. package/dist/tools/tasks.js.map +1 -1
  295. package/dist/tools/teams.d.ts +57 -46
  296. package/dist/tools/teams.d.ts.map +1 -1
  297. package/dist/tools/teams.js +288 -26
  298. package/dist/tools/teams.js.map +1 -1
  299. package/dist/tools/what-changed.d.ts +48 -0
  300. package/dist/tools/what-changed.d.ts.map +1 -0
  301. package/dist/tools/what-changed.js +149 -0
  302. package/dist/tools/what-changed.js.map +1 -0
  303. package/dist/types/calendar.d.ts +1 -1
  304. package/dist/types/calendar.d.ts.map +1 -1
  305. package/dist/types/calendar.js.map +1 -1
  306. package/dist/types/contacts.d.ts +1 -1
  307. package/dist/types/contacts.d.ts.map +1 -1
  308. package/dist/types/contacts.js.map +1 -1
  309. package/dist/types/mail.d.ts +1 -1
  310. package/dist/types/mail.d.ts.map +1 -1
  311. package/dist/types/mail.js.map +1 -1
  312. package/dist/utils/errors.d.ts +110 -38
  313. package/dist/utils/errors.d.ts.map +1 -1
  314. package/dist/utils/errors.js +239 -56
  315. package/dist/utils/errors.js.map +1 -1
  316. package/dist/visualization/types.d.ts +4 -4
  317. package/package.json +2 -3
  318. package/dist/applescript/account-repository.d.ts +0 -30
  319. package/dist/applescript/account-repository.d.ts.map +0 -1
  320. package/dist/applescript/account-repository.js +0 -38
  321. package/dist/applescript/account-repository.js.map +0 -1
  322. package/dist/applescript/account-scripts.d.ts +0 -21
  323. package/dist/applescript/account-scripts.d.ts.map +0 -1
  324. package/dist/applescript/account-scripts.js +0 -180
  325. package/dist/applescript/account-scripts.js.map +0 -1
  326. package/dist/applescript/calendar-manager.d.ts +0 -44
  327. package/dist/applescript/calendar-manager.d.ts.map +0 -1
  328. package/dist/applescript/calendar-manager.js +0 -92
  329. package/dist/applescript/calendar-manager.js.map +0 -1
  330. package/dist/applescript/calendar-writer.d.ts +0 -36
  331. package/dist/applescript/calendar-writer.d.ts.map +0 -1
  332. package/dist/applescript/calendar-writer.js +0 -94
  333. package/dist/applescript/calendar-writer.js.map +0 -1
  334. package/dist/applescript/content-readers.d.ts +0 -114
  335. package/dist/applescript/content-readers.d.ts.map +0 -1
  336. package/dist/applescript/content-readers.js +0 -328
  337. package/dist/applescript/content-readers.js.map +0 -1
  338. package/dist/applescript/executor.d.ts +0 -60
  339. package/dist/applescript/executor.d.ts.map +0 -1
  340. package/dist/applescript/executor.js +0 -173
  341. package/dist/applescript/executor.js.map +0 -1
  342. package/dist/applescript/index.d.ts +0 -20
  343. package/dist/applescript/index.d.ts.map +0 -1
  344. package/dist/applescript/index.js +0 -29
  345. package/dist/applescript/index.js.map +0 -1
  346. package/dist/applescript/mail-sender.d.ts +0 -38
  347. package/dist/applescript/mail-sender.d.ts.map +0 -1
  348. package/dist/applescript/mail-sender.js +0 -67
  349. package/dist/applescript/mail-sender.js.map +0 -1
  350. package/dist/applescript/parser.d.ts +0 -235
  351. package/dist/applescript/parser.d.ts.map +0 -1
  352. package/dist/applescript/parser.js +0 -496
  353. package/dist/applescript/parser.js.map +0 -1
  354. package/dist/applescript/repository.d.ts +0 -64
  355. package/dist/applescript/repository.d.ts.map +0 -1
  356. package/dist/applescript/repository.js +0 -444
  357. package/dist/applescript/repository.js.map +0 -1
  358. package/dist/applescript/scripts.d.ts +0 -265
  359. package/dist/applescript/scripts.d.ts.map +0 -1
  360. package/dist/applescript/scripts.js +0 -1483
  361. package/dist/applescript/scripts.js.map +0 -1
  362. package/dist/parsers/olk15.d.ts +0 -87
  363. package/dist/parsers/olk15.d.ts.map +0 -1
  364. package/dist/parsers/olk15.js +0 -368
  365. package/dist/parsers/olk15.js.map +0 -1
  366. package/dist/tools/notes.d.ts +0 -74
  367. package/dist/tools/notes.d.ts.map +0 -1
  368. package/dist/tools/notes.js +0 -136
  369. package/dist/tools/notes.js.map +0 -1
@@ -11,6 +11,8 @@
11
11
  import type { IRepository, FolderRow, EmailRow, EventRow, ContactRow, TaskRow, NoteRow } from '../database/repository.js';
12
12
  import { GraphClient } from './client/index.js';
13
13
  import type { DeviceCodeCallback } from './auth/index.js';
14
+ import type { StateStore } from '../state/store.js';
15
+ import type { CompiledSearch } from '../search/compiler.js';
14
16
  import type { PlanVisualizationData } from '../visualization/types.js';
15
17
  /**
16
18
  * Repository implementation using Microsoft Graph API.
@@ -19,97 +21,148 @@ import type { PlanVisualizationData } from '../visualization/types.js';
19
21
  */
20
22
  export declare class GraphRepository implements IRepository {
21
23
  private readonly client;
24
+ private readonly store;
25
+ private readonly accountId;
22
26
  private readonly deltaLinks;
23
- private readonly idCache;
24
- constructor(deviceCodeCallback?: DeviceCodeCallback);
27
+ constructor(deviceCodeCallback?: DeviceCodeCallback, store?: StateStore, accountId?: () => string);
28
+ /**
29
+ * Resolves any id a tool receives — a durable token, a raw Graph id, or a
30
+ * legacy numeric id — to a live Graph id (U5). Self-encoding tokens decode with
31
+ * no store; alias-backed tokens need {@link store}; a numeric id on Graph is
32
+ * unsupported (D4). Throws a typed error on failure.
33
+ */
34
+ private toGraphId;
35
+ /**
36
+ * Mints an alias-backed token for a single-Graph-id entity (e.g. team, chat)
37
+ * and records token → graphId in the alias table so it resolves on later calls.
38
+ * Alias-backed (not self-encoding) so the token is short and account-scoped: a
39
+ * cold store yields ID_UNKNOWN rather than leaking a decodable tenant-global id.
40
+ */
41
+ private mintAlias;
42
+ /**
43
+ * Mints an alias-backed token for a composite entity whose Graph URL needs a
44
+ * tuple of ids (e.g. channel {teamId, channelId}). The tuple is the canonical
45
+ * key AND is stored JSON-encoded as the resolved value, so {@link toGraphParts}
46
+ * can recover every field.
47
+ */
48
+ private mintAliasComposite;
49
+ /**
50
+ * Resolves a composite token to its identifying tuple. The alias row stores the
51
+ * tuple JSON-encoded; a raw (non-token) string can't carry a tuple, so anything
52
+ * that doesn't decode to a JSON object carrying every required key is an unusable
53
+ * id (ID_UNKNOWN). Generic over the key set so callers get a precisely-typed
54
+ * result — every requested field is a guaranteed non-empty string.
55
+ */
56
+ private toGraphParts;
57
+ private resolveTeamId;
58
+ private resolvePlanId;
59
+ /** True for an HTTP 412 (Precondition Failed) — the `If-Match` etag we sent no
60
+ * longer matches the entity's current etag. */
61
+ private isPreconditionFailed;
62
+ /** Extracts the OData etag from a fetched entity, defaulting to `''` when absent. */
63
+ private extractEtag;
64
+ /**
65
+ * Fetches a fresh etag immediately before a write (U5b-5 — the Planner etag is
66
+ * mutable and per-sub-resource, so it can't ride in the durable token or a
67
+ * cache) and retries the write once with a re-fetched etag on a 412, covering
68
+ * the narrow race between the fetch and the write.
69
+ *
70
+ * CONCURRENCY SEMANTIC (deliberate, last-writer-wins): because MCP tool calls
71
+ * are stateless, the etag the caller observed at an earlier `get_*` cannot be
72
+ * carried into a later `update_*`. We therefore re-read the etag at write time,
73
+ * which means a concurrent edit landing between the caller's read and their
74
+ * write is NOT detected — the write overwrites it. This is the intended
75
+ * trade-off (it eliminates the spurious 412s the old cached-etag path produced
76
+ * for a lone editor); Planner writes are not cross-read conflict-protected.
77
+ */
78
+ private withFreshEtag;
79
+ private resolveChatId;
25
80
  listFolders(): FolderRow[];
26
81
  listFoldersAsync(): Promise<FolderRow[]>;
27
- getFolder(_id: number): FolderRow | undefined;
28
- getFolderAsync(id: number): Promise<FolderRow | undefined>;
82
+ getFolder(_id: string): FolderRow | undefined;
83
+ getFolderAsync(id: string): Promise<FolderRow | undefined>;
29
84
  listEmails(_folderId: number, _limit: number, _offset: number): EmailRow[];
30
- listEmailsAsync(folderId: number, limit: number, offset: number): Promise<EmailRow[]>;
85
+ listEmailsAsync(folderId: string, limit: number, offset: number): Promise<EmailRow[]>;
31
86
  private listEmailsWithGraphId;
32
87
  listUnreadEmails(_folderId: number, _limit: number, _offset: number): EmailRow[];
33
- listUnreadEmailsAsync(folderId: number, limit: number, offset: number): Promise<EmailRow[]>;
88
+ listUnreadEmailsAsync(folderId: string, limit: number, offset: number): Promise<EmailRow[]>;
34
89
  private listUnreadEmailsWithGraphId;
35
90
  searchEmails(_query: string, _limit: number): EmailRow[];
36
91
  searchEmailsAsync(query: string, limit: number): Promise<EmailRow[]>;
37
92
  searchEmailsInFolder(_folderId: number, _query: string, _limit: number): EmailRow[];
38
- searchEmailsInFolderAsync(folderId: number, query: string, limit: number): Promise<EmailRow[]>;
93
+ searchEmailsInFolderAsync(folderId: string, query: string, limit: number): Promise<EmailRow[]>;
39
94
  private searchEmailsInFolderWithGraphId;
40
95
  /**
41
- * Advanced search using raw KQL query syntax.
42
- */
43
- searchEmailsAdvancedAsync(query: string, limit: number): Promise<EmailRow[]>;
44
- /**
45
- * Advanced search in a specific folder using raw KQL query syntax.
96
+ * Structured advanced search (U7 / D9). Runs a compiled query on the correct
97
+ * Graph mechanism ($filter / quoted $search / /search/query), then caches IDs
98
+ * and maps to EmailRow[] exactly like the raw-KQL path it replaces.
46
99
  */
47
- searchEmailsAdvancedInFolderAsync(folderId: number, query: string, limit: number): Promise<EmailRow[]>;
48
- checkNewEmailsAsync(folderId: number): Promise<{
100
+ searchEmailsStructuredAsync(compiled: CompiledSearch, limit: number): Promise<EmailRow[]>;
101
+ private runStructuredSearch;
102
+ checkNewEmailsAsync(folderId: string): Promise<{
49
103
  emails: EmailRow[];
50
104
  isInitialSync: boolean;
51
105
  }>;
52
- getEmail(_id: number): EmailRow | undefined;
53
- /**
54
- * Populates the message ID cache by listing messages from mail folders.
55
- * Used as a fallback when getEmailAsync is called with an ID not yet in cache
56
- * (e.g. after server restart or when list_emails/search_emails wasn't called first).
57
- */
58
- private refreshMessageCacheForGetEmail;
59
- getEmailAsync(id: number): Promise<EmailRow | undefined>;
106
+ getEmail(_id: string): EmailRow | undefined;
107
+ getEmailAsync(id: string): Promise<EmailRow | undefined>;
60
108
  getUnreadCount(): number;
61
109
  getUnreadCountAsync(): Promise<number>;
62
110
  getUnreadCountByFolder(_folderId: number): number;
63
- getUnreadCountByFolderAsync(folderId: number): Promise<number>;
111
+ getUnreadCountByFolderAsync(folderId: string): Promise<number>;
64
112
  /**
65
113
  * Lists all messages in a conversation thread.
66
114
  *
67
- * Looks up the message to get its conversationId, resolves the Graph string
68
- * conversationId from cache, then queries for all messages with that ID.
115
+ * Resolves the message id to its Graph id (durable `em_` token or raw Graph
116
+ * id), fetches the message to read its raw Graph conversationId, then queries
117
+ * for all messages with that ID. No cache required.
69
118
  */
70
- listConversationAsync(messageId: number, limit: number): Promise<EmailRow[]>;
119
+ listConversationAsync(messageId: string, limit: number): Promise<EmailRow[]>;
71
120
  listCalendars(): FolderRow[];
72
121
  listCalendarsAsync(): Promise<FolderRow[]>;
73
122
  listEvents(_limit: number): EventRow[];
74
123
  listEventsAsync(limit: number): Promise<EventRow[]>;
75
124
  listEventsByFolder(_folderId: number, _limit: number): EventRow[];
76
- listEventsByFolderAsync(folderId: number, limit: number): Promise<EventRow[]>;
125
+ listEventsByFolderAsync(folderId: string, limit: number): Promise<EventRow[]>;
77
126
  searchEvents(_query: string | null, _startDate: string | null, _endDate: string | null, _limit: number): EventRow[];
78
127
  searchEventsAsync(query: string | null, startDate: string | null, endDate: string | null, limit: number): Promise<EventRow[]>;
79
128
  listEventsByDateRange(_startDate: number, _endDate: number, _limit: number): EventRow[];
80
129
  listEventsByDateRangeAsync(startDate: number, endDate: number, limit: number): Promise<EventRow[]>;
81
- getEvent(_id: number): EventRow | undefined;
82
- getEventAsync(id: number): Promise<EventRow | undefined>;
83
- listEventInstancesAsync(eventId: number, startDate: string, endDate: string): Promise<EventRow[]>;
130
+ getEvent(_id: string): EventRow | undefined;
131
+ getEventAsync(id: string): Promise<EventRow | undefined>;
132
+ /** Resolves an event id (durable `ev_` token or raw Graph id) to its Graph id. */
133
+ getEventGraphId(id: string): string;
134
+ listEventInstancesAsync(eventId: string, startDate: string, endDate: string): Promise<EventRow[]>;
84
135
  listContacts(_limit: number, _offset: number): ContactRow[];
85
136
  listContactsAsync(limit: number, offset: number): Promise<ContactRow[]>;
86
137
  searchContacts(_query: string, _limit: number): ContactRow[];
87
138
  searchContactsAsync(query: string, limit: number): Promise<ContactRow[]>;
88
- getContact(_id: number): ContactRow | undefined;
89
- getContactAsync(id: number): Promise<ContactRow | undefined>;
139
+ getContact(_id: string): ContactRow | undefined;
140
+ getContactAsync(id: string): Promise<ContactRow | undefined>;
141
+ /** Resolves a contact id (durable `ct_` token or raw Graph id) to its Graph id. */
142
+ getContactGraphId(id: string): string;
90
143
  listContactFoldersAsync(): Promise<Array<{
91
- id: number;
144
+ id: string;
92
145
  name: string;
93
146
  parentFolderId: string | null;
94
147
  }>>;
95
- createContactFolderAsync(name: string): Promise<number>;
96
- deleteContactFolderAsync(folderId: number): Promise<void>;
97
- listContactsInFolderAsync(folderId: number, limit?: number): Promise<ContactRow[]>;
98
- getContactPhotoAsync(contactId: number): Promise<{
148
+ createContactFolderAsync(name: string): Promise<string>;
149
+ deleteContactFolderAsync(folderId: string): Promise<void>;
150
+ listContactsInFolderAsync(folderId: string, limit?: number): Promise<ContactRow[]>;
151
+ getContactPhotoAsync(contactId: string): Promise<{
99
152
  filePath: string;
100
153
  contentType: string;
101
154
  }>;
102
- setContactPhotoAsync(contactId: number, filePath: string): Promise<void>;
155
+ setContactPhotoAsync(contactId: string, filePath: string): Promise<void>;
103
156
  listTasks(_limit: number, _offset: number): TaskRow[];
104
157
  listTasksAsync(limit: number, offset: number): Promise<TaskRow[]>;
105
158
  listIncompleteTasks(_limit: number, _offset: number): TaskRow[];
106
159
  listIncompleteTasksAsync(limit: number, offset: number): Promise<TaskRow[]>;
107
160
  searchTasks(_query: string, _limit: number): TaskRow[];
108
161
  searchTasksAsync(query: string, limit: number): Promise<TaskRow[]>;
109
- getTask(_id: number): TaskRow | undefined;
110
- getTaskAsync(id: number): Promise<TaskRow | undefined>;
162
+ getTask(_id: string): TaskRow | undefined;
163
+ getTaskAsync(id: string): Promise<TaskRow | undefined>;
111
164
  listTaskListsAsync(): Promise<Array<{
112
- id: number;
165
+ id: string;
113
166
  name: string;
114
167
  isDefault: boolean;
115
168
  }>>;
@@ -126,55 +179,52 @@ export declare class GraphRepository implements IRepository {
126
179
  */
127
180
  getGraphClient(): GraphClient;
128
181
  /**
129
- * Returns the Graph string ID for a cached draft numeric ID (satisfies IMailSendRepository).
182
+ * Resolves a draft id (durable `em_` token or raw Graph id) to its Graph id
183
+ * (satisfies IMailSendRepository). Drafts are messages.
130
184
  */
131
- getGraphIdForDraft(draftId: number): string | undefined;
185
+ getGraphIdForDraft(draftId: string): string;
132
186
  /**
133
- * Gets the Graph string ID from a numeric ID.
187
+ * Gets task info (Graph taskListId/taskId) from a durable `td_` token.
134
188
  */
135
- getGraphId(type: 'folder' | 'message' | 'event' | 'contact', numericId: number): string | undefined;
136
- /**
137
- * Gets task info from a numeric ID.
138
- */
139
- getTaskInfo(numericId: number): {
189
+ getTaskInfo(id: string): {
140
190
  taskListId: string;
141
191
  taskId: string;
142
192
  } | undefined;
143
193
  /**
144
- * Gets the Graph string ID for a task list from a numeric ID.
145
- */
146
- getTaskListGraphId(numericId: number): string | undefined;
147
- moveEmail(_emailId: number, _destinationFolderId: number): void;
148
- deleteEmail(_emailId: number): void;
149
- archiveEmail(_emailId: number): void;
150
- junkEmail(_emailId: number): void;
151
- markEmailRead(_emailId: number, _isRead: boolean): void;
152
- setEmailFlag(_emailId: number, _flagStatus: number): void;
153
- setEmailCategories(_emailId: number, _categories: string[]): void;
154
- setEmailImportance(_emailId: number, _importance: string): void;
155
- createFolder(_name: string, _parentFolderId?: number): FolderRow;
156
- deleteFolder(_folderId: number): void;
157
- renameFolder(_folderId: number, _newName: string): void;
158
- moveFolder(_folderId: number, _destinationParentId: number): void;
159
- emptyFolder(_folderId: number): void;
160
- moveEmailAsync(emailId: number, destinationFolderId: number): Promise<void>;
161
- deleteEmailAsync(emailId: number): Promise<void>;
162
- archiveEmailAsync(emailId: number): Promise<void>;
163
- junkEmailAsync(emailId: number): Promise<void>;
164
- markEmailReadAsync(emailId: number, isRead: boolean): Promise<void>;
165
- setEmailFlagAsync(emailId: number, flagStatus: number): Promise<void>;
166
- setEmailCategoriesAsync(emailId: number, categories: string[]): Promise<void>;
167
- setEmailImportanceAsync(emailId: number, importance: string): Promise<void>;
168
- createFolderAsync(name: string, parentFolderId?: number): Promise<FolderRow>;
169
- deleteFolderAsync(folderId: number): Promise<void>;
170
- renameFolderAsync(folderId: number, newName: string): Promise<void>;
171
- moveFolderAsync(folderId: number, destinationParentId: number): Promise<void>;
172
- emptyFolderAsync(folderId: number): Promise<void>;
194
+ * Gets the Graph string ID for a task list from a durable `tl_` token.
195
+ */
196
+ getTaskListGraphId(id: string): string | undefined;
197
+ moveEmail(_emailId: string, _destinationFolderId: string): void;
198
+ deleteEmail(_emailId: string): void;
199
+ archiveEmail(_emailId: string): void;
200
+ junkEmail(_emailId: string): void;
201
+ markEmailRead(_emailId: string, _isRead: boolean): void;
202
+ setEmailFlag(_emailId: string, _flagStatus: number): void;
203
+ setEmailCategories(_emailId: string, _categories: string[]): void;
204
+ setEmailImportance(_emailId: string, _importance: string): void;
205
+ createFolder(_name: string, _parentFolderId?: string): FolderRow;
206
+ deleteFolder(_folderId: string): void;
207
+ renameFolder(_folderId: string, _newName: string): void;
208
+ moveFolder(_folderId: string, _destinationParentId: string): void;
209
+ emptyFolder(_folderId: string): void;
210
+ moveEmailAsync(emailId: string, destinationFolderId: string): Promise<void>;
211
+ deleteEmailAsync(emailId: string): Promise<void>;
212
+ archiveEmailAsync(emailId: string): Promise<void>;
213
+ junkEmailAsync(emailId: string): Promise<void>;
214
+ markEmailReadAsync(emailId: string, isRead: boolean): Promise<void>;
215
+ setEmailFlagAsync(emailId: string, flagStatus: number): Promise<void>;
216
+ setEmailCategoriesAsync(emailId: string, categories: string[]): Promise<void>;
217
+ setEmailImportanceAsync(emailId: string, importance: string): Promise<void>;
218
+ createFolderAsync(name: string, parentFolderId?: string): Promise<FolderRow>;
219
+ deleteFolderAsync(folderId: string): Promise<void>;
220
+ renameFolderAsync(folderId: string, newName: string): Promise<void>;
221
+ moveFolderAsync(folderId: string, destinationParentId: string): Promise<void>;
222
+ emptyFolderAsync(folderId: string): Promise<void>;
173
223
  /**
174
224
  * Creates a new draft message.
175
225
  *
176
226
  * Converts email address strings to Recipient objects, calls the Graph client,
177
- * adds the returned draft to idCache.messages, and returns its numeric ID.
227
+ * and returns a durable `em_` token plus the raw Graph id.
178
228
  */
179
229
  createDraftAsync(params: {
180
230
  subject: string;
@@ -184,15 +234,15 @@ export declare class GraphRepository implements IRepository {
184
234
  cc?: string[];
185
235
  bcc?: string[];
186
236
  }): Promise<{
187
- numericId: number;
237
+ token: string;
188
238
  graphId: string;
189
239
  }>;
190
240
  /**
191
241
  * Updates an existing draft message.
192
242
  *
193
- * Looks up the Graph string ID from idCache.messages, then calls the client.
243
+ * Resolves the draft id to its Graph id, then calls the client.
194
244
  */
195
- updateDraftAsync(draftId: number, updates: Record<string, unknown>): Promise<void>;
245
+ updateDraftAsync(draftId: string, updates: Record<string, unknown>): Promise<void>;
196
246
  /**
197
247
  * Lists draft messages.
198
248
  *
@@ -202,9 +252,9 @@ export declare class GraphRepository implements IRepository {
202
252
  /**
203
253
  * Sends an existing draft message.
204
254
  *
205
- * Looks up the Graph string ID from idCache.messages, then calls the client.
255
+ * Resolves the id to its Graph id, then calls the client.
206
256
  */
207
- sendDraftAsync(draftId: number): Promise<void>;
257
+ sendDraftAsync(draftId: string): Promise<void>;
208
258
  /**
209
259
  * Sends a new email directly without creating a draft first.
210
260
  *
@@ -221,39 +271,38 @@ export declare class GraphRepository implements IRepository {
221
271
  /**
222
272
  * Replies to a message (or replies all).
223
273
  *
224
- * Looks up the Graph string ID from idCache.messages, then calls the client.
274
+ * Resolves the id to its Graph id, then calls the client.
225
275
  */
226
- replyMessageAsync(messageId: number, comment: string, replyAll: boolean): Promise<void>;
276
+ replyMessageAsync(messageId: string, comment: string, replyAll: boolean): Promise<void>;
227
277
  /**
228
278
  * Forwards a message to specified recipients.
229
279
  *
230
- * Looks up the Graph string ID from idCache.messages, converts recipient
231
- * email strings to Recipient objects, then calls the client.
280
+ * Resolves the id to its Graph id, converts recipient email strings to
281
+ * Recipient objects, then calls the client.
232
282
  */
233
- forwardMessageAsync(messageId: number, toRecipients: string[], comment?: string): Promise<void>;
283
+ forwardMessageAsync(messageId: string, toRecipients: string[], comment?: string): Promise<void>;
234
284
  /**
235
285
  * Creates a reply (or reply-all) draft for a message.
236
286
  *
237
- * Looks up the Graph string ID from idCache.messages, creates the draft
238
- * via the client, caches the new draft ID, and optionally updates the body.
287
+ * Resolves the source message id to its Graph id, creates the draft via the
288
+ * client, and optionally updates the body.
239
289
  *
240
- * @returns The numeric and graph IDs of the new draft.
290
+ * @returns A durable `em_` token and the raw Graph id of the new draft.
241
291
  */
242
- replyAsDraftAsync(messageId: number, replyAll?: boolean, comment?: string, bodyType?: string): Promise<{
243
- numericId: number;
292
+ replyAsDraftAsync(messageId: string, replyAll?: boolean, comment?: string, bodyType?: string): Promise<{
293
+ token: string;
244
294
  graphId: string;
245
295
  }>;
246
296
  /**
247
297
  * Creates a forward draft for a message.
248
298
  *
249
- * Looks up the Graph string ID from idCache.messages, creates the draft
250
- * via the client, caches the new draft ID, and optionally updates the
251
- * recipients and body.
299
+ * Resolves the source message id to its Graph id, creates the draft via the
300
+ * client, and optionally updates the recipients and body.
252
301
  *
253
- * @returns The numeric and graph IDs of the new draft.
302
+ * @returns A durable `em_` token and the raw Graph id of the new draft.
254
303
  */
255
- forwardAsDraftAsync(messageId: number, toRecipients?: string[], comment?: string, bodyType?: string): Promise<{
256
- numericId: number;
304
+ forwardAsDraftAsync(messageId: string, toRecipients?: string[], comment?: string, bodyType?: string): Promise<{
305
+ token: string;
257
306
  graphId: string;
258
307
  }>;
259
308
  getScheduleAsync(params: {
@@ -272,14 +321,13 @@ export declare class GraphRepository implements IRepository {
272
321
  /**
273
322
  * Lists attachments for a given email.
274
323
  *
275
- * Looks up the Graph message ID from idCache.messages, calls
276
- * client.listAttachments, hashes each attachment ID to a numeric key,
277
- * and caches it in idCache.attachments with { messageId, attachmentId }.
324
+ * Resolves the id to its Graph id, calls client.listAttachments, and mints
325
+ * an `at_` composite alias token ({ messageId, attachmentId }) per item.
278
326
  *
279
327
  * @returns Array of attachment metadata objects.
280
328
  */
281
- listAttachmentsAsync(emailId: number): Promise<Array<{
282
- id: number;
329
+ listAttachmentsAsync(emailId: string): Promise<Array<{
330
+ id: string;
283
331
  name: string;
284
332
  size: number;
285
333
  contentType: string;
@@ -288,13 +336,13 @@ export declare class GraphRepository implements IRepository {
288
336
  /**
289
337
  * Downloads an attachment for a given email.
290
338
  *
291
- * Looks up { messageId, attachmentId } from idCache.attachments,
292
- * then delegates to the downloadAttachment helper which fetches
293
- * the content and writes it to disk.
339
+ * Resolves the `at_` composite token to { messageId, attachmentId }, then
340
+ * delegates to the downloadAttachment helper which fetches the content and
341
+ * writes it to disk.
294
342
  *
295
343
  * @returns Metadata about the downloaded file including its local path.
296
344
  */
297
- downloadAttachmentAsync(attachmentId: number): Promise<{
345
+ downloadAttachmentAsync(attachmentId: string): Promise<{
298
346
  filePath: string;
299
347
  name: string;
300
348
  size: number;
@@ -334,17 +382,17 @@ export declare class GraphRepository implements IRepository {
334
382
  numberOfOccurrences?: number;
335
383
  };
336
384
  };
337
- calendarId?: number;
385
+ calendarId?: string;
338
386
  is_online_meeting?: boolean;
339
387
  online_meeting_provider?: string;
340
- }): Promise<number>;
388
+ }): Promise<string>;
341
389
  /**
342
390
  * Updates an existing calendar event.
343
391
  *
344
392
  * Looks up the Graph string ID from idCache.events, then calls
345
393
  * client.updateEvent(). Throws if the event is not cached.
346
394
  */
347
- updateEventAsync(eventId: number, updates: Record<string, unknown>): Promise<void>;
395
+ updateEventAsync(eventId: string, updates: Record<string, unknown>): Promise<void>;
348
396
  /**
349
397
  * Deletes a calendar event.
350
398
  *
@@ -352,14 +400,14 @@ export declare class GraphRepository implements IRepository {
352
400
  * client.deleteEvent(), and removes the entry from idCache.
353
401
  * Throws if the event is not cached.
354
402
  */
355
- deleteEventAsync(eventId: number): Promise<void>;
403
+ deleteEventAsync(eventId: string): Promise<void>;
356
404
  /**
357
405
  * Responds to a calendar event invitation.
358
406
  *
359
407
  * Looks up the Graph string ID from idCache.events, then calls
360
408
  * client.respondToEvent(). Throws if the event is not cached.
361
409
  */
362
- respondToEventAsync(eventId: number, response: 'accept' | 'decline' | 'tentative', sendResponse: boolean, comment?: string): Promise<void>;
410
+ respondToEventAsync(eventId: string, response: 'accept' | 'decline' | 'tentative', sendResponse: boolean, comment?: string): Promise<void>;
363
411
  /**
364
412
  * Creates a new contact.
365
413
  *
@@ -379,14 +427,14 @@ export declare class GraphRepository implements IRepository {
379
427
  state?: string;
380
428
  postal_code?: string;
381
429
  country?: string;
382
- }): Promise<number>;
430
+ }): Promise<string>;
383
431
  /**
384
432
  * Updates an existing contact.
385
433
  *
386
434
  * Looks up the Graph string ID from idCache.contacts, then calls
387
435
  * client.updateContact(). Throws if the contact is not cached.
388
436
  */
389
- updateContactAsync(contactId: number, updates: Record<string, unknown>): Promise<void>;
437
+ updateContactAsync(contactId: string, updates: Record<string, unknown>): Promise<void>;
390
438
  /**
391
439
  * Deletes a contact.
392
440
  *
@@ -394,17 +442,17 @@ export declare class GraphRepository implements IRepository {
394
442
  * client.deleteContact(), and removes the entry from idCache.
395
443
  * Throws if the contact is not cached.
396
444
  */
397
- deleteContactAsync(contactId: number): Promise<void>;
445
+ deleteContactAsync(contactId: string): Promise<void>;
398
446
  /**
399
447
  * Creates a new task in a task list.
400
448
  *
401
- * Looks up the Graph task list ID from idCache.taskLists, builds a
402
- * Graph API task object from the given params, calls client.createTask(),
403
- * caches the resulting ID, and returns a numeric ID.
449
+ * Resolves the `tl_` task list token to a Graph ID, builds a Graph API task
450
+ * object from the given params, calls client.createTask(), and returns a
451
+ * durable `td_` token for the created task.
404
452
  */
405
453
  createTaskAsync(params: {
406
454
  title: string;
407
- task_list_id: number;
455
+ task_list_id: string;
408
456
  body?: string;
409
457
  body_type?: 'text' | 'html';
410
458
  due_date?: string;
@@ -421,77 +469,67 @@ export declare class GraphRepository implements IRepository {
421
469
  occurrences?: number | undefined;
422
470
  } | undefined;
423
471
  categories?: string[];
424
- }): Promise<number>;
472
+ }): Promise<string>;
425
473
  /**
426
474
  * Updates an existing task.
427
- *
428
- * Looks up the Graph task info from idCache.tasks, then calls
429
- * client.updateTask(). Throws if the task is not cached.
430
475
  */
431
- updateTaskAsync(taskId: number, updates: Record<string, unknown>): Promise<void>;
476
+ updateTaskAsync(taskId: string, updates: Record<string, unknown>): Promise<void>;
432
477
  /**
433
478
  * Marks a task as completed.
434
479
  *
435
480
  * Convenience method that calls updateTaskAsync with status: 'completed'
436
481
  * and the current time as completedDateTime.
437
482
  */
438
- completeTaskAsync(taskId: number): Promise<void>;
483
+ completeTaskAsync(taskId: string): Promise<void>;
439
484
  /**
440
485
  * Deletes a task.
441
- *
442
- * Looks up the Graph task info from idCache.tasks, calls
443
- * client.deleteTask(), and removes the entry from idCache.
444
- * Throws if the task is not cached.
445
486
  */
446
- deleteTaskAsync(taskId: number): Promise<void>;
487
+ deleteTaskAsync(taskId: string): Promise<void>;
447
488
  /**
448
489
  * Creates a new task list.
449
- *
450
- * Calls client.createTaskList(), caches the resulting ID in
451
- * idCache.taskLists, and returns a numeric ID.
452
490
  */
453
- createTaskListAsync(displayName: string): Promise<number>;
491
+ createTaskListAsync(displayName: string): Promise<string>;
454
492
  /**
455
493
  * Renames a task list.
456
494
  */
457
- renameTaskListAsync(listId: number, name: string): Promise<void>;
495
+ renameTaskListAsync(listId: string, name: string): Promise<void>;
458
496
  /**
459
497
  * Deletes a task list.
460
498
  */
461
- deleteTaskListAsync(listId: number): Promise<void>;
462
- listChecklistItemsAsync(taskId: number): Promise<Array<{
463
- id: number;
499
+ deleteTaskListAsync(listId: string): Promise<void>;
500
+ listChecklistItemsAsync(taskId: string): Promise<Array<{
501
+ id: string;
464
502
  displayName: string;
465
503
  isChecked: boolean;
466
504
  createdDateTime: string;
467
505
  }>>;
468
- createChecklistItemAsync(taskId: number, displayName: string, isChecked?: boolean): Promise<number>;
469
- updateChecklistItemAsync(checklistItemId: number, updates: {
506
+ createChecklistItemAsync(taskId: string, displayName: string, isChecked?: boolean): Promise<string>;
507
+ updateChecklistItemAsync(checklistItemId: string, updates: {
470
508
  displayName?: string;
471
509
  isChecked?: boolean;
472
510
  }): Promise<void>;
473
- deleteChecklistItemAsync(checklistItemId: number): Promise<void>;
474
- listLinkedResourcesAsync(taskId: number): Promise<Array<{
475
- id: number;
511
+ deleteChecklistItemAsync(checklistItemId: string): Promise<void>;
512
+ listLinkedResourcesAsync(taskId: string): Promise<Array<{
513
+ id: string;
476
514
  webUrl: string;
477
515
  applicationName: string;
478
516
  displayName: string;
479
517
  }>>;
480
- createLinkedResourceAsync(taskId: number, webUrl: string, applicationName: string, displayName?: string): Promise<number>;
481
- deleteLinkedResourceAsync(linkedResourceId: number): Promise<void>;
482
- listTaskAttachmentsAsync(taskId: number): Promise<Array<{
483
- id: number;
518
+ createLinkedResourceAsync(taskId: string, webUrl: string, applicationName: string, displayName?: string): Promise<string>;
519
+ deleteLinkedResourceAsync(linkedResourceId: string): Promise<void>;
520
+ listTaskAttachmentsAsync(taskId: string): Promise<Array<{
521
+ id: string;
484
522
  name: string;
485
523
  size: number;
486
524
  contentType: string;
487
525
  }>>;
488
- createTaskAttachmentAsync(taskId: number, name: string, contentBytes: string, contentType?: string): Promise<number>;
489
- deleteTaskAttachmentAsync(taskAttachmentId: number): Promise<void>;
526
+ createTaskAttachmentAsync(taskId: string, name: string, contentBytes: string, contentType?: string): Promise<string>;
527
+ deleteTaskAttachmentAsync(taskAttachmentId: string): Promise<void>;
490
528
  /**
491
529
  * Lists all inbox mail rules.
492
530
  */
493
531
  listMailRulesAsync(): Promise<Array<{
494
- id: number;
532
+ id: string;
495
533
  displayName: string;
496
534
  sequence: number;
497
535
  isEnabled: boolean;
@@ -501,11 +539,11 @@ export declare class GraphRepository implements IRepository {
501
539
  /**
502
540
  * Creates a new inbox mail rule.
503
541
  */
504
- createMailRuleAsync(rule: Record<string, unknown>): Promise<number>;
542
+ createMailRuleAsync(rule: Record<string, unknown>): Promise<string>;
505
543
  /**
506
544
  * Deletes an inbox mail rule.
507
545
  */
508
- deleteMailRuleAsync(ruleId: number): Promise<void>;
546
+ deleteMailRuleAsync(ruleId: string): Promise<void>;
509
547
  /**
510
548
  * Gets the current automatic replies (OOF) settings.
511
549
  */
@@ -551,45 +589,45 @@ export declare class GraphRepository implements IRepository {
551
589
  * Lists all master categories.
552
590
  */
553
591
  listCategoriesAsync(): Promise<Array<{
554
- id: number;
592
+ id: string;
555
593
  name: string;
556
594
  color: string;
557
595
  }>>;
558
596
  /**
559
597
  * Creates a new master category.
560
598
  */
561
- createCategoryAsync(name: string, color: string): Promise<number>;
599
+ createCategoryAsync(name: string, color: string): Promise<string>;
562
600
  /**
563
601
  * Deletes a master category.
564
602
  */
565
- deleteCategoryAsync(categoryId: number): Promise<void>;
603
+ deleteCategoryAsync(categoryId: string): Promise<void>;
566
604
  /**
567
605
  * Lists all focused inbox overrides.
568
606
  */
569
607
  listFocusedOverridesAsync(): Promise<Array<{
570
- id: number;
608
+ id: string;
571
609
  senderAddress: string;
572
610
  classifyAs: string;
573
611
  }>>;
574
612
  /**
575
613
  * Creates a focused inbox override.
576
614
  */
577
- createFocusedOverrideAsync(senderAddress: string, classifyAs: 'focused' | 'other'): Promise<number>;
615
+ createFocusedOverrideAsync(senderAddress: string, classifyAs: 'focused' | 'other'): Promise<string>;
578
616
  /**
579
617
  * Deletes a focused inbox override.
580
618
  */
581
- deleteFocusedOverrideAsync(overrideId: number): Promise<void>;
619
+ deleteFocusedOverrideAsync(overrideId: string): Promise<void>;
582
620
  /**
583
621
  * Gets internet message headers for an email.
584
622
  */
585
- getMessageHeadersAsync(emailId: number): Promise<Array<{
623
+ getMessageHeadersAsync(emailId: string): Promise<Array<{
586
624
  name: string;
587
625
  value: string;
588
626
  }>>;
589
627
  /**
590
628
  * Gets the MIME content of a message and saves it as an .eml file.
591
629
  */
592
- getMessageMimeAsync(emailId: number): Promise<{
630
+ getMessageMimeAsync(emailId: string): Promise<{
593
631
  filePath: string;
594
632
  }>;
595
633
  /**
@@ -607,21 +645,24 @@ export declare class GraphRepository implements IRepository {
607
645
  }>>;
608
646
  /**
609
647
  * Lists all calendar groups.
648
+ *
649
+ * Orphan entity: no Graph URL takes a calendar-group id as a path segment,
650
+ * so this returns the raw Graph id string rather than minting a token.
610
651
  */
611
652
  listCalendarGroupsAsync(): Promise<Array<{
612
- id: number;
653
+ id: string;
613
654
  name: string;
614
655
  classId: string;
615
656
  }>>;
616
657
  /**
617
658
  * Creates a new calendar group.
618
659
  */
619
- createCalendarGroupAsync(name: string): Promise<number>;
660
+ createCalendarGroupAsync(name: string): Promise<string>;
620
661
  /**
621
662
  * Lists all permissions for a calendar.
622
663
  */
623
- listCalendarPermissionsAsync(calendarId: number): Promise<Array<{
624
- id: number;
664
+ listCalendarPermissionsAsync(calendarId: string): Promise<Array<{
665
+ id: string;
625
666
  emailAddress: string;
626
667
  role: string;
627
668
  isRemovable: boolean;
@@ -630,11 +671,11 @@ export declare class GraphRepository implements IRepository {
630
671
  /**
631
672
  * Creates a calendar permission (shares a calendar with someone).
632
673
  */
633
- createCalendarPermissionAsync(calendarId: number, email: string, role: string): Promise<number>;
674
+ createCalendarPermissionAsync(calendarId: string, email: string, role: string): Promise<string>;
634
675
  /**
635
676
  * Deletes a calendar permission.
636
677
  */
637
- deleteCalendarPermissionAsync(permissionId: number): Promise<void>;
678
+ deleteCalendarPermissionAsync(permissionId: string): Promise<void>;
638
679
  /**
639
680
  * Lists all room lists.
640
681
  */
@@ -653,24 +694,24 @@ export declare class GraphRepository implements IRepository {
653
694
  * Lists all joined teams with cached numeric IDs.
654
695
  */
655
696
  listTeamsAsync(): Promise<Array<{
656
- id: number;
697
+ id: string;
657
698
  name: string;
658
699
  description: string;
659
700
  }>>;
660
701
  /**
661
702
  * Lists all channels in a team with cached numeric IDs.
662
703
  */
663
- listChannelsAsync(teamId: number): Promise<Array<{
664
- id: number;
704
+ listChannelsAsync(teamId: string): Promise<Array<{
705
+ id: string;
665
706
  name: string;
666
707
  description: string;
667
708
  membershipType: string;
668
709
  }>>;
669
710
  /**
670
- * Gets a specific channel by cached numeric ID.
711
+ * Gets a specific channel by durable cn_ token.
671
712
  */
672
- getChannelAsync(channelId: number): Promise<{
673
- id: number;
713
+ getChannelAsync(channelId: string): Promise<{
714
+ id: string;
674
715
  name: string;
675
716
  description: string;
676
717
  membershipType: string;
@@ -679,22 +720,22 @@ export declare class GraphRepository implements IRepository {
679
720
  /**
680
721
  * Creates a new channel in a team.
681
722
  */
682
- createChannelAsync(teamId: number, name: string, description?: string): Promise<number>;
723
+ createChannelAsync(teamId: string, name: string, description?: string): Promise<string>;
683
724
  /**
684
725
  * Updates a channel's properties.
685
726
  */
686
- updateChannelAsync(channelId: number, updates: {
727
+ updateChannelAsync(channelId: string, updates: {
687
728
  name?: string;
688
729
  description?: string;
689
730
  }): Promise<void>;
690
731
  /**
691
732
  * Deletes a channel.
692
733
  */
693
- deleteChannelAsync(channelId: number): Promise<void>;
734
+ deleteChannelAsync(channelId: string): Promise<void>;
694
735
  /**
695
736
  * Lists members of a team.
696
737
  */
697
- listTeamMembersAsync(teamId: number): Promise<Array<{
738
+ listTeamMembersAsync(teamId: string): Promise<Array<{
698
739
  id: string;
699
740
  displayName: string;
700
741
  email: string;
@@ -703,8 +744,8 @@ export declare class GraphRepository implements IRepository {
703
744
  /**
704
745
  * Lists recent messages in a channel.
705
746
  */
706
- listChannelMessagesAsync(channelId: number, limit?: number): Promise<Array<{
707
- id: number;
747
+ listChannelMessagesAsync(channelId: string, limit?: number): Promise<Array<{
748
+ id: string;
708
749
  senderName: string;
709
750
  senderEmail: string;
710
751
  bodyPreview: string;
@@ -715,15 +756,15 @@ export declare class GraphRepository implements IRepository {
715
756
  /**
716
757
  * Gets a specific channel message with its replies.
717
758
  */
718
- getChannelMessageAsync(messageId: number): Promise<{
719
- id: number;
759
+ getChannelMessageAsync(messageId: string): Promise<{
760
+ id: string;
720
761
  senderName: string;
721
762
  senderEmail: string;
722
763
  bodyContent: string;
723
764
  contentType: string;
724
765
  createdDateTime: string;
725
766
  replies: Array<{
726
- id: number;
767
+ id: string;
727
768
  senderName: string;
728
769
  senderEmail: string;
729
770
  bodyContent: string;
@@ -734,27 +775,27 @@ export declare class GraphRepository implements IRepository {
734
775
  /**
735
776
  * Sends a new message to a channel.
736
777
  */
737
- sendChannelMessageAsync(channelId: number, body: string, contentType?: string): Promise<number>;
778
+ sendChannelMessageAsync(channelId: string, body: string, contentType?: string): Promise<string>;
738
779
  /**
739
780
  * Replies to a channel message.
740
781
  */
741
- replyToChannelMessageAsync(messageId: number, body: string, contentType?: string): Promise<number>;
782
+ replyToChannelMessageAsync(messageId: string, body: string, contentType?: string): Promise<string>;
742
783
  listChatsAsync(limit?: number): Promise<Array<{
743
- id: number;
784
+ id: string;
744
785
  topic: string;
745
786
  chatType: string;
746
787
  lastMessagePreview: string;
747
788
  createdDateTime: string;
748
789
  }>>;
749
- getChatAsync(chatId: number): Promise<{
750
- id: number;
790
+ getChatAsync(chatId: string): Promise<{
791
+ id: string;
751
792
  topic: string;
752
793
  chatType: string;
753
794
  createdDateTime: string;
754
795
  webUrl: string;
755
796
  }>;
756
- listChatMessagesAsync(chatId: number, limit?: number): Promise<Array<{
757
- id: number;
797
+ listChatMessagesAsync(chatId: string, limit?: number): Promise<Array<{
798
+ id: string;
758
799
  senderName: string;
759
800
  senderEmail: string;
760
801
  bodyPreview: string;
@@ -762,35 +803,35 @@ export declare class GraphRepository implements IRepository {
762
803
  contentType: string;
763
804
  createdDateTime: string;
764
805
  }>>;
765
- sendChatMessageAsync(chatId: number, body: string, contentType?: string): Promise<number>;
766
- listMessageReactionsAsync(messageId: number, messageType: 'channel' | 'chat'): Promise<Array<{
806
+ sendChatMessageAsync(chatId: string, body: string, contentType?: string): Promise<string>;
807
+ listMessageReactionsAsync(messageId: string, messageType: 'channel' | 'chat'): Promise<Array<{
767
808
  reactionType: string;
768
809
  user: {
769
810
  displayName: string;
770
811
  };
771
812
  createdDateTime: string;
772
813
  }>>;
773
- addMessageReactionAsync(messageId: number, messageType: 'channel' | 'chat', reactionType: string): Promise<void>;
774
- removeMessageReactionAsync(messageId: number, messageType: 'channel' | 'chat', reactionType: string): Promise<void>;
775
- listChatMembersAsync(chatId: number): Promise<Array<{
814
+ addMessageReactionAsync(messageId: string, messageType: 'channel' | 'chat', reactionType: string): Promise<void>;
815
+ removeMessageReactionAsync(messageId: string, messageType: 'channel' | 'chat', reactionType: string): Promise<void>;
816
+ listChatMembersAsync(chatId: string): Promise<Array<{
776
817
  displayName: string;
777
818
  email: string;
778
819
  roles: string[];
779
820
  }>>;
780
821
  /**
781
- * Lists all plans the current user has.
822
+ * Lists all plans the current user has, minting durable pl_ tokens.
782
823
  */
783
824
  listPlansAsync(): Promise<Array<{
784
- id: number;
825
+ id: string;
785
826
  title: string;
786
827
  owner: string;
787
828
  createdDateTime: string;
788
829
  }>>;
789
830
  /**
790
- * Gets a specific plan by cached numeric ID.
831
+ * Gets a specific plan.
791
832
  */
792
- getPlanAsync(planId: number): Promise<{
793
- id: number;
833
+ getPlanAsync(planId: string): Promise<{
834
+ id: string;
794
835
  title: string;
795
836
  owner: string;
796
837
  createdDateTime: string;
@@ -799,43 +840,62 @@ export declare class GraphRepository implements IRepository {
799
840
  /**
800
841
  * Creates a new plan.
801
842
  */
802
- createPlanAsync(title: string, groupId: string): Promise<number>;
843
+ createPlanAsync(title: string, groupId: string): Promise<string>;
803
844
  /**
804
- * Updates a plan (requires cached ETag).
845
+ * Updates a plan (U5b-5: fetches a fresh etag immediately before the write —
846
+ * etags are never cached across calls).
805
847
  */
806
- updatePlanAsync(planId: number, updates: {
848
+ updatePlanAsync(planId: string, updates: {
807
849
  title?: string;
808
850
  }): Promise<void>;
809
851
  /**
810
- * Lists all buckets in a plan.
852
+ * Lists all buckets in a plan, minting durable pb_ tokens.
811
853
  */
812
- listBucketsAsync(planId: number): Promise<Array<{
813
- id: number;
854
+ listBucketsAsync(planId: string): Promise<Array<{
855
+ id: string;
814
856
  name: string;
815
- planId: number;
857
+ planId: string;
816
858
  orderHint: string;
817
859
  }>>;
818
860
  /**
819
861
  * Creates a new bucket in a plan.
820
862
  */
821
- createBucketAsync(planId: number, name: string): Promise<number>;
863
+ createBucketAsync(planId: string, name: string): Promise<string>;
822
864
  /**
823
- * Updates a bucket (requires cached ETag).
865
+ * Updates a bucket (U5b-5: fetches a fresh etag immediately before the write).
824
866
  */
825
- updateBucketAsync(bucketId: number, updates: {
867
+ updateBucketAsync(bucketId: string, updates: {
826
868
  name?: string;
827
869
  }): Promise<void>;
828
870
  /**
829
- * Deletes a bucket (requires cached ETag).
871
+ * Deletes a bucket (U5b-5: fetches a fresh etag immediately before the write).
830
872
  */
831
- deleteBucketAsync(bucketId: number): Promise<void>;
873
+ deleteBucketAsync(bucketId: string): Promise<void>;
874
+ /**
875
+ * Lists all tasks in a plan, minting durable pt_ tokens.
876
+ */
877
+ listPlannerTasksAsync(planId: string): Promise<Array<{
878
+ id: string;
879
+ title: string;
880
+ bucketId: string | null;
881
+ assignees: string[];
882
+ percentComplete: number;
883
+ priority: number;
884
+ startDateTime: string;
885
+ dueDateTime: string;
886
+ createdDateTime: string;
887
+ }>>;
832
888
  /**
833
- * Lists all tasks in a plan.
889
+ * Lists all Planner tasks assigned to the signed-in user, across every plan
890
+ * (`GET /me/planner/tasks`). Unlike the plan-scoped list, each task carries its
891
+ * own `planId`; the plan/bucket/task durable tokens are minted so follow-up
892
+ * get/update calls resolve without a re-list.
834
893
  */
835
- listPlannerTasksAsync(planId: number): Promise<Array<{
836
- id: number;
894
+ listMyPlannerTasksAsync(): Promise<Array<{
895
+ id: string;
837
896
  title: string;
838
- bucketId: number | null;
897
+ planId: string;
898
+ bucketId: string | null;
839
899
  assignees: string[];
840
900
  percentComplete: number;
841
901
  priority: number;
@@ -844,12 +904,12 @@ export declare class GraphRepository implements IRepository {
844
904
  createdDateTime: string;
845
905
  }>>;
846
906
  /**
847
- * Gets a specific planner task by cached numeric ID.
907
+ * Gets a specific planner task.
848
908
  */
849
- getPlannerTaskAsync(taskId: number): Promise<{
850
- id: number;
909
+ getPlannerTaskAsync(taskId: string): Promise<{
910
+ id: string;
851
911
  title: string;
852
- bucketId: number | null;
912
+ bucketId: string | null;
853
913
  assignees: string[];
854
914
  percentComplete: number;
855
915
  priority: number;
@@ -863,13 +923,13 @@ export declare class GraphRepository implements IRepository {
863
923
  /**
864
924
  * Creates a new planner task.
865
925
  */
866
- createPlannerTaskAsync(planId: number, title: string, bucketId?: number, assignments?: Record<string, object>, priority?: number, startDate?: string, dueDate?: string): Promise<number>;
926
+ createPlannerTaskAsync(planId: string, title: string, bucketId?: string, assignments?: Record<string, object>, priority?: number, startDate?: string, dueDate?: string): Promise<string>;
867
927
  /**
868
- * Updates a planner task (requires cached ETag).
928
+ * Updates a planner task (U5b-5: fetches a fresh etag immediately before the write).
869
929
  */
870
- updatePlannerTaskAsync(taskId: number, updates: {
930
+ updatePlannerTaskAsync(taskId: string, updates: {
871
931
  title?: string;
872
- bucketId?: number;
932
+ bucketId?: string;
873
933
  percentComplete?: number;
874
934
  priority?: number;
875
935
  startDate?: string;
@@ -877,14 +937,15 @@ export declare class GraphRepository implements IRepository {
877
937
  assignments?: Record<string, object>;
878
938
  }): Promise<void>;
879
939
  /**
880
- * Deletes a planner task (requires cached ETag).
940
+ * Deletes a planner task (U5b-5: fetches a fresh etag immediately before the write).
881
941
  */
882
- deletePlannerTaskAsync(taskId: number): Promise<void>;
942
+ deletePlannerTaskAsync(taskId: string): Promise<void>;
883
943
  /**
884
- * Gets details for a planner task (description, checklist, references).
944
+ * Gets details for a planner task (description, checklist, references). Task
945
+ * details piggyback the pt_ task token — they have no id of their own.
885
946
  */
886
- getPlannerTaskDetailsAsync(taskId: number): Promise<{
887
- id: number;
947
+ getPlannerTaskDetailsAsync(taskId: string): Promise<{
948
+ id: string;
888
949
  description: string;
889
950
  checklist: Record<string, unknown>;
890
951
  references: Record<string, unknown>;
@@ -899,10 +960,10 @@ export declare class GraphRepository implements IRepository {
899
960
  * Partial failures are handled gracefully: tasks whose detail fetch failed will
900
961
  * have `details` set to `undefined`.
901
962
  */
902
- listPlannerTasksWithDetailsAsync(planId: number): Promise<Array<{
903
- id: number;
963
+ listPlannerTasksWithDetailsAsync(planId: string): Promise<Array<{
964
+ id: string;
904
965
  title: string;
905
- bucketId: number | null;
966
+ bucketId: string | null;
906
967
  assignees: string[];
907
968
  percentComplete: number;
908
969
  priority: number;
@@ -917,9 +978,11 @@ export declare class GraphRepository implements IRepository {
917
978
  } | undefined;
918
979
  }>>;
919
980
  /**
920
- * Updates details for a planner task (requires cached ETag from getPlannerTaskDetailsAsync).
981
+ * Updates details for a planner task (U5b-5: fetches a fresh etag immediately
982
+ * before the write — the task details etag is independent of the task's own
983
+ * etag).
921
984
  */
922
- updatePlannerTaskDetailsAsync(taskId: number, updates: {
985
+ updatePlannerTaskDetailsAsync(taskId: string, updates: {
923
986
  description?: string;
924
987
  checklist?: Record<string, object>;
925
988
  references?: Record<string, object>;
@@ -927,44 +990,44 @@ export declare class GraphRepository implements IRepository {
927
990
  /**
928
991
  * Assembles plan, buckets, and tasks into a unified visualization data object.
929
992
  */
930
- getPlanVisualizationDataAsync(planId: number): Promise<PlanVisualizationData>;
993
+ getPlanVisualizationDataAsync(planId: string): Promise<PlanVisualizationData>;
931
994
  listOnlineMeetingsAsync(limit?: number): Promise<Array<{
932
- id: number;
995
+ id: string;
933
996
  subject: string;
934
997
  startDateTime: string;
935
998
  endDateTime: string;
936
999
  joinUrl: string;
937
1000
  }>>;
938
- getOnlineMeetingAsync(meetingId: number): Promise<{
939
- id: number;
1001
+ getOnlineMeetingAsync(meetingId: string): Promise<{
1002
+ id: string;
940
1003
  subject: string;
941
1004
  startDateTime: string;
942
1005
  endDateTime: string;
943
1006
  joinUrl: string;
944
1007
  participants: unknown;
945
1008
  } | undefined>;
946
- listMeetingRecordingsAsync(meetingId: number): Promise<Array<{
947
- id: number;
1009
+ listMeetingRecordingsAsync(meetingId: string): Promise<Array<{
1010
+ id: string;
948
1011
  createdDateTime: string;
949
1012
  recordingContentUrl: string;
950
1013
  }>>;
951
- downloadMeetingRecordingAsync(recordingId: number, outputPath: string): Promise<string>;
952
- listMeetingTranscriptsAsync(meetingId: number): Promise<Array<{
953
- id: number;
1014
+ downloadMeetingRecordingAsync(recordingId: string, outputPath: string): Promise<string>;
1015
+ listMeetingTranscriptsAsync(meetingId: string): Promise<Array<{
1016
+ id: string;
954
1017
  createdDateTime: string;
955
1018
  contentUrl: string;
956
1019
  }>>;
957
- getMeetingTranscriptContentAsync(transcriptId: number, format?: string): Promise<string>;
958
- listWorksheetsAsync(fileId: number): Promise<Record<string, unknown>[]>;
959
- getWorksheetRangeAsync(fileId: number, worksheetName: string, range: string): Promise<Record<string, unknown>>;
960
- getUsedRangeAsync(fileId: number, worksheetName: string): Promise<Record<string, unknown>>;
961
- updateWorksheetRangeAsync(fileId: number, worksheetName: string, range: string, values: unknown[][]): Promise<Record<string, unknown>>;
962
- getTableDataAsync(fileId: number, tableName: string): Promise<Record<string, unknown>[]>;
1020
+ getMeetingTranscriptContentAsync(transcriptId: string, format?: string): Promise<string>;
1021
+ listWorksheetsAsync(fileId: string): Promise<Record<string, unknown>[]>;
1022
+ getWorksheetRangeAsync(fileId: string, worksheetName: string, range: string): Promise<Record<string, unknown>>;
1023
+ getUsedRangeAsync(fileId: string, worksheetName: string): Promise<Record<string, unknown>>;
1024
+ updateWorksheetRangeAsync(fileId: string, worksheetName: string, range: string, values: unknown[][]): Promise<Record<string, unknown>>;
1025
+ getTableDataAsync(fileId: string, tableName: string): Promise<Record<string, unknown>[]>;
963
1026
  /**
964
1027
  * Lists files/folders in a drive folder (or root).
965
1028
  */
966
- listDriveItemsAsync(folderId?: number): Promise<Array<{
967
- id: number;
1029
+ listDriveItemsAsync(folderId?: string): Promise<Array<{
1030
+ id: string;
968
1031
  name: string;
969
1032
  size: number;
970
1033
  lastModified: string;
@@ -975,7 +1038,7 @@ export declare class GraphRepository implements IRepository {
975
1038
  * Searches drive items by query.
976
1039
  */
977
1040
  searchDriveItemsAsync(query: string, limit?: number): Promise<Array<{
978
- id: number;
1041
+ id: string;
979
1042
  name: string;
980
1043
  size: number;
981
1044
  lastModified: string;
@@ -985,8 +1048,8 @@ export declare class GraphRepository implements IRepository {
985
1048
  /**
986
1049
  * Gets metadata for a specific drive item.
987
1050
  */
988
- getDriveItemAsync(itemId: number): Promise<{
989
- id: number;
1051
+ getDriveItemAsync(itemId: string): Promise<{
1052
+ id: string;
990
1053
  name: string;
991
1054
  size: number;
992
1055
  lastModified: string;
@@ -998,19 +1061,19 @@ export declare class GraphRepository implements IRepository {
998
1061
  /**
999
1062
  * Downloads a drive item to a local file.
1000
1063
  */
1001
- downloadFileAsync(itemId: number, outputPath: string): Promise<{
1064
+ downloadFileAsync(itemId: string, outputPath: string): Promise<{
1002
1065
  savedPath: string;
1003
1066
  size: number;
1004
1067
  }>;
1005
1068
  /**
1006
1069
  * Uploads a local file to OneDrive.
1007
1070
  */
1008
- uploadFileAsync(parentPath: string, fileName: string, localFilePath: string): Promise<number>;
1071
+ uploadFileAsync(parentPath: string, fileName: string, localFilePath: string): Promise<string>;
1009
1072
  /**
1010
1073
  * Lists recently accessed drive items.
1011
1074
  */
1012
1075
  listRecentFilesAsync(): Promise<Array<{
1013
- id: number;
1076
+ id: string;
1014
1077
  name: string;
1015
1078
  size: number;
1016
1079
  lastModified: string;
@@ -1021,7 +1084,7 @@ export declare class GraphRepository implements IRepository {
1021
1084
  * Lists drive items shared with the user.
1022
1085
  */
1023
1086
  listSharedWithMeAsync(): Promise<Array<{
1024
- id: number;
1087
+ id: string;
1025
1088
  name: string;
1026
1089
  size: number;
1027
1090
  lastModified: string;
@@ -1031,7 +1094,7 @@ export declare class GraphRepository implements IRepository {
1031
1094
  /**
1032
1095
  * Creates a sharing link for a drive item.
1033
1096
  */
1034
- createSharingLinkAsync(itemId: number, type: string, scope: string): Promise<{
1097
+ createSharingLinkAsync(itemId: string, type: string, scope: string): Promise<{
1035
1098
  webUrl: string;
1036
1099
  type: string;
1037
1100
  scope: string;
@@ -1039,21 +1102,21 @@ export declare class GraphRepository implements IRepository {
1039
1102
  /**
1040
1103
  * Deletes a drive item.
1041
1104
  */
1042
- deleteDriveItemAsync(itemId: number): Promise<void>;
1105
+ deleteDriveItemAsync(itemId: string): Promise<void>;
1043
1106
  /**
1044
- * Lists followed SharePoint sites, caching IDs.
1107
+ * Lists followed SharePoint sites, minting durable si_ tokens.
1045
1108
  */
1046
1109
  listSitesAsync(): Promise<Array<{
1047
- id: number;
1110
+ id: string;
1048
1111
  name: string;
1049
1112
  webUrl: string;
1050
1113
  displayName: string;
1051
1114
  }>>;
1052
1115
  /**
1053
- * Searches SharePoint sites by keyword, caching IDs.
1116
+ * Searches SharePoint sites by keyword, minting durable si_ tokens.
1054
1117
  */
1055
1118
  searchSitesAsync(query: string): Promise<Array<{
1056
- id: number;
1119
+ id: string;
1057
1120
  name: string;
1058
1121
  webUrl: string;
1059
1122
  displayName: string;
@@ -1061,27 +1124,27 @@ export declare class GraphRepository implements IRepository {
1061
1124
  /**
1062
1125
  * Gets details for a specific SharePoint site.
1063
1126
  */
1064
- getSiteAsync(siteId: number): Promise<{
1065
- id: number;
1127
+ getSiteAsync(siteId: string): Promise<{
1128
+ id: string;
1066
1129
  name: string;
1067
1130
  webUrl: string;
1068
1131
  displayName: string;
1069
1132
  description: string;
1070
1133
  }>;
1071
1134
  /**
1072
- * Lists document libraries for a SharePoint site, caching IDs.
1135
+ * Lists document libraries for a SharePoint site, minting durable dl_ tokens.
1073
1136
  */
1074
- listDocumentLibrariesAsync(siteId: number): Promise<Array<{
1075
- id: number;
1137
+ listDocumentLibrariesAsync(siteId: string): Promise<Array<{
1138
+ id: string;
1076
1139
  name: string;
1077
1140
  webUrl: string;
1078
1141
  driveType: string;
1079
1142
  }>>;
1080
1143
  /**
1081
- * Lists items in a document library or folder, caching IDs.
1144
+ * Lists items in a document library or folder, minting durable li_ tokens.
1082
1145
  */
1083
- listLibraryItemsAsync(libraryId: number, folderId?: number): Promise<Array<{
1084
- id: number;
1146
+ listLibraryItemsAsync(libraryId: string, folderId?: string): Promise<Array<{
1147
+ id: string;
1085
1148
  name: string;
1086
1149
  size: number;
1087
1150
  webUrl: string;
@@ -1091,14 +1154,84 @@ export declare class GraphRepository implements IRepository {
1091
1154
  /**
1092
1155
  * Downloads a file from a document library to the specified path.
1093
1156
  */
1094
- downloadLibraryFileAsync(itemId: number, outputPath: string): Promise<string>;
1157
+ downloadLibraryFileAsync(itemId: string, outputPath: string): Promise<string>;
1158
+ /**
1159
+ * Resolves a folder id (durable `fd_` token or raw Graph id) to its Graph id.
1160
+ */
1161
+ getFolderGraphId(folderId: string): string;
1162
+ /**
1163
+ * Lists the SharePoint lists in a site, minting durable sl_ tokens. Each list
1164
+ * token carries the {siteId, listId} tuple its Graph URL needs.
1165
+ */
1166
+ listSharePointListsAsync(siteId: string): Promise<Array<{
1167
+ id: string;
1168
+ name: string;
1169
+ displayName: string;
1170
+ description: string;
1171
+ webUrl: string;
1172
+ }>>;
1173
+ /**
1174
+ * Gets a specific SharePoint list, resolving the sl_ token to its tuple.
1175
+ */
1176
+ getSharePointListAsync(listId: string): Promise<{
1177
+ id: string;
1178
+ name: string;
1179
+ displayName: string;
1180
+ description: string;
1181
+ webUrl: string;
1182
+ }>;
1183
+ /**
1184
+ * Creates a SharePoint list in a site, minting a durable sl_ token.
1185
+ */
1186
+ createSharePointListAsync(siteId: string, displayName: string, description?: string): Promise<string>;
1187
+ /**
1188
+ * Lists the column definitions for a SharePoint list. Columns are addressed by
1189
+ * name in item field values, so they carry no durable token.
1190
+ */
1191
+ listSharePointListColumnsAsync(listId: string): Promise<Array<{
1192
+ id: string;
1193
+ name: string;
1194
+ displayName: string;
1195
+ columnType: string;
1196
+ required: boolean;
1197
+ readOnly: boolean;
1198
+ }>>;
1199
+ /**
1200
+ * Lists the items in a SharePoint list, minting durable sn_ tokens that carry
1201
+ * the {siteId, listId, itemId} tuple.
1202
+ */
1203
+ listSharePointListItemsAsync(listId: string, limit?: number): Promise<Array<{
1204
+ id: string;
1205
+ fields: Record<string, unknown>;
1206
+ webUrl: string;
1207
+ createdDateTime: string;
1208
+ lastModifiedDateTime: string;
1209
+ }>>;
1210
+ /**
1211
+ * Gets a specific SharePoint list item, resolving the sn_ token to its tuple.
1212
+ */
1213
+ getSharePointListItemAsync(itemId: string): Promise<{
1214
+ id: string;
1215
+ fields: Record<string, unknown>;
1216
+ webUrl: string;
1217
+ createdDateTime: string;
1218
+ lastModifiedDateTime: string;
1219
+ }>;
1220
+ /**
1221
+ * Creates an item in a SharePoint list, minting a durable sn_ token.
1222
+ */
1223
+ createSharePointListItemAsync(listId: string, fields: Record<string, unknown>): Promise<string>;
1224
+ /**
1225
+ * Updates the field values of a SharePoint list item.
1226
+ */
1227
+ updateSharePointListItemAsync(itemId: string, fields: Record<string, unknown>): Promise<void>;
1095
1228
  /**
1096
- * Gets the Graph string ID for a folder from the cache.
1229
+ * Deletes an item from a SharePoint list.
1097
1230
  */
1098
- getFolderGraphId(folderId: number): string | undefined;
1231
+ deleteSharePointListItemAsync(itemId: string): Promise<void>;
1099
1232
  }
1100
1233
  /**
1101
1234
  * Creates a Microsoft Graph API repository.
1102
1235
  */
1103
- export declare function createGraphRepository(deviceCodeCallback?: DeviceCodeCallback): GraphRepository;
1236
+ export declare function createGraphRepository(deviceCodeCallback?: DeviceCodeCallback, store?: StateStore, accountId?: () => string): GraphRepository;
1104
1237
  //# sourceMappingURL=repository.d.ts.map