@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
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Next-action hints (U6).
7
+ *
8
+ * List/search/create tools that mint durable ids can attach a single short
9
+ * `next` string to their JSON result, suggesting the natural follow-up tool(s)
10
+ * and naming the token prefix the caller will feed forward — e.g. list_plans →
11
+ * "Use get_plan or list_buckets with a returned `pl_` id." The wording and the
12
+ * prefix are derived centrally (from the token tables) so they stay consistent
13
+ * as the tool surface evolves.
14
+ *
15
+ * Intentionally minimal: one top-level `next` key per result (never per row),
16
+ * added only where a follow-up is genuinely useful. Get and write results skip it.
17
+ */
18
+ import { prefixForEntity } from './token.js';
19
+ /**
20
+ * Follow-up tool names suggested for a returned id of each entity. Exported so a
21
+ * contract test can cross-check every named tool against the registry.
22
+ */
23
+ export const FOLLOWUP_TOOLS = {
24
+ task: 'get_task, update_task, or complete_task',
25
+ taskList: 'create_task',
26
+ plan: 'get_plan or list_buckets',
27
+ plannerBucket: 'list_planner_tasks or create_planner_task',
28
+ plannerTask: 'get_planner_task or update_planner_task',
29
+ message: 'get_email, list_attachments, or reply_as_draft',
30
+ folder: 'list_emails or search_emails',
31
+ contact: 'get_contact or update_contact',
32
+ event: 'get_event or respond_to_event',
33
+ driveItem: 'get_drive_item or download_file',
34
+ site: 'list_document_libraries',
35
+ documentLibrary: 'list_library_items',
36
+ libraryDriveItem: 'download_library_file',
37
+ sharePointList: 'list_list_items',
38
+ sharePointListItem: 'get_list_item or update_list_item',
39
+ team: 'list_channels',
40
+ channel: 'list_channel_messages',
41
+ chat: 'list_chat_messages',
42
+ onlineMeeting: 'get_online_meeting, list_meeting_recordings, or list_meeting_transcripts',
43
+ noteNotebook: 'list_note_sections',
44
+ noteSection: 'list_note_pages',
45
+ notePage: 'get_note_page',
46
+ };
47
+ /**
48
+ * The next-action hint sentence for an entity, or null when none is defined.
49
+ * The `_` suffix on the prefix mirrors the token shape callers see.
50
+ */
51
+ export function nextActionFor(entityType) {
52
+ const tools = FOLLOWUP_TOOLS[entityType];
53
+ if (tools == null) {
54
+ return null;
55
+ }
56
+ return `Use ${tools} with a returned \`${prefixForEntity(entityType)}_\` id.`;
57
+ }
58
+ //# sourceMappingURL=next-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-action.js","sourceRoot":"","sources":["../../src/ids/next-action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwC;IACjE,IAAI,EAAE,yCAAyC;IAC/C,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,0BAA0B;IAChC,aAAa,EAAE,2CAA2C;IAC1D,WAAW,EAAE,yCAAyC;IACtD,OAAO,EAAE,gDAAgD;IACzD,MAAM,EAAE,8BAA8B;IACtC,OAAO,EAAE,+BAA+B;IACxC,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,iCAAiC;IAC5C,IAAI,EAAE,yBAAyB;IAC/B,eAAe,EAAE,oBAAoB;IACrC,gBAAgB,EAAE,uBAAuB;IACzC,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,mCAAmC;IACvD,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,oBAAoB;IAC1B,aAAa,EAAE,0EAA0E;IACzF,YAAY,EAAE,oBAAoB;IAClC,WAAW,EAAE,iBAAiB;IAC9B,QAAQ,EAAE,eAAe;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,UAAsB;IAClD,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,KAAK,sBAAsB,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC;AAChF,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Universal durable-ID resolver (U5 / D1, D2, D4, D7). Turns any ID a tool
7
+ * receives — a self-encoding token, an alias-backed token, a raw Graph ID, or a
8
+ * legacy numeric ID — into a live Graph ID, or a typed error.
9
+ *
10
+ * - self-encoding token → decode, zero storage (cold-state durable).
11
+ * - alias-backed token → alias table lookup (account-scoped). A cold/foreign
12
+ * miss is distinguished: ID_FOREIGN_ACCOUNT vs ID_UNKNOWN.
13
+ * - numeric (v2 hash) → NUMERIC_ID_UNSUPPORTED on Graph (lossy, D4).
14
+ * - raw non-token string → passed through as an opaque Graph ID (a user may
15
+ * paste a real Graph ID; Graph IDs are opaque, so rejecting them would be
16
+ * hostile). Mutation of state lives in the alias table, not here.
17
+ */
18
+ import type { StateStore } from '../state/store.js';
19
+ import { type EntityType } from './token.js';
20
+ /** A resolved Graph ID plus whether it came from a mutable (drift-prone) alias. */
21
+ export interface ResolvedId {
22
+ graphId: string;
23
+ /** True for `$search`-minted mutable alias rows that may need re-resolution. */
24
+ mutable: boolean;
25
+ }
26
+ /**
27
+ * Resolves an ID parameter to a Graph ID for the given signed-in account.
28
+ * Throws a typed {@link import('../utils/errors.js').OutlookMcpError} on failure.
29
+ */
30
+ export declare function resolveId(id: string, accountId: string, store: StateStore | undefined, expectedEntityType?: EntityType): ResolvedId;
31
+ //# sourceMappingURL=resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/ids/resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAOpD,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzD,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,kBAAkB,CAAC,EAAE,UAAU,GAC9B,UAAU,CA8CZ"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ import { IdForeignAccountError, IdUnknownError, IdEntityMismatchError, NumericIdUnsupportedError, } from '../utils/errors.js';
6
+ import { parseToken } from './token.js';
7
+ /**
8
+ * Resolves an ID parameter to a Graph ID for the given signed-in account.
9
+ * Throws a typed {@link import('../utils/errors.js').OutlookMcpError} on failure.
10
+ */
11
+ export function resolveId(id, accountId, store, expectedEntityType) {
12
+ // A bare all-digits string is a legacy v2 hash id (Graph ids and durable
13
+ // tokens are never purely numeric), so surface the same actionable
14
+ // NUMERIC_ID_UNSUPPORTED rather than passing it through to Graph as an opaque
15
+ // id that only 404s. Covers callers whose schema is string-only (U6).
16
+ if (/^\d+$/.test(id)) {
17
+ throw new NumericIdUnsupportedError(id);
18
+ }
19
+ const parsed = parseToken(id);
20
+ if (parsed === null) {
21
+ // Not a known token — treat as an opaque Graph ID the caller supplied.
22
+ return { graphId: id, mutable: false };
23
+ }
24
+ // A durable token for the wrong entity kind (e.g. a folder token passed as a
25
+ // contact id) must not resolve — otherwise it decodes to a foreign Graph id
26
+ // and the safety rests only on Graph 404-ing the mismatched collection.
27
+ if (expectedEntityType != null && parsed.entityType !== expectedEntityType) {
28
+ throw new IdEntityMismatchError(id, expectedEntityType, parsed.entityType);
29
+ }
30
+ if (parsed.kind === 'self') {
31
+ // graphId is always present for a self-encoding parse. Self-encoding tokens
32
+ // decode with zero storage, so no store is required to resolve them.
33
+ return { graphId: parsed.graphId, mutable: false };
34
+ }
35
+ // Alias-backed tokens need the store. Without one they can't be resolved.
36
+ if (store == null) {
37
+ throw new IdUnknownError(id);
38
+ }
39
+ // Alias-backed: resolve against the store, scoped to the account.
40
+ const row = store.getAlias(id, accountId);
41
+ if (row !== null) {
42
+ return { graphId: row.graphId, mutable: row.mutable };
43
+ }
44
+ // Miss — distinguish a foreign-account token from a genuinely unknown one so
45
+ // the agent gets an actionable message (D7).
46
+ const owner = store.getAliasAccount(id);
47
+ if (owner !== null && owner !== accountId) {
48
+ throw new IdForeignAccountError(id);
49
+ }
50
+ throw new IdUnknownError(id);
51
+ }
52
+ //# sourceMappingURL=resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../src/ids/resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAmB,MAAM,YAAY,CAAC;AASzD;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,EAAU,EACV,SAAiB,EACjB,KAA6B,EAC7B,kBAA+B;IAE/B,yEAAyE;IACzE,mEAAmE;IACnE,8EAA8E;IAC9E,sEAAsE;IACtE,IAAI,OAAO,CAAC,IAAI,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C,MAAM,IAAI,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Canonical per-entity Zod id schemas (U6).
7
+ *
8
+ * Every tool that accepts a durable-ID param should reference the shared schema
9
+ * for its entity (`Id.task`, `Id.plan`, …) instead of an ad-hoc
10
+ * `z.string().min(1).describe(...)`. This gives one place to define:
11
+ *
12
+ * - **normalization** — `.trim()` so a copy/pasted id with stray whitespace
13
+ * still resolves; `.min(1)` so an empty/whitespace-only id fails fast.
14
+ * - **a consistent, prefix-named description** — derived from the token tables
15
+ * (`prefixForEntity`), so the param doc always names the token shape (e.g.
16
+ * "a `td_` token") and where to get it.
17
+ *
18
+ * Deliberately NOT here: classification of the id (numeric-vs-token, wrong
19
+ * entity, alias store lookup). That stays in {@link resolveId} at execution
20
+ * time, which is the single source of truth and emits the specific typed codes
21
+ * (`NUMERIC_ID_UNSUPPORTED`, `ID_ENTITY_MISMATCH`, `ID_UNKNOWN`) agents key on.
22
+ * The schema is string-only (a JSON-number legacy id is a type error); a numeric
23
+ * *string* still passes and reaches `resolveId` for the specific message.
24
+ */
25
+ import { z } from 'zod';
26
+ import { type EntityType } from './token.js';
27
+ /** Human label + the tools that mint an entity's id, for the description. */
28
+ interface EntityMeta {
29
+ readonly label: string;
30
+ readonly from: string;
31
+ }
32
+ /**
33
+ * Per-entity description metadata. Only entities actually exposed as tool id
34
+ * params need an entry; others fall back to a generic description. Exported so a
35
+ * contract test can cross-check every `from` tool name against the registry,
36
+ * catching drift when a tool is renamed.
37
+ */
38
+ export declare const ENTITY_META: Partial<Record<EntityType, EntityMeta>>;
39
+ /** Builds the canonical, prefix-named description for an entity id. */
40
+ export declare function describeId(entityType: EntityType): string;
41
+ /**
42
+ * The canonical required id schema for an entity: a trimmed, non-empty string
43
+ * with a prefix-named description. Classification stays in `resolveId`.
44
+ */
45
+ export declare function idSchema(entityType: EntityType): z.ZodString;
46
+ /** The canonical optional id schema for an entity. */
47
+ export declare function optionalIdSchema(entityType: EntityType): z.ZodOptional<z.ZodString>;
48
+ /**
49
+ * Canonical required id schemas keyed by entity. Tools reference these directly
50
+ * (`Id.task`, `Id.plan`, …). A per-call `.describe()` may override the default
51
+ * description where a param needs extra context.
52
+ */
53
+ export declare const Id: {
54
+ readonly message: z.ZodString;
55
+ readonly event: z.ZodString;
56
+ readonly contact: z.ZodString;
57
+ readonly folder: z.ZodString;
58
+ readonly driveItem: z.ZodString;
59
+ readonly task: z.ZodString;
60
+ readonly taskList: z.ZodString;
61
+ readonly plan: z.ZodString;
62
+ readonly plannerBucket: z.ZodString;
63
+ readonly plannerTask: z.ZodString;
64
+ readonly attachment: z.ZodString;
65
+ readonly checklistItem: z.ZodString;
66
+ readonly linkedResource: z.ZodString;
67
+ readonly taskAttachment: z.ZodString;
68
+ readonly chat: z.ZodString;
69
+ readonly team: z.ZodString;
70
+ readonly channel: z.ZodString;
71
+ readonly chatMessage: z.ZodString;
72
+ readonly channelMessage: z.ZodString;
73
+ readonly contactFolder: z.ZodString;
74
+ readonly mailRule: z.ZodString;
75
+ readonly category: z.ZodString;
76
+ readonly focusedOverride: z.ZodString;
77
+ readonly calendarPermission: z.ZodString;
78
+ readonly onlineMeeting: z.ZodString;
79
+ readonly recording: z.ZodString;
80
+ readonly transcript: z.ZodString;
81
+ readonly site: z.ZodString;
82
+ readonly documentLibrary: z.ZodString;
83
+ readonly libraryDriveItem: z.ZodString;
84
+ readonly sharePointList: z.ZodString;
85
+ readonly sharePointListItem: z.ZodString;
86
+ readonly noteNotebook: z.ZodString;
87
+ readonly noteSection: z.ZodString;
88
+ readonly notePage: z.ZodString;
89
+ };
90
+ export {};
91
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ids/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9D,6EAA6E;AAC7E,UAAU,UAAU;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAoC/D,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAMzD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,CAAC,SAAS,CAE5D;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAEnF;AAED;;;;GAIG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCiC,CAAC"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Canonical per-entity Zod id schemas (U6).
7
+ *
8
+ * Every tool that accepts a durable-ID param should reference the shared schema
9
+ * for its entity (`Id.task`, `Id.plan`, …) instead of an ad-hoc
10
+ * `z.string().min(1).describe(...)`. This gives one place to define:
11
+ *
12
+ * - **normalization** — `.trim()` so a copy/pasted id with stray whitespace
13
+ * still resolves; `.min(1)` so an empty/whitespace-only id fails fast.
14
+ * - **a consistent, prefix-named description** — derived from the token tables
15
+ * (`prefixForEntity`), so the param doc always names the token shape (e.g.
16
+ * "a `td_` token") and where to get it.
17
+ *
18
+ * Deliberately NOT here: classification of the id (numeric-vs-token, wrong
19
+ * entity, alias store lookup). That stays in {@link resolveId} at execution
20
+ * time, which is the single source of truth and emits the specific typed codes
21
+ * (`NUMERIC_ID_UNSUPPORTED`, `ID_ENTITY_MISMATCH`, `ID_UNKNOWN`) agents key on.
22
+ * The schema is string-only (a JSON-number legacy id is a type error); a numeric
23
+ * *string* still passes and reaches `resolveId` for the specific message.
24
+ */
25
+ import { z } from 'zod';
26
+ import { prefixForEntity } from './token.js';
27
+ /**
28
+ * Per-entity description metadata. Only entities actually exposed as tool id
29
+ * params need an entry; others fall back to a generic description. Exported so a
30
+ * contract test can cross-check every `from` tool name against the registry,
31
+ * catching drift when a tool is renamed.
32
+ */
33
+ export const ENTITY_META = {
34
+ message: { label: 'email message', from: 'list_emails / search_emails' },
35
+ event: { label: 'calendar event', from: 'list_events / search_events' },
36
+ contact: { label: 'contact', from: 'list_contacts / search_contacts' },
37
+ folder: { label: 'mail folder', from: 'list_folders' },
38
+ driveItem: { label: 'OneDrive item', from: 'list_drive_items / search_drive_items' },
39
+ task: { label: 'To Do task', from: 'list_tasks / search_tasks' },
40
+ taskList: { label: 'To Do task list', from: 'list_task_lists' },
41
+ plan: { label: 'Planner plan', from: 'list_plans' },
42
+ plannerBucket: { label: 'Planner bucket', from: 'list_buckets' },
43
+ plannerTask: { label: 'Planner task', from: 'list_planner_tasks' },
44
+ attachment: { label: 'email attachment', from: 'list_attachments' },
45
+ checklistItem: { label: 'task checklist item', from: 'list_checklist_items' },
46
+ linkedResource: { label: 'task linked resource', from: 'list_linked_resources' },
47
+ taskAttachment: { label: 'task attachment', from: 'list_task_attachments' },
48
+ chat: { label: 'Teams chat', from: 'list_chats' },
49
+ team: { label: 'team', from: 'list_teams' },
50
+ channel: { label: 'Teams channel', from: 'list_channels' },
51
+ chatMessage: { label: 'chat message', from: 'list_chat_messages' },
52
+ channelMessage: { label: 'channel message', from: 'list_channel_messages' },
53
+ contactFolder: { label: 'contact folder', from: 'list_contact_folders' },
54
+ mailRule: { label: 'inbox rule', from: 'list_mail_rules' },
55
+ category: { label: 'master category', from: 'list_categories' },
56
+ focusedOverride: { label: 'focused-inbox override', from: 'list_focused_overrides' },
57
+ calendarPermission: { label: 'calendar permission', from: 'list_calendar_permissions' },
58
+ onlineMeeting: { label: 'online meeting', from: 'list_online_meetings' },
59
+ recording: { label: 'meeting recording', from: 'list_meeting_recordings' },
60
+ transcript: { label: 'meeting transcript', from: 'list_meeting_transcripts' },
61
+ site: { label: 'SharePoint site', from: 'list_sites / search_sites' },
62
+ documentLibrary: { label: 'document library', from: 'list_document_libraries' },
63
+ libraryDriveItem: { label: 'library item', from: 'list_library_items' },
64
+ sharePointList: { label: 'SharePoint list', from: 'list_lists' },
65
+ sharePointListItem: { label: 'SharePoint list item', from: 'list_list_items' },
66
+ noteNotebook: { label: 'OneNote notebook', from: 'list_notebooks' },
67
+ noteSection: { label: 'OneNote section', from: 'list_note_sections' },
68
+ notePage: { label: 'OneNote page', from: 'list_note_pages / search_note_pages' },
69
+ };
70
+ /** Builds the canonical, prefix-named description for an entity id. */
71
+ export function describeId(entityType) {
72
+ const prefix = prefixForEntity(entityType);
73
+ const meta = ENTITY_META[entityType];
74
+ const label = meta?.label ?? entityType;
75
+ const source = meta != null ? ` from ${meta.from}` : '';
76
+ return `Durable ${label} ID — a \`${prefix}_\` token${source}. A raw Graph id is also accepted.`;
77
+ }
78
+ /**
79
+ * The canonical required id schema for an entity: a trimmed, non-empty string
80
+ * with a prefix-named description. Classification stays in `resolveId`.
81
+ */
82
+ export function idSchema(entityType) {
83
+ return z.string().trim().min(1).describe(describeId(entityType));
84
+ }
85
+ /** The canonical optional id schema for an entity. */
86
+ export function optionalIdSchema(entityType) {
87
+ return idSchema(entityType).optional();
88
+ }
89
+ /**
90
+ * Canonical required id schemas keyed by entity. Tools reference these directly
91
+ * (`Id.task`, `Id.plan`, …). A per-call `.describe()` may override the default
92
+ * description where a param needs extra context.
93
+ */
94
+ export const Id = {
95
+ message: idSchema('message'),
96
+ event: idSchema('event'),
97
+ contact: idSchema('contact'),
98
+ folder: idSchema('folder'),
99
+ driveItem: idSchema('driveItem'),
100
+ task: idSchema('task'),
101
+ taskList: idSchema('taskList'),
102
+ plan: idSchema('plan'),
103
+ plannerBucket: idSchema('plannerBucket'),
104
+ plannerTask: idSchema('plannerTask'),
105
+ attachment: idSchema('attachment'),
106
+ checklistItem: idSchema('checklistItem'),
107
+ linkedResource: idSchema('linkedResource'),
108
+ taskAttachment: idSchema('taskAttachment'),
109
+ chat: idSchema('chat'),
110
+ team: idSchema('team'),
111
+ channel: idSchema('channel'),
112
+ chatMessage: idSchema('chatMessage'),
113
+ channelMessage: idSchema('channelMessage'),
114
+ contactFolder: idSchema('contactFolder'),
115
+ mailRule: idSchema('mailRule'),
116
+ category: idSchema('category'),
117
+ focusedOverride: idSchema('focusedOverride'),
118
+ calendarPermission: idSchema('calendarPermission'),
119
+ onlineMeeting: idSchema('onlineMeeting'),
120
+ recording: idSchema('recording'),
121
+ transcript: idSchema('transcript'),
122
+ site: idSchema('site'),
123
+ documentLibrary: idSchema('documentLibrary'),
124
+ libraryDriveItem: idSchema('libraryDriveItem'),
125
+ sharePointList: idSchema('sharePointList'),
126
+ sharePointListItem: idSchema('sharePointListItem'),
127
+ noteNotebook: idSchema('noteNotebook'),
128
+ noteSection: idSchema('noteSection'),
129
+ notePage: idSchema('notePage'),
130
+ };
131
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/ids/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAQ9D;;;;;GAKG;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AQ,CAAC,oBAAoB,CAAC;IAClD,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC;IACtC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC;IACpC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC;CACgB,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /** Entity kinds addressable by a durable-ID token. */
6
+ export type EntityType = 'message' | 'event' | 'contact' | 'folder' | 'driveItem' | 'task' | 'taskList' | 'plan' | 'plannerBucket' | 'plannerTask' | 'chat' | 'team' | 'attachment' | 'channel' | 'chatMessage' | 'channelMessage' | 'checklistItem' | 'linkedResource' | 'taskAttachment' | 'noteNotebook' | 'noteSection' | 'notePage' | 'mailRule' | 'contactFolder' | 'category' | 'focusedOverride' | 'calendarPermission' | 'onlineMeeting' | 'recording' | 'transcript' | 'site' | 'documentLibrary' | 'libraryDriveItem' | 'sharePointList' | 'sharePointListItem';
7
+ /** How a token encodes its target. */
8
+ export type TokenKind = 'self' | 'alias';
9
+ /**
10
+ * Prefix → entity maps are NULL-PROTOTYPE so a caller-supplied prefix like
11
+ * `constructor` or `toString` (from an arbitrary ID string) can never match an
12
+ * inherited `Object.prototype` member and get misclassified as a known token —
13
+ * `parseToken` must return null for those and let the resolver pass them through
14
+ * as opaque Graph IDs.
15
+ */
16
+ /** Self-encoding prefixes → entity type (the token carries the Graph ID). */
17
+ export declare const SELF_ENCODING_PREFIXES: Readonly<Record<string, EntityType>>;
18
+ /** Alias-backed prefixes → entity type (the token is a digest; needs the store). */
19
+ export declare const ALIAS_PREFIXES: Readonly<Record<string, EntityType>>;
20
+ /** A parsed durable-ID token. */
21
+ export interface ParsedToken {
22
+ prefix: string;
23
+ kind: TokenKind;
24
+ entityType: EntityType;
25
+ /** For self-encoding tokens: the decoded Graph ID. Absent for alias tokens. */
26
+ graphId?: string;
27
+ }
28
+ /** True when a prefix is a known self-encoding or alias prefix. */
29
+ export declare function isKnownPrefix(prefix: string): boolean;
30
+ /**
31
+ * The 2-char token prefix for an entity type (e.g. `task` → `td`). Lets callers
32
+ * (canonical id schemas, next-action hints) name the token shape without
33
+ * duplicating the prefix tables. Throws for an entity with no allocated prefix.
34
+ */
35
+ export declare function prefixForEntity(entityType: EntityType): string;
36
+ /**
37
+ * Mints a self-encoding token carrying the immutable Graph ID (D1). Determin­istic.
38
+ */
39
+ export declare function mintSelfEncoded(entityType: EntityType, graphId: string): string;
40
+ /**
41
+ * Mints a short, deterministic alias-backed token from an entity's canonical
42
+ * key (D1). The caller stores the token → key mapping in the alias table.
43
+ */
44
+ export declare function mintComposite(entityType: EntityType, canonicalKey: string): string;
45
+ /**
46
+ * Builds a canonical key for a composite entity from its identifying tuple.
47
+ * Keys are sorted so field order never changes the digest. Keys and values are
48
+ * percent-encoded so a value containing the `&`/`=` delimiters (Graph IDs are
49
+ * base64-ish and can) cannot forge a boundary and make two distinct tuples
50
+ * produce the same key — which would collide their tokens without a hash
51
+ * collision.
52
+ */
53
+ export declare function canonicalKey(entityType: EntityType, parts: Readonly<Record<string, string>>): string;
54
+ /**
55
+ * Parses a token into its prefix/kind/entity (and decoded Graph ID for
56
+ * self-encoding tokens). Returns null when the value is not a well-formed known
57
+ * token — the caller decides whether to treat that as a raw Graph ID or reject.
58
+ */
59
+ export declare function parseToken(token: string): ParsedToken | null;
60
+ /** True when a string looks like a durable-ID token (known prefix + payload). */
61
+ export declare function isToken(value: string): boolean;
62
+ //# sourceMappingURL=token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,GACN,UAAU,GACV,MAAM,GACN,eAAe,GACf,aAAa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