@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,7 +1,7 @@
1
1
  ---
2
2
  name: platform-architecture
3
3
  description: Use when grounding any documented-surface claim about what Maxy ships — plugins, skills, specialists, install/deploy flows, internals. This is the install catalogue, not evidence of what is enabled on the current account. For install state on this account, call `capabilities-here`; for documented surface, cite the `Source:` URL inline.
4
- content-hash: sha256:9b227cf8ab845f23cb1899d5b2ac2581cfac3aae772715bf02d288ee93d8fbc4
4
+ content-hash: sha256:055029b708dab719a426f768edcdd3de24d7aafc49219af6f8978495f4f50fe2
5
5
  brand: maxy-code
6
6
  product-name: Maxy
7
7
  ---
@@ -1493,6 +1493,8 @@ Maxy will confirm and store it.
1493
1493
 
1494
1494
  Maxy also learns how you work without you having to teach it deliberately. Six broad areas cover the way most operators run a business — communication, scheduling, decisions, workflow, content, and interaction. Inside each area sits a small set of concrete fields (Maxy tracks around 28 in total) such as your preferred channel, quiet hours, workday start time, risk tolerance, content tonality, or address form. Maxy tracks which of these specific fields you have spoken into and which are still empty. While any are empty, it folds one organic question per turn into the conversation aimed at the next gap — never a list, never a form, never the same question twice. If you tell Maxy a field doesn't apply to you ("I work weekends, weekend availability isn't a thing for me"), it marks that field as covered and never re-asks. Once every field is either set or marked not-applicable, the proactive questions stop and Maxy answers what you ask without volunteering more. This is why session 300 should feel sharper than session 3: the longer you work together, the less Maxy needs to ask.
1495
1495
 
1496
+ The standing rules you give it over a channel are held the same way, and two things keep them working. When you restate a rule in different words, Maxy recognises it as the same rule and updates the one you already set instead of keeping two; a correction wins over the older version rather than sitting next to it. And on every channel message the rules that are currently in force are put back in front of Maxy automatically, so a rule you set last week is applied this week without you repeating it, even after a long conversation. You do not have to re-teach a rule you have already given.
1497
+
1496
1498
  ## Telling Maxy to Forget Something
1497
1499
 
1498
1500
  Be direct:
@@ -1943,26 +1945,35 @@ Source: https://docs.getmaxy.com/outlook-guide.md
1943
1945
 
1944
1946
  # Outlook Plugin — Operator Guide
1945
1947
 
1946
- The `outlook` plugin gives the admin agent read-only access to Microsoft 365 / Outlook.com via Microsoft Graph. Per-account OAuth (Auth Code + PKCE), encrypted token storage, automatic refresh.
1948
+ The `outlook` plugin gives the admin agent access to Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read, draft, and send; contacts are read-only; the calendar is read plus control (create, update, cancel, respond, free/busy). Per-account OAuth (device-code flow), encrypted token storage, automatic refresh.
1947
1949
 
1948
1950
  ## Quickstart
1949
1951
 
1950
- 1. **Register an Entra app once per Maxy install** — see `platform/plugins/outlook/references/auth.md` for full steps. Set `OUTLOOK_CLIENT_ID` (and `OUTLOOK_TENANT_ID`, default `common`) in the operator's environment.
1951
- 2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which prints an authorization URL.
1952
- 3. **Open the URL in the VNC browser** sign in to your Microsoft account, consent to the requested scopes (`offline_access`, `User.Read`, `Mail.Read`, `Calendars.Read`, `Contacts.Read`).
1952
+ 1. **No app to register.** The client ID ships with the brand (`brand.json#outlookClientId`), and the installer stamps it onto the session-manager env, so there is zero operator Azure work. On a brand that ships an empty value the plugin stays inert until its vendor app exists — see `platform/plugins/outlook/references/auth.md` for the one-time-per-brand vendor provisioning runbook (a vendor step, not an operator or end-user step), including setting **Allow public client flows** to Yes.
1953
+ 2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which returns a short user code and the URL `microsoft.com/devicelogin` and relays both to you.
1954
+ 3. **Consent on any device** open `microsoft.com/devicelogin` on your phone or laptop, enter the code, sign in to your Microsoft account, and consent 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. The agent finishes by calling `outlook-account-register-poll`.
1953
1955
  4. **Done.** Subsequent tool calls (mail, calendar, contacts) use the persisted refresh token transparently.
1954
1956
 
1955
1957
  ## Tools
1956
1958
 
1957
1959
  | Tool | Purpose |
1958
1960
  |------|---------|
1959
- | `outlook-account-register` | Run the PKCE flow for this account. One-time per account; re-run if tokens expire (90 days) or consent is revoked. |
1961
+ | `outlook-account-register` | Start the device-code flow for this account. Returns a user code + `microsoft.com/devicelogin` URL immediately; does not block. |
1962
+ | `outlook-account-register-poll` | Finish the device-code flow. One check per call: returns pending, registered, expired, or denied. |
1960
1963
  | `outlook-mail-list` | Recent mail. Default top=25, folder=Inbox. |
1961
1964
  | `outlook-mail-search` | Microsoft Graph `$search` over the mailbox. |
1962
1965
  | `outlook-calendar-list` | Calendar events in next rangeDays days (default 7, max 365). |
1963
1966
  | `outlook-calendar-event` | Full detail of a single event by id. |
1967
+ | `outlook-calendar-create` | Book an event. Needs subject, start, end; optional body, attendees, location, isOnlineMeeting, recurrence. |
1968
+ | `outlook-calendar-update` | Reschedule or edit an event. Pass eventId plus the fields to change. |
1969
+ | `outlook-calendar-cancel` | Cancel a meeting (notifies attendees when the account organises it) or delete a personal appointment. Mode chosen automatically. |
1970
+ | `outlook-calendar-respond` | Accept, decline, or tentatively accept an invite. |
1971
+ | `outlook-calendar-freebusy` | Availability for one or more addresses over a window. |
1964
1972
  | `outlook-contacts-list` | Top contacts. Default top=50. |
1965
1973
  | `outlook-mailbox-info` | Health probe — auth state, refresh-window, folder count. |
