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