@rubytech/create-maxy-code 0.1.416 → 0.1.419

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 (282) hide show
  1. package/dist/__tests__/brand-port-uniqueness.test.js +74 -0
  2. package/dist/__tests__/outlook-client-id-env.test.js +46 -0
  3. package/dist/index.js +31 -0
  4. package/dist/known-brands.js +1 -0
  5. package/dist/port-resolution.js +8 -1
  6. package/package.json +1 -1
  7. package/payload/platform/config/brand-registry.json +8 -0
  8. package/payload/platform/config/brand.json +1 -0
  9. package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.d.ts +2 -0
  10. package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.d.ts.map +1 -0
  11. package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.js +81 -0
  12. package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.js.map +1 -0
  13. package/payload/platform/lib/account-enumeration/dist/index.d.ts +17 -0
  14. package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -1
  15. package/payload/platform/lib/account-enumeration/dist/index.js +46 -9
  16. package/payload/platform/lib/account-enumeration/dist/index.js.map +1 -1
  17. package/payload/platform/lib/account-enumeration/src/__tests__/is-provisioned.test.ts +86 -0
  18. package/payload/platform/lib/account-enumeration/src/index.ts +45 -9
  19. package/payload/platform/lib/account-scope/dist/index.d.ts +14 -5
  20. package/payload/platform/lib/account-scope/dist/index.d.ts.map +1 -1
  21. package/payload/platform/lib/account-scope/dist/index.js +14 -5
  22. package/payload/platform/lib/account-scope/dist/index.js.map +1 -1
  23. package/payload/platform/lib/account-scope/src/index.ts +22 -5
  24. package/payload/platform/lib/active-rules/dist/index.d.ts +35 -0
  25. package/payload/platform/lib/active-rules/dist/index.d.ts.map +1 -0
  26. package/payload/platform/lib/active-rules/dist/index.js +94 -0
  27. package/payload/platform/lib/active-rules/dist/index.js.map +1 -0
  28. package/payload/platform/lib/active-rules/package.json +7 -0
  29. package/payload/platform/lib/active-rules/src/index.test.ts +89 -0
  30. package/payload/platform/lib/active-rules/src/index.ts +133 -0
  31. package/payload/platform/lib/active-rules/tsconfig.json +9 -0
  32. package/payload/platform/package.json +4 -3
  33. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +55 -10
  34. package/payload/platform/plugins/docs/references/internals.md +10 -0
  35. package/payload/platform/plugins/docs/references/memory-guide.md +2 -0
  36. package/payload/platform/plugins/docs/references/outlook-guide.md +42 -9
  37. package/payload/platform/plugins/email/references/email-reference.md +1 -1
  38. package/payload/platform/plugins/filesystem/PLUGIN.md +1 -1
  39. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js +16 -2
  40. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js.map +1 -1
  41. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts +1 -1
  42. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts.map +1 -1
  43. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js +8 -3
  44. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js.map +1 -1
  45. package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js +2 -2
  46. package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js.map +1 -1
  47. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  48. package/payload/platform/plugins/memory/mcp/dist/index-testable.d.ts.map +1 -1
  49. package/payload/platform/plugins/memory/mcp/dist/index-testable.js +14 -5
  50. package/payload/platform/plugins/memory/mcp/dist/index-testable.js.map +1 -1
  51. package/payload/platform/plugins/memory/mcp/dist/index.js +5 -2
  52. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  53. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.d.ts +29 -0
  54. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.d.ts.map +1 -0
  55. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.js +44 -0
  56. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.js.map +1 -0
  57. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.d.ts +2 -0
  58. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.d.ts.map +1 -0
  59. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.js +22 -0
  60. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.js.map +1 -0
  61. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.d.ts +2 -0
  62. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.d.ts.map +1 -0
  63. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.js +49 -0
  64. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.js.map +1 -0
  65. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-bootstrap.test.js +105 -0
  66. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-bootstrap.test.js.map +1 -1
  67. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.d.ts +2 -0
  68. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.d.ts.map +1 -0
  69. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.js +78 -0
  70. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.js.map +1 -0
  71. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.d.ts +2 -0
  72. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.d.ts.map +1 -0
  73. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.js +99 -0
  74. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.js.map +1 -0
  75. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/resolve-tool-account.test.js +2 -2
  76. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/resolve-tool-account.test.js.map +1 -1
  77. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +0 -5
  78. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
  79. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +2 -12
  80. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  81. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +3 -0
  82. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
  83. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +11 -3
  84. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
  85. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +22 -0
  86. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
  87. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +212 -24
  88. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
  89. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  90. package/payload/platform/plugins/outlook/PLUGIN.md +40 -7
  91. package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.d.ts +2 -0
  92. package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.d.ts.map +1 -0
  93. package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js +137 -0
  94. package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js.map +1 -0
  95. package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.d.ts +2 -0
  96. package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.d.ts.map +1 -0
  97. package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.js +210 -0
  98. package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.js.map +1 -0
  99. package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.d.ts +2 -0
  100. package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.d.ts.map +1 -0
  101. package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js +110 -0
  102. package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js.map +1 -0
  103. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.d.ts +2 -0
  104. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.d.ts.map +1 -0
  105. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js +108 -0
  106. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js.map +1 -0
  107. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js +13 -0
  108. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js.map +1 -1
  109. package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.d.ts +2 -0
  110. package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.d.ts.map +1 -0
  111. package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.js +32 -0
  112. package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.js.map +1 -0
  113. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.d.ts +2 -0
  114. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.d.ts.map +1 -0
  115. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.js +67 -0
  116. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.js.map +1 -0
  117. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js +7 -5
  118. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js.map +1 -1
  119. package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.d.ts +2 -0
  120. package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.d.ts.map +1 -0
  121. package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.js +141 -0
  122. package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.js.map +1 -0
  123. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts +69 -0
  124. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts.map +1 -0
  125. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js +129 -0
  126. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js.map +1 -0
  127. package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.d.ts +39 -0
  128. package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.d.ts.map +1 -0
  129. package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.js +101 -0
  130. package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.js.map +1 -0
  131. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +1 -1
  132. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +3 -2
  133. package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +1 -1
  134. package/payload/platform/plugins/outlook/mcp/dist/index.js +187 -5
  135. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  136. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts +34 -1
  137. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -1
  138. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +96 -7
  139. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
  140. package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts +31 -0
  141. package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts.map +1 -0
  142. package/payload/platform/plugins/outlook/mcp/dist/lib/message.js +30 -0
  143. package/payload/platform/plugins/outlook/mcp/dist/lib/message.js.map +1 -0
  144. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts +41 -17
  145. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts.map +1 -1
  146. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js +87 -28
  147. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js.map +1 -1
  148. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.d.ts +17 -0
  149. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.d.ts.map +1 -0
  150. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.js +38 -0
  151. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.js.map +1 -0
  152. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.d.ts +42 -0
  153. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.d.ts.map +1 -0
  154. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.js +59 -0
  155. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.js.map +1 -0
  156. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.d.ts +34 -0
  157. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.d.ts.map +1 -0
  158. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.js +46 -0
  159. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.js.map +1 -0
  160. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.d.ts +15 -0
  161. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.d.ts.map +1 -0
  162. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.js +27 -0
  163. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.js.map +1 -0
  164. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.d.ts +11 -0
  165. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.d.ts.map +1 -0
  166. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.js +20 -0
  167. package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.js.map +1 -0
  168. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.d.ts +17 -0
  169. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.d.ts.map +1 -0
  170. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.js +26 -0
  171. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.js.map +1 -0
  172. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +11 -0
  173. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -0
  174. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +26 -0
  175. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -0
  176. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.d.ts +14 -0
  177. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.d.ts.map +1 -0
  178. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.js +26 -0
  179. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.js.map +1 -0
  180. package/payload/platform/plugins/outlook/mcp/scripts/verify-doc-impl.sh +2 -2
  181. package/payload/platform/plugins/outlook/references/auth.md +51 -54
  182. package/payload/platform/plugins/outlook/references/graph-surfaces.md +97 -4
  183. package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +34 -9
  184. package/payload/platform/plugins/whatsapp/mcp/dist/index.js +10 -5
  185. package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
  186. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +9 -1
  187. package/payload/platform/scripts/__tests__/provision-role-stamp.test.sh +3 -0
  188. package/payload/platform/scripts/lib/provision-account-dir.sh +9 -1
  189. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts +1 -1
  190. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts.map +1 -1
  191. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js +5 -1
  192. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js.map +1 -1
  193. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  194. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +9 -0
  195. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  196. package/payload/platform/services/claude-session-manager/dist/config.d.ts +18 -0
  197. package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
  198. package/payload/platform/services/claude-session-manager/dist/config.js +16 -0
  199. package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
  200. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +1 -0
  201. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  202. package/payload/platform/services/claude-session-manager/dist/http-server.js +36 -4
  203. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  204. package/payload/platform/services/claude-session-manager/dist/index.js +14 -0
  205. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  206. package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.d.ts +46 -0
  207. package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.d.ts.map +1 -0
  208. package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.js +96 -0
  209. package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.js.map +1 -0
  210. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +33 -0
  211. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  212. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +61 -7
  213. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  214. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
  215. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +5 -1
  216. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
  217. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +6 -0
  218. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
  219. package/payload/platform/services/claude-session-manager/dist/system-prompt.js +20 -0
  220. package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
  221. package/payload/platform/services/telegram-channel/dist/instructions.d.ts +9 -0
  222. package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -0
  223. package/payload/platform/services/telegram-channel/dist/instructions.js +100 -0
  224. package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -0
  225. package/payload/platform/services/telegram-channel/dist/notification.d.ts +93 -0
  226. package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -0
  227. package/payload/platform/services/telegram-channel/dist/notification.js +119 -0
  228. package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -0
  229. package/payload/platform/services/telegram-channel/dist/server.d.ts +40 -0
  230. package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -0
  231. package/payload/platform/services/telegram-channel/dist/server.js +291 -0
  232. package/payload/platform/services/telegram-channel/dist/server.js.map +1 -0
  233. package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +28 -0
  234. package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +1 -0
  235. package/payload/platform/services/telegram-channel/dist/turn-follow.js +188 -0
  236. package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +1 -0
  237. package/payload/platform/services/webchat-channel/dist/notification.d.ts +5 -0
  238. package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -1
  239. package/payload/platform/services/webchat-channel/dist/notification.js +6 -1
  240. package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -1
  241. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +6 -0
  242. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  243. package/payload/platform/services/whatsapp-channel/dist/notification.js +8 -1
  244. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  245. package/payload/platform/templates/agents/passive/IDENTITY.md +21 -0
  246. package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
  247. package/payload/server/public/assets/{AdminLoginScreens-CBlE6FB4.js → AdminLoginScreens-B1PkOF66.js} +1 -1
  248. package/payload/server/public/assets/AdminShell-D8wNArGQ.js +2 -0
  249. package/payload/server/public/assets/{Checkbox-B0pbYJDQ.js → Checkbox-Bm9Er726.js} +1 -1
  250. package/payload/server/public/assets/{Transcript-CYaAPBFX.js → Transcript-CBIyQ8T5.js} +1 -1
  251. package/payload/server/public/assets/{admin-CVh9HO-f.js → admin-CWM9G_yA.js} +1 -1
  252. package/payload/server/public/assets/{browser-C4f_D4Ih.js → browser-D8QhNffV.js} +1 -1
  253. package/payload/server/public/assets/{calendar-WUxQ4fVo.js → calendar-qob5K4t_.js} +1 -1
  254. package/payload/server/public/assets/chat-BNrxVUF6.js +1 -0
  255. package/payload/server/public/assets/chevron-left-BQThFVrd.js +1 -0
  256. package/payload/server/public/assets/data-C-EqNbRi.js +1 -0
  257. package/payload/server/public/assets/{graph-BNXE6mKP.js → graph-DZ2HMpIB.js} +1 -1
  258. package/payload/server/public/assets/{graph-labels-Csnovm_c.js → graph-labels-BFG4bjXQ.js} +1 -1
  259. package/payload/server/public/assets/{maximize-2-WRUJsg5n.js → maximize-2-DkZ40lSl.js} +1 -1
  260. package/payload/server/public/assets/{operator-CXtygMh6.js → operator-FrXrSsBj.js} +1 -1
  261. package/payload/server/public/assets/page-CHWMI9Tm.js +32 -0
  262. package/payload/server/public/assets/{page-IQDLdebG.js → page-CXKV01gT.js} +1 -1
  263. package/payload/server/public/assets/{public-DSeYu61E.js → public-2p1pJ4WF.js} +1 -1
  264. package/payload/server/public/assets/{rotate-ccw-BayMWwfc.js → rotate-ccw-D3o_bMBA.js} +1 -1
  265. package/payload/server/public/assets/useSubAccountSwitcher-8dLvF3Ux.js +9 -0
  266. package/payload/server/public/assets/useSubAccountSwitcher-BUvlETHN.css +1 -0
  267. package/payload/server/public/browser.html +4 -4
  268. package/payload/server/public/calendar.html +5 -5
  269. package/payload/server/public/chat.html +9 -9
  270. package/payload/server/public/data.html +8 -8
  271. package/payload/server/public/graph.html +9 -9
  272. package/payload/server/public/index.html +11 -11
  273. package/payload/server/public/operator.html +11 -11
  274. package/payload/server/public/public.html +9 -9
  275. package/payload/server/server.js +245 -40
  276. package/payload/server/public/assets/AdminShell-d1WQ3lLu.js +0 -2
  277. package/payload/server/public/assets/chat-NJ2HXhOf.js +0 -1
  278. package/payload/server/public/assets/chevron-left-Da-iZGi_.js +0 -1
  279. package/payload/server/public/assets/data-ZUdT44Ba.js +0 -1
  280. package/payload/server/public/assets/page-DjpQp_ir.js +0 -32
  281. package/payload/server/public/assets/useSubAccountSwitcher-C9aLg8yI.js +0 -9
  282. package/payload/server/public/assets/useSubAccountSwitcher-CRZfyJXR.css +0 -1