1974
+ | `outlook-mail-send` | Send a message (`POST /me/sendMail`). to/cc/bcc arrays, subject, body, isHtml. Success asserted on Graph 202. Needs `Mail.Send`. |
1975
+ | `outlook-draft` | Create a draft in Drafts (`POST /me/messages`). Same body model. Returns the draft id. Needs `Mail.ReadWrite`. |
1976
+ | `outlook-draft-send` | Send an existing draft by id (`POST /me/messages/{id}/send`). Graph consumes the draft, returns 202. Needs `Mail.Send`. |
1966
1977
 
1967
1978
  ## Observability
1968
1979
 
@@ -1970,8 +1981,13 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
1970
1981
 
1971
1982
  | Event | Line shape |
1972
1983
  |-------|------------|
1973
- | Auth init | `auth-init account=<id> codeChallenge=<sha256-prefix-8> redirectPath=<callback-path>` |
1974
- | Auth callback | `auth-callback account=<id> elapsedMs=<N>` |
1984
+ | Device code issued | `devicecode-issued account=<id> userCode=<code> verificationUri=<url> expiresSec=<N> intervalSec=<N>` |
1985
+ | Poll (still pending) | `devicecode-poll account=<id> status=pending elapsedSec=<N>` |
1986
+ | Device code expired | `devicecode-expired account=<id> elapsedSec=<N>` (terminal) |
1987
+ | Consent denied | `devicecode-denied account=<id> elapsedSec=<N>` (terminal) |
1988
+ | Pending-store census | `pending-store-census account=<id> live=<N>` |
1989
+ | Pending cleared | `pending-cleared account=<id> verified=<bool>` |
1990
+ | /me failed post-token | `me-failed account=<id> status=<N>` |
1975
1991
  | Auth ok | `auth-ok account=<id> graphUserId=<id> scopes=<csv> tokenExpSec=<N>` |
1976
1992
  | Token refreshed | `token-refreshed account=<id> oldExpSec=<N> newExpSec=<N>` |
1977
1993
  | Refresh failed | `token-refresh-failed account=<id> reason=<err>` (terminal) |
@@ -1979,10 +1995,27 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
1979
1995
  | Mail search | `mail-search account=<id> query=<trunc-32> count=<N> elapsedMs=<N>` |
1980
1996
  | Calendar list | `calendar-list account=<id> rangeDays=<N> count=<N> elapsedMs=<N>` |
1981
1997
  | Calendar event | `calendar-event account=<id> eventId=<trunc-12> elapsedMs=<N>` |
1998
+ | Event created | `cal-create-request account=<id> subj=<trunc-64>` then `event-created account=<id> eventId=<trunc-16> status=201`. A non-201 logs `event-create-failed ... status=<N>` and throws. A 201 whose body carried no readable id logs `event-created-id-unknown account=<id> status=201` and returns a created-but-id-unknown result (the event exists; do not retry) rather than a failure. |
1999
+ | Event updated | `cal-update-request account=<id> eventId=<trunc-16>` then `event-updated ... status=200` |
2000
+ | Event cancelled | `cal-cancel-request account=<id> eventId=<trunc-16> mode=<cancel-or-delete>` then `event-cancelled ... status=<N>` |
2001
+ | Event responded | `cal-respond-request account=<id> eventId=<trunc-16> action=<a>` then `event-responded ... status=202` |
2002
+ | Free/busy | `freebusy-request account=<id> requested=<N>` then `freebusy-result account=<id> requested=<N> resolved=<N>` (resolved counts error-free entries; resolved<requested flags a failed address) |
2003
+ | Scope insufficient | `scope-insufficient tool=<t> account=<id> missing=Calendars.ReadWrite` (stale read-only consent) |
1982
2004
  | Contacts list | `contacts-list account=<id> count=<N> elapsedMs=<N>` |
1983
2005
  | Mailbox info | `mailbox-info account=<id> tokenWithinRefreshWindow=<bool> folderCount=<N>` |
1984
- | Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` |
2006
+ | Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` — writes flow through the same `callGraph` loop, so a failed write logs `graph-error` too |
1985
2007
  | On-prem rejected | `on-prem-rejected account=<id> mailServer=<host>` (terminal) |
2008
+ | Scope insufficient | `scope-insufficient account=<id> tool=<t> missing=Mail.Send` (terminal — re-register to grant send) |
2009
+ | Send request | `send-request account=<id> to=<N> subjLen=<N>` |
2010
+ | Send args | `send-args account=<id> recipients=<N> hasBody=<bool>` |
2011
+ | Sent | `sent account=<id> status=202 messageId=<id-or-null>` |
2012
+ | Send failed | `send-failed account=<id> error=<msg>` |
2013
+ | Draft request | `draft-request account=<id>` |
2014
+ | Draft created | `draft-created account=<id> id=<draftId>` |
2015
+ | Draft failed | `draft-failed account=<id> error=<msg>` |
2016
+ | Draft-send request | `draft-send-request account=<id> id=<draftId>` |
2017
+ | Draft sent | `draft-sent account=<id> id=<draftId> status=202` |
2018
+ | Draft-send failed | `draft-send-failed account=<id> id=<draftId> error=<msg>` |
1986
2019
 
1987
2020
  ## Diagnostic paths
1988
2021
 
@@ -2006,10 +2039,12 @@ Latency triage: `mail-list count=0 elapsedMs<200` consistent → permissions iss
2006
2039
  | `Outlook auth expired for account=X; run outlook-account-register` | Refresh-then-retry still got 401 | Re-register |
2007
2040
  | `Outlook rate-limited without Retry-After hint` | Graph 429 with no backoff guidance | Wait + retry; if persistent, file bug |
2008
2041
  | `Microsoft Graph does not support on-premises Exchange. Use earlier platform fixes (IMAP).` | Mailbox is on hybrid Exchange | Use the `email` plugin |
2042
+ | `Outlook Calendars.ReadWrite scope not granted ...; Re-run outlook-account-register ...` | Mailbox last consented on the old read-only calendar scope | Re-register to grant calendar write |
2043
+ | `Outlook Mail.Send scope not granted ...; Re-run outlook-account-register to grant send.` | Mailbox registered under the old read-only consent | Re-run `outlook-account-register` and consent to the send scopes |
2009
2044
 
2010
2045
  ## Out of scope
2011
2046
 
2012
- Write tools (send, draft, move, flag), OneDrive / Files, push notifications, on-premises Exchange, M365 admin scopes (`User.Read.All`, `AuditLog.Read.All`), public-agent exposure, multi-tenant federation. See `platform/plugins/outlook/PLUGIN.md` for the full out-of-scope list.
2047
+ Mail move / flag / delete, contacts write, recurring-series occurrence editing, the `scheduling` Neo4j calendar and any auto-sync with it, OneDrive / Files, push notifications, on-premises Exchange, M365 admin scopes (`User.Read.All`, `AuditLog.Read.All`), public-agent exposure, multi-tenant federation. Mail send and draft are supported (`outlook-mail-send`, `outlook-draft`, `outlook-draft-send`), and the calendar is read plus control. See `platform/plugins/outlook/PLUGIN.md` for the full out-of-scope list.
2013
2048
 
2014
2049
  ---
2015
2050
  # QuickBooks Online
@@ -3752,6 +3787,16 @@ to a `<previous-context>` block, and threads it through the public spawn body so
3752
3787
  appends it to the agent's system prompt. Only the visitor's own slice is read; open-mode
3753
3788
  visitors, admins, and first visits inject nothing.
3754
3789
 
3790
+ ### Standing-rules reconciliation and per-turn injection
3791
+
3792
+ Standing rules the operator gives over a channel are `Preference` nodes. Two mechanisms keep them effective across a long-lived session that auto-compacts.
3793
+
3794
+ **Reconcile by meaning on write (`profile-update`).** The existence check is two-tier. First an exact `(category, key)` match — the classic fast path, unchanged. When that misses, a semantic-neighbour lookup runs over the `preference_embedding` vector index, scoped to the same `accountId` and `scope:'admin'`, non-trashed. If the nearest neighbour is at or above `SAME_SUBJECT_COSINE` (0.85), the write lands on that node through the existing reinforce/update/contradict curve instead of minting a duplicate; the matched neighbours are returned in the tool result so the agent can classify future writes against real prior state. The confidence constants are unchanged — only the join key widens, so a rephrasing under a new `key` no longer forks the rule and a correction demotes the prior node rather than adding a contradictory one.
3795
+
3796
+ **Inject the active rule-set every turn (channel gateways).** The one definition of "this account's active rules" is `@maxy/active-rules`: a bounded, floor-filtered (`confidence >= 0.4`), confidence-ordered candidate query, then semantic de-confliction (one winner per subject at the same 0.85 cosine), capped to `INJECTION_RULE_CAP` (12). `profile-read` exposes this set as `activeRules`, and the three inbound gateways (`wa-gateway`, `telegram-gateway`, `webchat-gateway`) fetch it for the effective session account and attach it as `standingRules` on the inbound frame; the channel builders prepend it as a `## Standing rules` block above `## Context`. The read is by code, not agent discretion, so a rule set last week is applied this week regardless of how many times the session compacted. Telegram and webchat inject for `role:'admin'` only — a public visitor never receives operator rules.
3797
+
3798
+ **Observability.** `[preference-write] op=reconcile … mode=<reinforce|update|contradict|new> similarity=…` — a stream of `mode=new` for subjects that already exist is the duplicate-minting signature. `[preference-inject] op=inject channel=<wa|tg|web> injected=<N>` — `injected=0` on an account with stored rules is the write-only regression re-appearing. `[preference-audit] op=drift accountId=… storedActive=… injectedActive=… duplicateClusters=…` — the standing reconciliation audit (claude-session-manager, 5-minute tick) flags any account whose store holds more active rows than injection would surface, the no-event detector for drift.
3799
+
3755
3800
  ---
3756
3801
 
3757
3802
  ## Output Formatting and Budget
@@ -394,6 +394,16 @@ to a `<previous-context>` block, and threads it through the public spawn body so
394
394
  appends it to the agent's system prompt. Only the visitor's own slice is read; open-mode
395
395
  visitors, admins, and first visits inject nothing.
396
396
 
397
+ ### Standing-rules reconciliation and per-turn injection
398
+
399
+ Standing rules the operator gives over a channel are `Preference` nodes. Two mechanisms keep them effective across a long-lived session that auto-compacts.
400
+
401
+ **Reconcile by meaning on write (`profile-update`).** The existence check is two-tier. First an exact `(category, key)` match — the classic fast path, unchanged. When that misses, a semantic-neighbour lookup runs over the `preference_embedding` vector index, scoped to the same `accountId` and `scope:'admin'`, non-trashed. If the nearest neighbour is at or above `SAME_SUBJECT_COSINE` (0.85), the write lands on that node through the existing reinforce/update/contradict curve instead of minting a duplicate; the matched neighbours are returned in the tool result so the agent can classify future writes against real prior state. The confidence constants are unchanged — only the join key widens, so a rephrasing under a new `key` no longer forks the rule and a correction demotes the prior node rather than adding a contradictory one.
402
+
403
+ **Inject the active rule-set every turn (channel gateways).** The one definition of "this account's active rules" is `@maxy/active-rules`: a bounded, floor-filtered (`confidence >= 0.4`), confidence-ordered candidate query, then semantic de-confliction (one winner per subject at the same 0.85 cosine), capped to `INJECTION_RULE_CAP` (12). `profile-read` exposes this set as `activeRules`, and the three inbound gateways (`wa-gateway`, `telegram-gateway`, `webchat-gateway`) fetch it for the effective session account and attach it as `standingRules` on the inbound frame; the channel builders prepend it as a `## Standing rules` block above `## Context`. The read is by code, not agent discretion, so a rule set last week is applied this week regardless of how many times the session compacted. Telegram and webchat inject for `role:'admin'` only — a public visitor never receives operator rules.
404
+
405
+ **Observability.** `[preference-write] op=reconcile … mode=<reinforce|update|contradict|new> similarity=…` — a stream of `mode=new` for subjects that already exist is the duplicate-minting signature. `[preference-inject] op=inject channel=<wa|tg|web> injected=<N>` — `injected=0` on an account with stored rules is the write-only regression re-appearing. `[preference-audit] op=drift accountId=… storedActive=… injectedActive=… duplicateClusters=…` — the standing reconciliation audit (claude-session-manager, 5-minute tick) flags any account whose store holds more active rows than injection would surface, the no-event detector for drift.
406
+
397
407
  ---
398
408
 
399
409
  ## Output Formatting and Budget
@@ -37,6 +37,8 @@ Just say it naturally:
37
37
 