@@ -1,102 +1,99 @@
1
1
  # Outlook Auth Reference
2
2
 
3
- ## Vendored upstream
3
+ ## Provenance
4
4
 
5
- The PKCE flow and encrypted token store are adapted from:
5
+ The device-code register flow is **bespoke to Maxy**, not vendored. It is not the `nsakki55/outlook-mcp` loopback `authManager` — that ran an HTTP server on the box and required consent in a browser on the same machine, which is impossible on a headless/remote install. `device-flow.ts` talks to Microsoft's `/devicecode` and `/token` endpoints directly.
6
6
 
7
- - **Repo:** [`nsakki55/outlook-mcp`](https://github.com/nsakki55/outlook-mcp)
8
- - **Pinned commit:** `e49d8e68ac8d69db653c25803127dc3b98626cda`
9
- - **License:** MIT
10
-
11
- Adaptations:
7
+ The **encrypted token store** (`token-store.ts`) is still adapted from [`nsakki55/outlook-mcp`](https://github.com/nsakki55/outlook-mcp) (commit `e49d8e68ac8d69db653c25803127dc3b98626cda`, MIT):
12
8
 
13
9
  - Per-account paths (`{ACCOUNTS_DIR}/{accountId}/secrets/outlook/`) instead of upstream's single-user `~/.outlook-mcp/`
14
10
  - `keytar` fallback removed (Pi runs headless; no Secret Service)
15
11
  - `node-persist` removed; single JSON blob written atomically (temp + rename)
16
- - Loopback callback port is **ephemeral** via `server.listen(0)` (upstream uses fixed `49152`)
17
- - No `xdg-open` browser auto-launch; auth URL is logged + returned to the operator for the VNC browser
18
- - `outlook-account-register` awaits the full PKCE flow synchronously (5-min timeout)
19
12
 
20
- To re-vendor at a newer SHA:
13
+ ## Client ID model: one vendor app per brand
14
+
15
+ End users never register an Azure app. The `OUTLOOK_CLIENT_ID` is a **public, non-secret** value (a PKCE public-client app has no client secret), and the app is **multi-tenant** (`/common`), so **one vendor-owned Entra app per brand** serves every install and every mailbox on that brand. End users only complete the OAuth consent screen; per-mailbox tokens stay per-account and encrypted, so a shared client ID does not weaken isolation.
21
16
 
22
- 1. Fetch `tokenManager.ts` and `authManager.ts` from the new SHA.
23
- 2. Apply the adaptations above.
24
- 3. Update the **Pinned commit** line above.
25
- 4. Bump `@maxy/outlook` version.
26
- 5. Run the test suite.
17
+ The value ships as the brand default: `brands/<brand>/brand.json#outlookClientId`. The installer stamps it onto the `-claude-session-manager` unit env as `OUTLOOK_CLIENT_ID` (+ `OUTLOOK_TENANT_ID=common`), and the plugin resolves it through the PLUGIN.md `mcp.env` passthrough. A brand that ships the field empty has the plugin inert (register refuses) until its vendor app exists — no operator action makes it work.
27
18
 
28
- ## Entra app registration (one-time per Maxy install)
19
+ **Per-install override (escape hatch, not required):** setting `OUTLOOK_CLIENT_ID` in the install's env overrides the brand default. This is only for a vendor testing a replacement app; normal installs need nothing.
29
20
 
30
- The plugin requires an Azure AD ("Entra ID") app the operator owns. Steps:
21
+ ### Vendor provisioning runbook (one-time per brand)
31
22
 
32
- 1. Sign in to the [Azure portal](https://portal.azure.com) with a Microsoft account.
23
+ Run once per brand to mint the app whose ID goes in that brand's `brand.json`. Not an end-user step.
24
+
25
+ 1. Sign in to the [Azure portal](https://portal.azure.com) with the brand's Microsoft account.
33
26
  2. Go to **Microsoft Entra ID → App registrations → New registration**.
34
- 3. **Name:** `Maxy Outlook` (or any name the operator prefers).
35
- 4. **Supported account types:** *Accounts in any organizational directory and personal Microsoft accounts*.
36
- 5. **Redirect URI** (Platform: *Mobile and desktop applications*): `http://localhost`
37
- - **Note:** no port is specified. Microsoft Identity Platform treats native-app loopback redirects with port-flexible matching, allowing the plugin to use an ephemeral port.
38
- 6. Click **Register**. Copy the **Application (client) ID** this is `OUTLOOK_CLIENT_ID`.
39
- 7. Go to **API permissions → Add a permission → Microsoft Graph → Delegated permissions**, add:
27
+ 3. **Name:** the brand's product name plus "Outlook" (e.g. `SiteDesk Outlook`).
28
+ 4. **Supported account types:** *Accounts in any organizational directory and personal Microsoft accounts* (multi-tenant is required — one app serves every end user's tenant).
29
+ 5. Leave **Redirect URI** empty. The device-code flow does not use one.
30
+ 6. Click **Register**. Copy the **Application (client) ID** this is the brand's `outlookClientId`.
31
+ 7. Go to **Authentication Advanced settings → Allow public client flows** and set it to **Yes**. The device-code grant is a public-client flow and fails with `AADSTS7000218` if this is off.
32
+ 8. Go to **API permissions → Add a permission → Microsoft Graph → Delegated permissions**, add:
40
33
  - `offline_access`
41
34
  - `User.Read`
42
- - `Mail.Read`
35
+ - `Mail.ReadWrite`
36
+ - `Mail.Send`
43
37
  - `Calendars.Read`
44
38
  - `Contacts.Read`
45
- 8. Click **Grant admin consent for <tenant>** if applicable. Personal accounts auto-consent at first sign-in.
46
- 9. Set the env var on the Pi:
47
- ```
48
- OUTLOOK_CLIENT_ID=<the Application (client) ID copied above>
49
- OUTLOOK_TENANT_ID=common # or your tenant GUID for single-tenant
39
+ 9. Leave admin consent to the end user: with delegated scopes on a multi-tenant app, each end user consents for their own mailbox at first sign-in. (Frictionless cross-tenant consent is smoother once the app is publisher-verified via MPN — a separate enabling step.)
40
+ 10. Set the value in the brand's `brand.json` and re-bundle:
41
+ ```jsonc
42
+ // brands/<brand>/brand.json
43
+ "outlookClientId": "<the Application (client) ID copied above>"
50
44
  ```
45
+ `OUTLOOK_TENANT_ID` is always `common`; the installer stamps it and no brand field is needed.
51
46
 
52
- ## PKCE flow (per-account)
47
+ ## Device-code flow (per-account)
53
48
 
54
- Triggered by `outlook-account-register`. Sequence:
49
+ Two tools: `outlook-account-register` starts the flow, `outlook-account-register-poll` completes it. No loopback server, no same-machine constraint — the operator consents on any device.
55
50
 
56
51
  ```
57
52
  operator plugin Microsoft
58
53
  | | |
59
54
  | outlook-account-register | |
60
- |--------------------------------------------->| |
61
- | | bind 127.0.0.1:<ephemeral-port> |
62
- | | generate code_verifier (32 bytes) |
63
- | | code_challenge = SHA256(verifier) |
64
- | | state = randomBytes(16) |
65
- | | |
66
- | { authUrl, status: "pending" } | |
55
+ |--------------------------------------------->| POST /devicecode (client_id+scope) |
56
+ | | -----------------------------------> |
57
+ | | < device_code, user_code, |
58
+ | | verification_uri, expires_in, |
59
+ | | interval |
60
+ | | <----------------------------------- |
61
+ | | encrypt write {pending-devicecode.enc}
62
+ | { status: "pending", userCode, | |
63
+ | verificationUri, ... } | |
67
64
  |<---------------------------------------------| |
68
65
  | | |
69
- | open authUrl in VNC browser | |
70
- |---------------------------------------------------------------------------------> |
66
+ | open microsoft.com/devicelogin on ANY device | |
67
+ | enter userCode, sign in, consent ------------------------------------------------> |
71
68
  | | |
72
- | consent ←--------------------------------------- |
73
- | | |
74
- | | GET /callback?code=...&state=... |
75
- | | <----------------------------------|
76
- | | |
77
- | | verify state |
78
- | | POST /token (code + verifier) |
69
+ | outlook-account-register-poll (repeat) | |
70
+ |--------------------------------------------->| POST /token (device_code grant) |
79
71
  | | -----------------------------------> |
80
- | | < tokens |
72
+ | | < authorization_pending → pending |
73
+ | | < tokens (once consented) → success |
81
74
  | | <----------------------------------- |
82
75
  | | encrypt → write {tokens.enc} |
83
76
  | | GET /me (record graphUserId) |
84
- | | -----------------------------------> |
85
- | | |
77
+ | | clear pending (verified re-stat) |
86
78
  | { status: "registered", graphUserId, ... } | |
87
79
  |<---------------------------------------------| |
88
80
  ```
89
81
 
82
+ `poll` maps Microsoft's polling errors: `authorization_pending` → `pending` (wait `intervalSec`, poll again), `slow_down` → `pending` with a bumped interval, `expired_token` → `expired`, `access_denied` → `denied`.
83
+
90
84
  ## Token store layout
91
85
 
92
86
  Per-account, mode 0700 directory + mode 0600 files:
93
87
 
94
88
  ```
95
89
  data/accounts/<accountId>/secrets/outlook/
96
- ├── .key # 32 random bytes, base64-encoded — the AES-256-CBC key
97
- └── tokens.enc # AES-256-CBC ciphertext: "<iv-hex>:<cipher-hex>" of JSON blob
90
+ ├── .key # 32 random bytes, base64-encoded — the AES-256-CBC key
91
+ ├── tokens.enc # AES-256-CBC ciphertext: "<iv-hex>:<cipher-hex>" of the token JSON blob
92
+ └── pending-devicecode.enc # transient — the device_code between register + poll; cleared on any terminal outcome
98
93
  ```
99
94
 
95
+ The pending file reuses the same `.key`. It is written by `outlook-account-register` and removed (verified by re-stat) when polling reaches `registered`, `expired`, or `denied`, so a device_code never lingers.
96
+
100
97
  The JSON blob shape:
101
98
 
102
99
  ```typescript
@@ -28,6 +28,42 @@ Array<{
28
28
 
29
29
  **Returned shape:** identical to `outlook-mail-list`.
30
30
 
31
+ ## outlook-mail-send
32
+
33
+ **Endpoint:** `POST /me/sendMail`
34
+
35
+ **Request body:**
36
+ ```json
37
+ {
38
+ "message": {
39
+ "subject": "…",
40
+ "body": { "contentType": "Text | HTML", "content": "…" },
41
+ "toRecipients": [{ "emailAddress": { "address": "a@example.com" } }],
42
+ "ccRecipients": [ … ],
43
+ "bccRecipients": [ … ]
44
+ },
45
+ "saveToSentItems": true
46
+ }
47
+ ```
48
+
49
+ **Success:** HTTP `202 Accepted`, empty body. No message id is returned. The tool asserts on the 202 — an empty body is not proof of send.
50
+
51
+ ## outlook-draft
52
+
53
+ **Endpoint:** `POST /me/messages`
54
+
55
+ **Request body:** the `message` object above (no `saveToSentItems` wrapper).
56
+
57
+ **Success:** HTTP `201 Created` with the created message JSON; `id` is the stable handle for `outlook-draft-send`.
58
+
59
+ ## outlook-draft-send
60
+
61
+ **Endpoint:** `POST /me/messages/{id}/send`
62
+
63
+ **Request body:** none.
64
+
65
+ **Success:** HTTP `202 Accepted`, empty body. Graph consumes the draft (it moves out of Drafts on send).
66
+
31
67
  ## outlook-calendar-list
32
68
 
33
69
  **Endpoint:** `GET /me/calendarView?startDateTime={now}&endDateTime={now+rangeDays}&$top={N}&$orderby=start/dateTime ASC&$select=id,subject,start,end,location,attendees,isAllDay,organizer`
@@ -59,6 +95,54 @@ Array<{
59
95
  }
60
96
  ```
61
97
 
98
+ ## outlook-calendar-create
99
+
100
+ **Endpoint:** `POST /me/events` (`ResponseType.RAW`; success asserted on HTTP 201).
101
+
102
+ **Request body:** `subject`, `start`/`end` (`{ dateTime, timeZone }`), and optionally `body` (`{ contentType: "HTML", content }`), `location` (`{ displayName }`), `attendees` (`{ emailAddress: { address, name }, type }`), `isOnlineMeeting`, `recurrence` (Graph recurrence object, passed through).
103
+
104
+ **Returned shape:** `{ eventId: string; webLink: string | null }`.
105
+
106
+ ## outlook-calendar-update
107
+
108
+ **Endpoint:** `PATCH /me/events/{eventId}` (`ResponseType.RAW`; success asserted on HTTP 200).
109
+
110
+ **Request body:** only the supplied fields, same shapes as create.
111
+
112
+ **Returned shape:** `{ eventId: string; updated: true }`.
113
+
114
+ ## outlook-calendar-cancel
115
+
116
+ **Endpoint:** determined by a pre-GET on `GET /me/events/{eventId}?$select=isOrganizer,attendees`.
117
+ - Organiser of a meeting with attendees: `POST /me/events/{eventId}/cancel` with `{ Comment }` (HTTP 202); attendees are notified.
118
+ - Otherwise: `DELETE /me/events/{eventId}` (HTTP 204).
119
+
120
+ **Returned shape:** `{ eventId: string; mode: "cancel" | "delete" }`.
121
+
122
+ ## outlook-calendar-respond
123
+
124
+ **Endpoint:** `POST /me/events/{eventId}/{accept|decline|tentativelyAccept}` with `{ Comment, SendResponse }` (HTTP 202). `action=tentative` maps to `tentativelyAccept`.
125
+
126
+ **Returned shape:** `{ eventId: string; action: "accept" | "decline" | "tentative" }`.
127
+
128
+ ## outlook-calendar-freebusy
129
+
130
+ **Endpoint:** `POST /me/calendar/getSchedule` with `{ schedules, startTime, endTime, availabilityViewInterval }` (HTTP 200).
131
+
132
+ **Returned shape:**
133
+ ```typescript
134
+ {
135
+ requested: number;
136
+ resolved: number; // count of error-free entries; resolved < requested flags a failed address
137
+ availability: Array<{
138
+ address: string; // scheduleId
139
+ availabilityView: string;
140
+ busy: Array<{ start: string; end: string; status: string }>;
141
+ error: string | null; // Graph FreeBusyError message when the address could not be resolved
142
+ }>;
143
+ }
144
+ ```
145
+
62
146
  ## outlook-contacts-list
63
147
 
64
148
  **Endpoint:** `GET /me/contacts?$top={N}&$select=id,displayName,emailAddresses,businessPhones,homePhones,mobilePhone,jobTitle,companyName`
@@ -94,19 +178,28 @@ Array<{
94
178
 
95
179
  ## outlook-account-register
96
180
 
97
- No Graph endpoint of its own. The flow exchanges an authorization code at:
181
+ Starts the device-code flow. No Graph endpoint of its own:
182
+
183
+ - `POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/devicecode` (client_id + scope)
184
+
185
+ Returns `{ status: "pending", userCode, verificationUri, verificationUriComplete, expiresInSec, intervalSec }` immediately and writes an encrypted pending entry. Does not block.
186
+
187
+ ## outlook-account-register-poll
188
+
189
+ One token poll per call:
98
190
 
99
- - `POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token`
191
+ - `POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token` with `grant_type=urn:ietf:params:oauth:grant-type:device_code`
100
192
 
101
- After the token exchange, the tool fetches `GET /me?$select=id,mail,userPrincipalName` to record `graphUserId`.
193
+ Returns `pending` / `registered` / `expired` / `denied`. On `registered`, the tool fetches `GET /me?$select=id,mail,userPrincipalName` to record `graphUserId`, persists tokens, and clears the pending entry.
102
194
 
103
195
  ## Error classification
104
196
 
105
- All tool failures route through `lib/graph-client.ts:classifyGraphError`. Decisions key off **status code + Graph `error.code` field + headers**, never the error `message` body.
197
+ All tool failures route through `lib/graph-client.ts:classifyGraphError`. Decisions key off **status code + Graph `error.code` field + headers**, never the error `message` body. Read tools use `callGraph` (the Graph SDK throws on non-2xx); write tools use `postGraph` / `patchGraph` / `deleteGraph` (one `writeGraph` core), which request `ResponseType.RAW` so a non-2xx status is returned rather than thrown, normalize it into the shape `classifyGraphError` reads, and re-throw it through `callGraph`'s loop — success is asserted on the status code.
106
198
 
107
199
  | HTTP status | Graph `error.code` | Class | Action |
108
200
  |---|---|---|---|
109
201
  | 401 | (any) | `auth` | Refresh once, retry; if still 401 → terminal `auth-required` |
202
+ | 403 | (any) | `scope-insufficient` | Terminal: name the scope the failing tool needs (`Mail.Send`, `Mail.ReadWrite`, or `Calendars.ReadWrite` for a calendar write) and route the operator to `outlook-account-register` |
110
203
  | 429 | (any) — header `Retry-After` present | `rate-limit-recoverable` | Backoff per header, retry once |
111
204
  | 429 | (any) — header `Retry-After` absent | `rate-limit-terminal` | Terminal abort |
112
205
  | 503 | `MailboxNotEnabledForRESTAPI` | `on-prem` | Terminal: route operator to IMAP plugin |
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: outlook
3
- description: "Microsoft 365 / Outlook.com via Microsoft Graph (read-only). Use when the user asks about their Outlook mail, calendar, or contacts listing, searching, or checking events. First-time use requires outlook-account-register; subsequent use is transparent. Tools outlook-mail-list / outlook-mail-search (inbox), outlook-calendar-list / outlook-calendar-event (calendar), outlook-contacts-list (contacts), outlook-mailbox-info (health), outlook-account-register (PKCE register)."
3
+ description: "Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read, draft, and send; contacts are read-only; the calendar is read plus control. Use when the user asks about their Outlook mail, calendar, or contacts, wants to send or draft a message, or asks to book, move, cancel, or accept a calendar event. First-time use requires outlook-account-register plus outlook-account-register-poll; subsequent use is transparent. Tools: outlook-mail-list / outlook-mail-search (inbox), outlook-mail-send / outlook-draft / outlook-draft-send (compose and send), outlook-calendar-list / outlook-calendar-event (read calendar), outlook-calendar-create / outlook-calendar-update / outlook-calendar-cancel / outlook-calendar-respond / outlook-calendar-freebusy (control calendar), outlook-contacts-list (contacts), outlook-mailbox-info (health), outlook-account-register / outlook-account-register-poll (device-code register)."
4
4
  ---
5
5
 
6
6
  # Outlook (Microsoft Graph)
7
7
 
8
8
  Invoked from `specialists:personal-assistant`.
9
9
 
10
- Read-only access to the user's Outlook.com or Microsoft 365 mailbox via Microsoft Graph. Per-account OAuth, encrypted token storage, refresh handled automatically.
10
+ Access to the user's Outlook.com or Microsoft 365 mailbox via Microsoft Graph. Mail is read, draft, and send; contacts are read-only. The calendar is read plus control: the agent can book, reschedule, cancel, and respond to events, and check availability. Per-account OAuth, encrypted token storage, refresh handled automatically.
11
11
 
12
12
  ## When to activate
13
13
 
@@ -21,29 +21,52 @@ Do **not** activate for:
21
21
 
22
22
  - IMAP-only providers (Gmail, iCloud, custom domains not on Microsoft 365) — use the `email` plugin instead.
23
23
  - On-premises Exchange — Microsoft Graph deprecated hybrid REST 2023-07. The plugin detects on-prem mailboxes and emits a clear error pointing to the IMAP path.
24
- - Sending / drafting / modifying messages or events — out of scope. Read-only.
24
+ - Moving, flagging, or deleting messages, or writing to contacts — out of scope. Mail read, draft, and send are supported, and the calendar is read plus control; contacts stay read-only.
25
25
 
26
26
  ## First-time setup (one-time per account)
27
27
 
28
- The Outlook plugin needs an **Entra app registration** in the operator's Microsoft tenant. This is a one-time-per-install step (not per-account), documented at [`references/auth.md`](references/auth.md).
28
+ The client ID ships with the brand, so there is no app to register and no Azure work. End users only consent to the mailbox they want to connect. The vendor app that backs the brand is provisioned once per brand and documented at [`references/auth.md`](references/auth.md); end users never touch it.
29
29
 
30
- Once the Entra app exists and `OUTLOOK_CLIENT_ID` is set in the Maxy installation, run:
30
+ Connect a mailbox via the device-code flow. The operator never needs the box's browser and never screen-shares.
31
31
 
32
- 1. **`outlook-account-register`** the tool returns an `authUrl`. The operator opens this URL in the VNC browser, signs in with the Microsoft account they want to connect, and consents to the requested scopes (`offline_access`, `User.Read`, `Mail.Read`, `Calendars.Read`, `Contacts.Read`).
33
- 2. Tool returns `{ status: "registered", graphUserId, scopes, tokenExpSec }` once consent completes.
32
+ 1. Call **`outlook-account-register`**. It returns immediately with `{ status: "pending", userCode, verificationUri, verificationUriComplete, expiresInSec, intervalSec }`. Relay the `userCode` and `verificationUri` to the operator in your reply.
33
+ 2. The operator opens `verificationUri` (`microsoft.com/devicelogin`) on any device (their phone or laptop), enters the `userCode`, signs in with the Microsoft account they want to connect, and consents to the requested scopes (`offline_access`, `User.Read`, `Mail.ReadWrite`, `Mail.Send`, `Calendars.ReadWrite`, `Contacts.Read`). `Mail.Send` enables sending and `Calendars.ReadWrite` enables calendar control; a mailbox last consented on an older read-only scope set must re-register before send or any calendar write succeeds.
34
+ 3. Call **`outlook-account-register-poll`** once per check. While it returns `{ status: "pending" }`, wait `intervalSec` seconds and call it again. It returns `{ status: "registered", graphUserId, scopes, tokenExpSec }` once consent completes, `{ status: "expired" }` if the code timed out (restart at step 1), or `{ status: "denied" }` if the operator declined.
34
35
 
35
36
  Subsequent tool calls use the persisted refresh token to mint access tokens transparently. Re-register is only needed if the refresh token expires (90 days) or the user revokes consent.
36
37
 
38
+ If the brand ships no vendor app yet, `outlook-account-register` reports that the client ID is not configured. There is no per-install workaround; the brand's vendor app has to exist first.
39
+
40
+ **Microsoft mail does not use IMAP or app passwords.** Microsoft retired Basic auth for Exchange Online and app passwords stopped working. Never route a Microsoft mailbox through the `email` plugin's IMAP path, and never suggest an app password. The device-code flow above is the only supported connection.
41
+
37
42
  ## Reading mail
38
43
 
39
44
  - `outlook-mail-list` — recent mail, default top=25, folder=Inbox.
40
45
  - `outlook-mail-search query=<keyword>` — Microsoft Graph `$search` over the mailbox.
41
46
 
47
+ ## Sending and drafting
48
+
49
+ - `outlook-mail-send` — send a message. `to` is an array of addresses (at least one); `cc`/`bcc` optional arrays; `subject`; `body`; `isHtml` true for an HTML body, otherwise plain text. A copy is saved to Sent Items. Success is confirmed on Graph's 202 response.
50
+ - `outlook-draft` — create a draft in the Drafts folder (same fields as send). Returns the draft's id.
51
+ - `outlook-draft-send draftId=<id>` — send a draft created earlier. Graph consumes the draft on send.
52
+
53
+ If the mailbox was registered before send was available, the first send returns "re-register to grant send" — run `outlook-account-register` again and consent to the send scopes.
54
+
42
55
  ## Reading calendar
43
56
 
44
57
  - `outlook-calendar-list rangeDays=<N>` — events in the next N days (default 7, max 365).
45
58
  - `outlook-calendar-event eventId=<id>` — single event with full body and attendees.
46
59
 
60
+ ## Controlling calendar
61
+
62
+ All calendar writes need the `Calendars.ReadWrite` consent (see setup above). Times are `{ dateTime, timeZone }`, for example `{ "dateTime": "2026-07-10T09:00:00", "timeZone": "Europe/London" }`.
63
+
64
+ - `outlook-calendar-create` — book an event. Requires `subject`, `start`, `end`. Optional `body`, `attendees` (each `{ email, name?, type? }`), `location`, `isOnlineMeeting`, and a Graph `recurrence` object. Returns the new `eventId` and `webLink`.
65
+ - `outlook-calendar-update eventId=<id>` — reschedule or edit. Pass only the fields to change.
66
+ - `outlook-calendar-cancel eventId=<id>` — cancel. When the account organises a meeting with attendees, this posts a cancellation that notifies them (optional `comment` is the message); otherwise it deletes the event from the calendar. The chosen mode is reported back.
67
+ - `outlook-calendar-respond eventId=<id> action=<accept|decline|tentative>` — reply to an invite. Optional `comment`; `sendResponse` defaults to true.
68
+ - `outlook-calendar-freebusy schedules=[<address>...]` — availability for one or more addresses over a `start`/`end` window (optional `intervalMinutes`, default 60). Each address Graph cannot resolve comes back with an `error` (not counted in `resolved`), so a `resolved` count below `requested` flags a bad or inaccessible address rather than reading it as free.
69
+
47
70
  ## Reading contacts
48
71
 
49
72
  - `outlook-contacts-list` — top contacts, default top=50.
@@ -56,14 +79,16 @@ Subsequent tool calls use the persisted refresh token to mint access tokens tran
56
79
 
57
80
  | Error | Meaning | Operator action |
58
81
  |---|---|---|
59
- | `auth-required` | Account not registered, or refresh token expired | Run `outlook-account-register` |
82
+ | `auth-required` | Account not registered, or refresh token expired | Run `outlook-account-register`, then `outlook-account-register-poll` |
83
+ | `Calendars.ReadWrite scope not granted` | Mailbox last consented on the old read-only calendar scope | Re-run `outlook-account-register` + `outlook-account-register-poll` to re-consent with calendar write |
60
84
  | `Outlook token refresh failed` | Network down or refresh token invalidated | Verify connectivity; re-run register if persistent |
61
85
  | `Microsoft Graph does not support on-premises Exchange` | Mailbox is on hybrid Exchange | Use the `email` plugin (IMAP) |
86
+ | `Outlook send scope not granted (missing Mail.Send)` | Mailbox registered under the old read-only consent | Re-run `outlook-account-register` and consent to the send scopes |
62
87
  | `Outlook rate-limited without Retry-After hint` | Graph 429 with no backoff guidance | Retry later; if persistent, file a bug |
63
88
 
64
89
  ## Reference files
65
90
 
66
91
  Open each with the `plugin-read` tool (`file="references/auth.md"`), which resolves the path at the plugin root. A plain `Read` of `references/auth.md` against this skill's base directory misses, because these files live one level up at the plugin root, not under the skill.
67
92
 
68
- - [`references/auth.md`](references/auth.md) — Entra app registration + PKCE flow + re-vendor procedure
93
+ - [`references/auth.md`](references/auth.md) — vendor app model (one per brand) + device-code flow + public-client requirement
69
94
  - [`references/graph-surfaces.md`](references/graph-surfaces.md) — Graph endpoint and response shape per tool
@@ -169,7 +169,7 @@ lifelineTool(server, "whatsapp-config", [
169
169
  " - add-admin-phone (register a phone as a house admin — messages from it route to the house admin agent)",
170
170
  " - remove-admin-phone (demote to public routing)",
171
171
  " - list-admin-phones (show current admin phones)",
172
- " - add-account-manager (bind a phone to a sub-account — its messages route to that sub-account's admin agent; requires `phone` and `managesAccount`)",
172
+ " - add-account-manager (bind a phone to a sub-account — its messages route to that sub-account; requires `phone` and `managesAccount`. `mode` selects the behaviour: 'active' (default) spawns a full admin session that can reply and manage the sub-account; 'passive' spawns a constrained requirement-intake agent that files exactly one task per message and never replies)",
173
173
  " - remove-account-manager (clear a phone's account-manager binding; requires `phone`)",
174
174
  " - list-account-managers (show phone → sub-account bindings)",
175
175
  " - set-public-agent (set the top-level public-agent slug for non-admin DMs; requires `slug`)",
@@ -200,11 +200,12 @@ lifelineTool(server, "whatsapp-config", [
200
200
  "list-groups",
201
201
  ]).describe("The config action to perform"),
202
202
  phone: z.string().optional().describe("Phone number in E.164 format (required for add/remove admin phone and add/remove account manager)"),
203
- managesAccount: z.string().optional().describe("Sub-account UUID this phone should manage (required for add-account-manager). The sender's WhatsApp messages spawn an admin session scoped to that sub-account."),
203
+ managesAccount: z.string().optional().describe("Sub-account UUID this phone should manage (required for add-account-manager). The sender's WhatsApp messages spawn a session scoped to that sub-account."),
204
+ mode: z.enum(["active", "passive"]).optional().describe("Account-manager mode for add-account-manager (default 'active'). 'active' = a full admin session that can reply and manage the sub-account. 'passive' = a constrained requirement-intake agent: it interprets each message, files exactly one task scoped to the sub-account, and never replies."),
204
205
  slug: z.string().optional().describe("Agent slug (required for set-public-agent)"),
205
206
  fields: z.string().optional().describe('JSON string of config fields to update (required for update-config, e.g. \'{"dmPolicy":"open","allowFrom":["*"]}\')'),
206
207
  accountId: z.string().optional().describe('Account ID (default: "default"). Used by list-groups.'),
207
- }, async ({ action, phone, managesAccount, slug, fields, accountId }) => {
208
+ }, async ({ action, phone, managesAccount, mode, slug, fields, accountId }) => {
208
209
  try {
209
210
  // Parse fields JSON string for update-config
210
211
  let parsedFields;
@@ -216,7 +217,7 @@ lifelineTool(server, "whatsapp-config", [
216
217
  return textResult('Invalid JSON in "fields" parameter. Expected a JSON object, e.g. {"dmPolicy":"open","allowFrom":["*"]}', true);
217
218
  }
218
219
  }
219
- const result = await callApi("whatsapp-config", "/api/whatsapp/config", "POST", { action, phone, managesAccount, slug, fields: parsedFields, accountId });
220
+ const result = await callApi("whatsapp-config", "/api/whatsapp/config", "POST", { action, phone, managesAccount, mode, slug, fields: parsedFields, accountId });
220
221
  if (!result.ok)
221
222
  return textResult(result.error ?? "Config operation failed.", true);
222
223
  if (action === "list-admin-phones") {
@@ -230,7 +231,11 @@ lifelineTool(server, "whatsapp-config", [
230
231
  const entries = Object.entries(managers);
231
232
  if (entries.length === 0)
232
233
  return textResult("No account managers configured. Use add-account-manager to bind a phone to a sub-account.");
233
- return textResult(`Account managers:\n${entries.map(([p, sub]) => ` ${p} → ${sub}`).join("\n")}`);
234
+ return textResult(`Account managers:\n${entries.map(([p, v]) => {
235
+ const sub = typeof v === "string" ? v : v.managesAccount;
236
+ const mgrMode = typeof v === "string" ? "active" : (v.mode ?? "active");
237
+ return ` ${p} → ${sub}${mgrMode === "passive" ? " (passive)" : ""}`;
238
+ }).join("\n")}`);
234
239
  }
235
240
  if (action === "get-public-agent") {
236
241
  const agentSlug = result.slug;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,aAAa,CAAC,UAAU,CAAC,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,qEAAqE;AACrE,+DAA+D;AAC/D,uDAAuD;AACvD,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,uEAAuE;AACvE,sEAAsE;AACtE,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC,SAAS,UAAU,CAAC,QAAgB;IAClC,IAAI,aAAa,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,cAAc,CAAC,eAAe,EAAE,EAAE,GAAG,EAAE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GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3G,CAAC;AACH,CAAC,CACF,CAAC;AAEF,0EAA0E;AAE1E,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -102,11 +102,19 @@ The platform enforces this at multiple levels:
102
102
  |------|-----------|------|
103
103
  | **Self phone** | The WhatsApp account's own phone number (the phone that scanned the QR code). Self-chat only. | `phonesMatch(senderPhone, selfPhone)` in `access-control.ts` |
104
104
  | **Admin phones** | Phones listed in `adminPhones` in `account.json`. The user's personal phone is auto-registered on QR link; additional phones are added via `whatsapp-config action: "add-admin-phone"`. Their admin session is scoped to the **house** account. `adminPhones` is authoritative only on the account that owns the WhatsApp paired socket (the house): `add-admin-phone` is refused on any other account, and a list left on a non-socket (sub-)account is inert and purged at boot with `[admin-identity] op=purge-nonsocket-adminphone`. To answer "is this phone a manager?" read the house account's `adminPhones` + `accountManagers` only — never a sub-account's list. | `isAdminPhone()` in `access-control.ts` — iterates `adminPhones` |
105
- | **Account managers** | Phones in the `accountManagers` map (`account.json`, phone → sub-account UUID), added via `whatsapp-config action: "add-account-manager"`. Their admin session is scoped to the **bound sub-account**, not the house. Disjoint from `adminPhones` — a phone is a house admin or a sub-account manager, never both. | `managedAccountFor()` in `access-control.ts` resolves the sub-account **once**; `checkDmAccess` returns it as `effectiveAccountId`, and `ensureChannelSession` consumes that value without re-resolving |
105
+ | **Account managers** | Phones in the `accountManagers` map (`account.json`, phone → sub-account binding), added via `whatsapp-config action: "add-account-manager"`. Scoped to the **bound sub-account**, not the house. Disjoint from `adminPhones` — a phone is a house admin or a sub-account manager, never both. Each binding has a **mode**: `active` (default) is a full admin session that can reply and manage the sub-account; `passive` is a constrained requirement-intake spawn (only `work-create`, no reply). | `managedAccountFor()` in `access-control.ts` resolves the sub-account + mode **once**; `checkDmAccess` returns `effectiveAccountId` + `passive`, and `ensureChannelSession` consumes them without re-resolving |
106
106
  | **Public/unknown** | Any phone that is not self, not in `adminPhones`, and not in `accountManagers`. Subject to DM policy gating. | Everything else in `checkDmAccess()` |
107
107
 
108
108
  **Critical distinction:** The *self phone* is the paired device's number (the WhatsApp account Maxy controls). The *admin phone* is the user's personal phone (the phone they message *from*). These are typically different numbers. If the user's personal phone is not in `adminPhones` or `accountManagers`, their messages route as public — not admin.
109
109
 
110
+ **Passive (requirement-intake) account managers.** Bind a phone as passive to turn its WhatsApp messages into tasks for a sub-account without giving it an interactive agent:
111
+
112
+ ```
113
+ whatsapp-config action: "add-account-manager" phone: "+441234567890" managesAccount: "<sub-account-uuid>" mode: "passive"
114
+ ```
115
+
116
+ A passive-bound phone that DMs a requirement gets exactly one `:Task` filed under the sub-account, and nothing back. The spawn is a fresh, dedicated one-shot process confined by construction: its only tool is `work-create`, no WhatsApp reply server is attached, and it holds no house authority. The sender receives no acknowledgement — the person who set up the intake follows up with them separately. Omit `mode` (or pass `mode: "active"`) for the default full-admin manager, which is unchanged. `list-account-managers` tags passive bindings with `(passive)`. The lockdown is verifiable from the journal: `[wa-passive] op=spawn … replyServer=false tools=[mcp__plugin_work_work__work-create]`.
117
+
110
118
  **Account-manager scoping — the two-account split.** A designated manager's inbound spawns an admin session scoped to their sub-account (its graph, skills, and `${USER_ID}` attribution). Replies and file delivery still go out over the **house's** paired WhatsApp device — the only WhatsApp socket — so the sub-account scope never redirects the transport. The connection (house) account is kept for `startNativeFileFollower` and the reply path. A stale binding (a phone wrongly also on `adminPhones`) is surfaced at boot by `account-manager-drift` and never silently mis-routes.
111
119
 
112
120
  **No per-recipient deliverability restriction.** The single paired line can deliver to any number regardless of which account owns the socket. Sub-account scope (from account-manager binding) decides which session runs the turn — its cwd, graph, and tools — and never which numbers a message can reach. To reach an account manager proactively or on a schedule, a scheduled dispatch (`agentDispatch`) accepts the manager as a valid `destination` and delivers over this same house line; there is no "point the line at the sub-account" step, because socket ownership does not gate the recipient.
@@ -10,6 +10,7 @@ PASS=0; FAIL=0; FAILED=()
10
10
  role_of() { python3 -c "import json,sys; print(json.load(open(sys.argv[1])).get('role',''))" "$1"; }
11
11
  ms_of() { python3 -c "import json,sys; print(json.load(open(sys.argv[1])).get('managedService'))" "$1"; }
12
12
  assert_eq() { if [ "$1" = "$2" ]; then PASS=$((PASS+1)); else FAIL=$((FAIL+1)); FAILED+=("$3: expected [$2] got [$1]"); fi; }
13
+ assert_nonempty() { if [ -s "$1" ]; then PASS=$((PASS+1)); else FAIL=$((FAIL+1)); FAILED+=("$2: expected non-empty file [$1]"); fi; }
13
14
 
14
15
  . "$PLAT_SCRIPTS/lib/provision-account-dir.sh"
15
16
  export TEMPLATES_DIR PROJECT_DIR
@@ -21,6 +22,8 @@ T1=$(mktemp -d); A1="$T1/acct-house"
21
22
  provision_account_dir "$A1" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" "house" >/dev/null 2>&1
22
23
  assert_eq "$(role_of "$A1/account.json")" "house" "fresh-house-role"
23
24
  assert_eq "$(ms_of "$A1/account.json")" "False" "fresh-managedService-default"
25
+ # Task 1483 — the WhatsApp passive requirement-intake identity is seeded, non-empty.
26
+ assert_nonempty "$A1/agents/passive/IDENTITY.md" "passive-identity-seeded"
24
27
  rm -rf "$T1"
25
28
 
26
29
  # Legacy account.json with NO role -> migrated to house