38
38
  {{productName}} also learns how you work without you having to teach it deliberately. Six broad areas cover the way most operators run a business — communication, scheduling, decisions, workflow, content, and interaction. Inside each area sits a small set of concrete fields ({{productName}} tracks around 28 in total) such as your preferred channel, quiet hours, workday start time, risk tolerance, content tonality, or address form. {{productName}} tracks which of these specific fields you have spoken into and which are still empty. While any are empty, it folds one organic question per turn into the conversation aimed at the next gap — never a list, never a form, never the same question twice. If you tell {{productName}} a field doesn't apply to you ("I work weekends, weekend availability isn't a thing for me"), it marks that field as covered and never re-asks. Once every field is either set or marked not-applicable, the proactive questions stop and {{productName}} answers what you ask without volunteering more. This is why session 300 should feel sharper than session 3: the longer you work together, the less {{productName}} needs to ask.
39
39
 
40
+ The standing rules you give it over a channel are held the same way, and two things keep them working. When you restate a rule in different words, {{productName}} recognises it as the same rule and updates the one you already set instead of keeping two; a correction wins over the older version rather than sitting next to it. And on every channel message the rules that are currently in force are put back in front of {{productName}} automatically, so a rule you set last week is applied this week without you repeating it, even after a long conversation. You do not have to re-teach a rule you have already given.
41
+
40
42
  ## Telling {{productName}} to Forget Something
41
43
 
42
44
  Be direct:
@@ -1,25 +1,34 @@
1
1
  # Outlook Plugin — Operator Guide
2
2
 
3
- The `outlook` plugin gives the admin agent read-only access to Microsoft 365 / Outlook.com via Microsoft Graph. Per-account OAuth (Auth Code + PKCE), encrypted token storage, automatic refresh.
3
+ The `outlook` plugin gives the admin agent access to Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read, draft, and send; contacts are read-only; the calendar is read plus control (create, update, cancel, respond, free/busy). Per-account OAuth (device-code flow), encrypted token storage, automatic refresh.
4
4
 
5
5
  ## Quickstart
6
6
 
7
- 1. **Register an Entra app once per Maxy install** — see `platform/plugins/outlook/references/auth.md` for full steps. Set `OUTLOOK_CLIENT_ID` (and `OUTLOOK_TENANT_ID`, default `common`) in the operator's environment.
8
- 2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which prints an authorization URL.
9
- 3. **Open the URL in the VNC browser** sign in to your Microsoft account, consent to the requested scopes (`offline_access`, `User.Read`, `Mail.Read`, `Calendars.Read`, `Contacts.Read`).
7
+ 1. **No app to register.** The client ID ships with the brand (`brand.json#outlookClientId`), and the installer stamps it onto the session-manager env, so there is zero operator Azure work. On a brand that ships an empty value the plugin stays inert until its vendor app exists — see `platform/plugins/outlook/references/auth.md` for the one-time-per-brand vendor provisioning runbook (a vendor step, not an operator or end-user step), including setting **Allow public client flows** to Yes.
8
+ 2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which returns a short user code and the URL `microsoft.com/devicelogin` and relays both to you.
9
+ 3. **Consent on any device** open `microsoft.com/devicelogin` on your phone or laptop, enter the code, sign in to your Microsoft account, and consent 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. The agent finishes by calling `outlook-account-register-poll`.
10
10
  4. **Done.** Subsequent tool calls (mail, calendar, contacts) use the persisted refresh token transparently.
11
11
 
12
12
  ## Tools
13
13
 
14
14
  | Tool | Purpose |
15
15
  |------|---------|
16
- | `outlook-account-register` | Run the PKCE flow for this account. One-time per account; re-run if tokens expire (90 days) or consent is revoked. |
16
+ | `outlook-account-register` | Start the device-code flow for this account. Returns a user code + `microsoft.com/devicelogin` URL immediately; does not block. |
17
+ | `outlook-account-register-poll` | Finish the device-code flow. One check per call: returns pending, registered, expired, or denied. |
17
18
  | `outlook-mail-list` | Recent mail. Default top=25, folder=Inbox. |
18
19
  | `outlook-mail-search` | Microsoft Graph `$search` over the mailbox. |
19
20
  | `outlook-calendar-list` | Calendar events in next rangeDays days (default 7, max 365). |
20
21
  | `outlook-calendar-event` | Full detail of a single event by id. |
22
+ | `outlook-calendar-create` | Book an event. Needs subject, start, end; optional body, attendees, location, isOnlineMeeting, recurrence. |
23
+ | `outlook-calendar-update` | Reschedule or edit an event. Pass eventId plus the fields to change. |
24
+ | `outlook-calendar-cancel` | Cancel a meeting (notifies attendees when the account organises it) or delete a personal appointment. Mode chosen automatically. |
25
+ | `outlook-calendar-respond` | Accept, decline, or tentatively accept an invite. |
26
+ | `outlook-calendar-freebusy` | Availability for one or more addresses over a window. |
21
27
  | `outlook-contacts-list` | Top contacts. Default top=50. |
22
28
  | `outlook-mailbox-info` | Health probe — auth state, refresh-window, folder count. |
29
+ | `outlook-mail-send` | Send a message (`POST /me/sendMail`). to/cc/bcc arrays, subject, body, isHtml. Success asserted on Graph 202. Needs `Mail.Send`. |
30
+ | `outlook-draft` | Create a draft in Drafts (`POST /me/messages`). Same body model. Returns the draft id. Needs `Mail.ReadWrite`. |
31
+ | `outlook-draft-send` | Send an existing draft by id (`POST /me/messages/{id}/send`). Graph consumes the draft, returns 202. Needs `Mail.Send`. |
23
32
 
24
33
  ## Observability
25
34
 
@@ -27,8 +36,13 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
27
36
 
28
37
  | Event | Line shape |
29
38
  |-------|------------|
30
- | Auth init | `auth-init account=<id> codeChallenge=<sha256-prefix-8> redirectPath=<callback-path>` |
31
- | Auth callback | `auth-callback account=<id> elapsedMs=<N>` |
39
+ | Device code issued | `devicecode-issued account=<id> userCode=<code> verificationUri=<url> expiresSec=<N> intervalSec=<N>` |
40
+ | Poll (still pending) | `devicecode-poll account=<id> status=pending elapsedSec=<N>` |
41
+ | Device code expired | `devicecode-expired account=<id> elapsedSec=<N>` (terminal) |
42
+ | Consent denied | `devicecode-denied account=<id> elapsedSec=<N>` (terminal) |
43
+ | Pending-store census | `pending-store-census account=<id> live=<N>` |
44
+ | Pending cleared | `pending-cleared account=<id> verified=<bool>` |
45
+ | /me failed post-token | `me-failed account=<id> status=<N>` |
32
46
  | Auth ok | `auth-ok account=<id> graphUserId=<id> scopes=<csv> tokenExpSec=<N>` |
33
47
  | Token refreshed | `token-refreshed account=<id> oldExpSec=<N> newExpSec=<N>` |
34
48
  | Refresh failed | `token-refresh-failed account=<id> reason=<err>` (terminal) |
@@ -36,10 +50,27 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
36
50
  | Mail search | `mail-search account=<id> query=<trunc-32> count=<N> elapsedMs=<N>` |
37
51
  | Calendar list | `calendar-list account=<id> rangeDays=<N> count=<N> elapsedMs=<N>` |
38
52
  | Calendar event | `calendar-event account=<id> eventId=<trunc-12> elapsedMs=<N>` |
53
+ | Event created | `cal-create-request account=<id> subj=<trunc-64>` then `event-created account=<id> eventId=<trunc-16> status=201`. A non-201 logs `event-create-failed ... status=<N>` and throws. A 201 whose body carried no readable id logs `event-created-id-unknown account=<id> status=201` and returns a created-but-id-unknown result (the event exists; do not retry) rather than a failure. |
54
+ | Event updated | `cal-update-request account=<id> eventId=<trunc-16>` then `event-updated ... status=200` |
55
+ | Event cancelled | `cal-cancel-request account=<id> eventId=<trunc-16> mode=<cancel-or-delete>` then `event-cancelled ... status=<N>` |
56
+ | Event responded | `cal-respond-request account=<id> eventId=<trunc-16> action=<a>` then `event-responded ... status=202` |
57
+ | Free/busy | `freebusy-request account=<id> requested=<N>` then `freebusy-result account=<id> requested=<N> resolved=<N>` (resolved counts error-free entries; resolved<requested flags a failed address) |
58
+ | Scope insufficient | `scope-insufficient tool=<t> account=<id> missing=Calendars.ReadWrite` (stale read-only consent) |
39
59
  | Contacts list | `contacts-list account=<id> count=<N> elapsedMs=<N>` |
40
60
  | Mailbox info | `mailbox-info account=<id> tokenWithinRefreshWindow=<bool> folderCount=<N>` |
41
- | Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` |
61
+ | Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` — writes flow through the same `callGraph` loop, so a failed write logs `graph-error` too |
42
62
  | On-prem rejected | `on-prem-rejected account=<id> mailServer=<host>` (terminal) |
63
+ | Scope insufficient | `scope-insufficient account=<id> tool=<t> missing=Mail.Send` (terminal — re-register to grant send) |
64
+ | Send request | `send-request account=<id> to=<N> subjLen=<N>` |
65
+ | Send args | `send-args account=<id> recipients=<N> hasBody=<bool>` |
66
+ | Sent | `sent account=<id> status=202 messageId=<id-or-null>` |
67
+ | Send failed | `send-failed account=<id> error=<msg>` |
68
+ | Draft request | `draft-request account=<id>` |
69
+ | Draft created | `draft-created account=<id> id=<draftId>` |
70
+ | Draft failed | `draft-failed account=<id> error=<msg>` |
71
+ | Draft-send request | `draft-send-request account=<id> id=<draftId>` |
72
+ | Draft sent | `draft-sent account=<id> id=<draftId> status=202` |
73
+ | Draft-send failed | `draft-send-failed account=<id> id=<draftId> error=<msg>` |
43
74
 
44
75
  ## Diagnostic paths
45
76
 
@@ -63,7 +94,9 @@ Latency triage: `mail-list count=0 elapsedMs<200` consistent → permissions iss
63
94
  | `Outlook auth expired for account=X; run outlook-account-register` | Refresh-then-retry still got 401 | Re-register |
64
95
  | `Outlook rate-limited without Retry-After hint` | Graph 429 with no backoff guidance | Wait + retry; if persistent, file bug |
65
96
  | `Microsoft Graph does not support on-premises Exchange. Use earlier platform fixes (IMAP).` | Mailbox is on hybrid Exchange | Use the `email` plugin |
97
+ | `Outlook Calendars.ReadWrite scope not granted ...; Re-run outlook-account-register ...` | Mailbox last consented on the old read-only calendar scope | Re-register to grant calendar write |
98
+ | `Outlook Mail.Send scope not granted ...; Re-run outlook-account-register to grant send.` | Mailbox registered under the old read-only consent | Re-run `outlook-account-register` and consent to the send scopes |
66
99
 
67
100
  ## Out of scope
68
101
 
69
- Write tools (send, draft, move, flag), OneDrive / Files, push notifications, on-premises Exchange, M365 admin scopes (`User.Read.All`, `AuditLog.Read.All`), public-agent exposure, multi-tenant federation. See `platform/plugins/outlook/PLUGIN.md` for the full out-of-scope list.
102
+ Mail move / flag / delete, contacts write, recurring-series occurrence editing, the `scheduling` Neo4j calendar and any auto-sync with it, OneDrive / Files, push notifications, on-premises Exchange, M365 admin scopes (`User.Read.All`, `AuditLog.Read.All`), public-agent exposure, multi-tenant federation. Mail send and draft are supported (`outlook-mail-send`, `outlook-draft`, `outlook-draft-send`), and the calendar is read plus control. See `platform/plugins/outlook/PLUGIN.md` for the full out-of-scope list.
@@ -43,7 +43,7 @@ Microsoft mail does not go through the email plugin. Microsoft retired Basic aut
43
43
 
44
44
  `email-provider-info` recognises both — the static consumer domains, and a custom M365 domain via MX detection — and returns the **redirect** outcome rather than IMAP hosts. `email-setup` likewise refuses a Microsoft address (even if you hand it `outlook.office365.com` hosts) and points back here; it never attempts a connection.
45
45
 
46
- Connect the account through the **`outlook` Graph plugin** instead: run `outlook-account-register`. That plugin authorises over OAuth — it opens a Microsoft sign-in for the operator (in the headless browser) and stores the token; there is no password or app password to ask for. After registration, Microsoft mail is read with the `outlook-mail-list` / `outlook-mail-search` tools, not `email-read` / `email-search`.
46
+ Connect the account through the **`outlook` Graph plugin** instead: run `outlook-account-register`. That plugin authorises over OAuth — it opens a Microsoft sign-in for the operator (in the headless browser) and stores the token; there is no password or app password to ask for, and there is no Azure app to register — the vendor client ID ships with the brand. After registration, Microsoft mail is read with the `outlook-mail-list` / `outlook-mail-search` tools, not `email-read` / `email-search`. Sending and drafting are available too, over Microsoft Graph rather than SMTP: `outlook-mail-send`, `outlook-draft`, and `outlook-draft-send` (not `email-send` / `email-draft`). A mailbox registered before send existed re-registers once to grant the send scopes. (If a brand ships no vendor Outlook app yet, `outlook-account-register` reports the client ID is not configured and Microsoft mail cannot be connected on that brand.)
47
47
 
48
48
  ## Multiple Mailboxes
49
49
 
@@ -47,7 +47,7 @@ Omit `targetAccountId`. Every tool takes a `path` relative to your account direc
47
47
 
48
48
  ## Cross-account (house admin only)
49
49
 
50
- Pass `targetAccountId` to operate on a sub-account's directory. This is honoured only for a house-scoped admin session. A sub-account, specialist, or public session that passes `targetAccountId` is refused with `cross-account-denied`; an unknown account id is refused with `cross-account-invalid-target`. Use this to inspect or repair a client account's files from the house session without switching accounts.
50
+ Pass `targetAccountId` to operate on a sub-account's directory. This is honoured only for a house-scoped admin session. A sub-account, specialist, or public session that passes `targetAccountId` is refused with `cross-account-denied`; an account id that is not provisioned on disk is refused with `cross-account-target-not-provisioned`. The validity check re-scans the accounts dir on a miss, so a sub-account created at runtime this session resolves without a service restart (a stale boot-time cache no longer masks it). Use this to inspect or repair a client account's files from the house session without switching accounts.
51
51
 
52
52
  ## Boundaries
53
53
 
@@ -38,9 +38,23 @@ describe("resolveRoot — fail-closed gate", () => {
38
38
  const r = resolveRoot(clientCtx(), HOUSE, "file-read");
39
39
  expect(r).toEqual({ reject: "cross-account-denied" });
40
40
  });
41
- it("house scope + unknown target → cross-account-invalid-target", () => {
41
+ it("house scope + unknown target → cross-account-target-not-provisioned", () => {
42
42
  const r = resolveRoot(houseCtx(), GHOST, "file-read");
43
- expect(r).toEqual({ reject: "cross-account-invalid-target" });
43
+ expect(r).toEqual({ reject: "cross-account-target-not-provisioned" });
44
+ });
45
+ it("house scope + target created after the cache warmed → resolves via re-scan (Task 1471)", () => {
46
+ // Warm the enumeration cache for this accountsDir (GHOST absent at "boot").
47
+ expect(resolveRoot(houseCtx(), GHOST, "file-read")).toEqual({
48
+ reject: "cross-account-target-not-provisioned",
49
+ });
50
+ // Provision GHOST at runtime, after the boot snapshot.
51
+ mkdirSync(join(accountsDir, GHOST), { recursive: true });
52
+ writeFileSync(join(accountsDir, GHOST, "account.json"), JSON.stringify({ accountId: GHOST }));
53
+ // The miss re-scans disk and now resolves — no restart.
54
+ expect(resolveRoot(houseCtx(), GHOST, "file-read")).toEqual({
55
+ root: resolve(accountsDir, GHOST),
56
+ resolved: GHOST,
57
+ });
44
58
  });
45
59
  it("house scope + target == own → own root (self allowed)", () => {
46
60
  const r = resolveRoot(houseCtx(), HOUSE, "file-read");
@@ -1 +1 @@
1
- {"version":3,"file":"scope.test.js","sourceRoot":"","sources":["../../../src/lib/__tests__/scope.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,oBAAoB,EAAY,MAAM,aAAa,CAAC;AAEzF,wEAAwE;AACxE,gDAAgD;AAChD,MAAM,KAAK,GAAG,sCAAsC,CAAC;AACrD,MAAM,MAAM,GAAG,sCAAsC,CAAC;AACtD,MAAM,KAAK,GAAG,sCAAsC,CAAC;AAErD,IAAI,WAAmB,CAAC;AACxB,IAAI,UAAkB,CAAC;AAEvB,UAAU,CAAC,GAAG,EAAE;IACd,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC7D,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC3D,KAAK,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE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K,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,MAAM,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACzC,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -25,7 +25,7 @@ export type ResolveRootResult = {
25
25
  root: string;
26
26
  resolved: string;
27
27
  } | {
28
- reject: "cross-account-denied" | "cross-account-invalid-target";
28
+ reject: "cross-account-denied" | "cross-account-invalid-target" | "cross-account-target-not-provisioned";
29
29
  };
30
30
  /**
31
31
  * Resolve the account directory a tool call acts on, gated fail-closed. Emits
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED,MAAM,WAAW,GAAG;IAClB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,sBAAsB,GAAG,8BAA8B,CAAA;CAAE,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,MAAM,GACX,iBAAiB,CAqBnB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAenE"}
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED,MAAM,WAAW,GAAG;IAClB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClC;IACE,MAAM,EACF,sBAAsB,GACtB,8BAA8B,GAC9B,sCAAsC,CAAC;CAC5C,CAAC;AAEN;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,MAAM,GACX,iBAAiB,CA2BnB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAenE"}
@@ -15,7 +15,7 @@
15
15
  import { resolve, dirname, sep } from "node:path";
16
16
  import { realpathSync, existsSync } from "node:fs";
17
17
  import { resolveEffectiveAccountCore } from "../../../../../lib/account-scope/dist/index.js";
18
- import { enumerateValidAccountIds } from "../../../../../lib/account-enumeration/dist/index.js";
18
+ import { isProvisionedAccount } from "../../../../../lib/account-enumeration/dist/index.js";
19
19
  const short = (id) => id.slice(0, 8);
20
20
  /**
21
21
  * Read HOUSE_ADMIN_SCOPE for the plugin, fail-closed. HOUSE_ADMIN_SCOPE is the
@@ -46,8 +46,13 @@ export function readPluginHouseScope(env) {
46
46
  * must contain every path within.
47
47
  */
48
48
  export function resolveRoot(ctx, targetAccountId, tool) {
49
- const isValidAccountId = (id) => enumerateValidAccountIds(ctx.accountsDir).includes(id);
50
- const eff = resolveEffectiveAccountCore({ ownAccountId: ctx.ownAccountId, houseScope: ctx.houseScope, targetAccountId }, isValidAccountId);
49
+ // Re-scan-on-miss (Task 1471): a sub-account created at runtime after this
50
+ // plugin process booted is absent from the boot-time cached set; the miss
51
+ // re-scans disk once so a live-created target resolves without a restart. A
52
+ // reject therefore means the target is genuinely not on disk — surfaced as
53
+ // the distinct `cross-account-target-not-provisioned` reason.
54
+ const isValidAccountId = (id) => isProvisionedAccount(ctx.accountsDir, id);
55
+ const eff = resolveEffectiveAccountCore({ ownAccountId: ctx.ownAccountId, houseScope: ctx.houseScope, targetAccountId }, isValidAccountId, "cross-account-target-not-provisioned");
51
56
  const targetField = targetAccountId ? short(targetAccountId) : "self";
52
57
  const houseField = ctx.houseScope ? "true" : "false";
53
58
  if ("reject" in eff) {
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,mDAAmD;AACnD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,yEAAyE;AACzE,8EAA8E;AAC9E,2CAA2C;AAC3C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAEhG,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAsB;IACzD,MAAM,GAAG,GAAG,GAAG,CAAC,iBAAiB,CAAC;IAClC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,GAAG,CAAC;AACb,CAAC;AAeD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,GAAQ,EACR,eAAmC,EACnC,IAAY;IAEZ,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAE,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,CAAC,QAAQ,CAAC;QAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,YAAY,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;QAAE,MAAM,EAAE,CAAC;IACpF,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -72,10 +72,10 @@ describe("file handlers — cross-account gate", () => {
72
72
  // and it did not read the house file
73
73
  expect(text(r)).not.toContain("accountId");
74
74
  });
75
- it("an unknown target is invalid-target", () => {
75
+ it("an unknown target is target-not-provisioned", () => {
76
76
  const r = fileList({ targetAccountId: "99999999-9999-4999-8999-999999999999" }, house());
77
77
  expect(r.isError).toBe(true);
78
- expect(text(r)).toContain("cross-account-invalid-target");
78
+ expect(text(r)).toContain("cross-account-target-not-provisioned");
79
79
  });
80
80
  });
81
81
  describe("file handlers — traversal guard", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"handlers.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/handlers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,C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CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -187,7 +187,7 @@ Writes targeting `:Person`, `:UserProfile`, `:AdminUser`, `:Organization`, `:Loc
187
187
 
188
188
  ## Cross-account access (house admin) — `targetAccountId`
189
189
 
190
- The memory tools whose Neo4j read/write re-scopes on the resolved account accept an optional `targetAccountId`. A house-scoped `role:admin` session sets it to read or write a **sub-account's** subgraph instead of its own; omitting it is byte-identical to the pre-existing own-account behaviour. Only a house-scoped session may set it: a sub-account or public session that passes `targetAccountId` is rejected `cross-account-denied`, and a house session naming an account that does not exist on this install is rejected `cross-account-invalid-target`. Resolution runs through the shared `resolveEffectiveAccount` primitive — there is no house fallback and no local re-implementation. Each call that sets `targetAccountId` emits one `[xacct] op=call tool=<t> caller=<own8> target=<tgt8> houseScope=<bool> decision=<allow|deny> reason=<…>` line before the graph call, and the tool's own `[memory-<t>] [<accountId>]` line prints the resolved (target) id as a wrong-subgraph cross-check.
190
+ The memory tools whose Neo4j read/write re-scopes on the resolved account accept an optional `targetAccountId`. A house-scoped `role:admin` session sets it to read or write a **sub-account's** subgraph instead of its own; omitting it is byte-identical to the pre-existing own-account behaviour. Only a house-scoped session may set it: a sub-account or public session that passes `targetAccountId` is rejected `cross-account-denied`, and a house session naming an account that is not provisioned on this install is rejected `cross-account-target-not-provisioned`. The validity check re-scans the accounts dir on a miss, so a sub-account created at runtime this session resolves without a service restart — a stale boot-time enumeration cache no longer masks it, and the distinct reason tells a genuine wrong/typo id apart from that (now-eliminated) created-after-boot case. Resolution runs through the shared `resolveEffectiveAccount` primitive — there is no house fallback and no local re-implementation. Each call that sets `targetAccountId` emits one `[xacct] op=call tool=<t> caller=<own8> target=<tgt8> houseScope=<bool> decision=<allow|deny> reason=<…>` line before the graph call, and the tool's own `[memory-<t>] [<accountId>]` line prints the resolved (target) id as a wrong-subgraph cross-check.
191
191
 
192
192
  `profile-read/update/delete` also take `targetAccountId`. They key on `userId` as well as `accountId`, so cross-account they cannot use the caller's boot `USER_ID` (a house operator has no node in the sub-account subgraph). Instead they resolve the target sub-account's **owner** `AdminUser` — the single identity seeded per account (`role:"owner"`, one per account) — and attribute the read/write to it, emitting `[xacct] op=identity tool=profile-* target=<sub8> resolved-userId=<owner8>`. A target with no owner `AdminUser` is rejected loudly (never a wrong-identity write). `profile-update` bootstraps the owner's `UserProfile` on this path so a preference-only write lands. This covers preferences and every `profileFields` value (name via `givenName`/`familyName`, `role`, `timezone`, `locale`, `expertise`); no `Person` node or PIN is required. Setting `personFields` identity (email/telephone → the owner `Person`) cross-account also lands: when the owner `Person`/`OWNS` edge is absent (a sub-account is seeded with an `AdminUser` but no `Person`), `profile-update` bootstraps it, MERGEing the owner `Person` off the owner `AdminUser` via the `OWNS` edge — keyed on the `OWNS` edge + `accountId` (the same identity key `profile-read/update` resolve through), so the one existing owner `Person` is reused. It is never keyed on phone (which keys the separate access-grant `Person`, `HAS_ACCESS` not `OWNS`), so that node is never matched. Own-account is unchanged: a `personFields` write with a missing `OWNS`-`Person` still loud-fails, since that edge is a real post-PIN invariant there. The bootstrap does not replicate the PIN-setup identity `Person` in full (no name-based reuse, no embedding — this path carries only email/telephone); the residual `(accountId, email/telephone)` uniqueness, concurrency, and embedding gapsremain.
193
193
 
@@ -1 +1 @@
1
- {"version":3,"file":"index-testable.d.ts","sourceRoot":"","sources":["../src/index-testable.ts"],"names":[],"mappings":"AAQA,KAAK,aAAa,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QA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AAC,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,WAAW,CA6BrE"}
@@ -15,11 +15,17 @@ function noAccountText(toolName) {
15
15
  `(plugin-system metadata-only mode). Per-account graph access requires ACCOUNT_ID at spawn.`);
16
16
  }
17
17
  /** Operator-facing reject messages. Each CONTAINS its reject code so the
18
- * reason is greppable and the agent sees why the call was refused. */
18
+ * reason is greppable and the agent sees why the call was refused. The
19
+ * not-provisioned message names the fresh disk re-scan (Task 1471) so an
20
+ * operator reads it as "genuinely absent on disk", not a stale-cache miss. */
19
21
  function rejectText(reason, target8) {
20
- return reason === "cross-account-denied"
21
- ? `cross-account-denied: only a house-scoped admin session may set targetAccountId.`
22
- : `cross-account-invalid-target: "${target8}…" is not a valid account on this install.`;
22
+ if (reason === "cross-account-denied") {
23
+ return `cross-account-denied: only a house-scoped admin session may set targetAccountId.`;
24
+ }
25
+ if (reason === "cross-account-target-not-provisioned") {
26
+ return `cross-account-target-not-provisioned: "${target8}…" is not provisioned on this install (checked disk fresh, not just the boot cache).`;
27
+ }
28
+ return `cross-account-invalid-target: "${target8}…" is not a valid account on this install.`;
23
29
  }
24
30
  /**
25
31
  * Build the per-tool account resolver. `accountId` / `houseScope` are the boot
@@ -43,7 +49,10 @@ export function makeResolveToolAccount(deps) {
43
49
  write(`[memory] tool=${toolName} refuse reason=no-account-context\n`);
44
50
  return { reject: errContent(noAccountText(toolName)) };
45
51
  }
46
- const eff = resolveEffectiveAccountCore({ ownAccountId: deps.accountId, houseScope: deps.houseScope, targetAccountId }, deps.isValid);
52
+ const eff = resolveEffectiveAccountCore({ ownAccountId: deps.accountId, houseScope: deps.houseScope, targetAccountId }, deps.isValid,
53
+ // `deps.isValid` re-scans disk on a miss (isProvisionedAccount), so a
54
+ // reject here means the target is genuinely not on disk — Task 1471.
55
+ "cross-account-target-not-provisioned");
47
56
  if (targetAccountId) {
48
57
  const decision = "reject" in eff ? "deny" : "allow";
49
58
  const reason = "reject" in eff ? eff.reject : "ok";
@@ -1 +1 @@
1
- {"version":3,"file":"index-testable.js","sourceRoot":"","sources":["../src/index-testable.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,8BAA8B;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAK1F,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;AAChF,CAAC;AAED;oEACoE;AACpE,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,CACL,GAAG,QAAQ,qEAAqE;QAChF,4FAA4F,CAC7F,CAAC;AACJ,CAAC;AAED;uEACuE;AACvE,SAAS,UAAU,CAAC,MAA+D,EAAE,OAAe;IAClG,OAAO,MAAM,KAAK,sBAAsB;QACtC,CAAC,CAAC,kFAAkF;QACpF,CAAC,CAAC,kCAAkC,OAAO,4CAA4C,CAAC;AAC5F,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAKtC;IACC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE;QACnC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,8EAA8E;YAC9E,KAAK,CAAC,iBAAiB,QAAQ,qCAAqC,CAAC,CAAC;YACtE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;QACzD,CAAC;QACD,MAAM,GAAG,GAAG,2BAA2B,CACrC,EAAE,YA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F,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;YACpD,MAAM,MAAM,GAAG,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;YACnD,KAAK,CACH,wBAAwB,QAAQ,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;gBACtE,UAAU,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG;gBACzF,YAAY,QAAQ,WAAW,MAAM,IAAI,CAC5C,CAAC;QACJ,CAAC;QACD,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;YACpB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7F,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC"}
@@ -61,7 +61,7 @@ import { embed } from "./lib/embeddings.js";
61
61
  import { notTrashed } from "../../../../lib/graph-trash/dist/index.js";
62
62
  import { lifelineTool } from "../../../../lib/mcp-lifeline/dist/index.js";
63
63
  import { resolve } from "node:path";
64
- import { enumerateValidAccountIds } from "../../../../lib/account-enumeration/dist/index.js";
64
+ import { enumerateValidAccountIds, isProvisionedAccount } from "../../../../lib/account-enumeration/dist/index.js";
65
65
  import { readHouseAdminScope } from "../../../../lib/account-scope/dist/index.js";
66
66
  import { makeResolveToolAccount } from "./index-testable.js";
67
67
  const server = new McpServer({
@@ -100,7 +100,10 @@ process.stderr.write(`[xacct] boot houseScope=${houseScope ? "yes" : "no"} accou
100
100
  const resolveToolAccount = makeResolveToolAccount({
101
101
  accountId,
102
102
  houseScope,
103
- isValid: (id) => enumerateValidAccountIds(accountsDir).includes(id),
103
+ // Re-scan-on-miss (Task 1471): a sub-account created at runtime after this
104
+ // MCP child booted is absent from the boot-time cached set; the miss re-scans
105
+ // disk once so a live-created target resolves without a service restart.
106
+ isValid: (id) => isProvisionedAccount(accountsDir, id),
104
107
  });
105
108
  // Single source for the operator-facing targetAccountId description — the LLM
106
109
  // reads this verbatim, so it must not drift across the 35 targetable tools.