@rubytech/create-sitedesk-code 0.1.514 → 0.1.516

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 (220) hide show
  1. package/dist/__tests__/launchd-bootstrap.test.js +164 -18
  2. package/dist/index.js +15 -14
  3. package/dist/launchd-bootstrap.js +86 -17
  4. package/package.json +1 -1
  5. package/payload/platform/docs/superpowers/plans/2026-07-27-task-2016-disabled-agent-routing.md +624 -0
  6. package/payload/platform/docs/superpowers/specs/2026-07-27-task-2016-disabled-agent-routing-design.md +139 -0
  7. package/payload/platform/plugins/admin/mcp/dist/index.js +14 -16
  8. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  9. package/payload/platform/plugins/admin/mcp/dist/specialist-registry.d.ts +14 -0
  10. package/payload/platform/plugins/admin/mcp/dist/specialist-registry.d.ts.map +1 -0
  11. package/payload/platform/plugins/admin/mcp/dist/specialist-registry.js +57 -0
  12. package/payload/platform/plugins/admin/mcp/dist/specialist-registry.js.map +1 -0
  13. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +66 -5
  14. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +12 -0
  15. package/payload/platform/plugins/docs/references/admin-ui.md +38 -3
  16. package/payload/platform/plugins/docs/references/deployment.md +4 -0
  17. package/payload/platform/plugins/email/PLUGIN.md +1 -1
  18. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-metadata-calendar.test.d.ts +2 -0
  19. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-metadata-calendar.test.d.ts.map +1 -0
  20. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-metadata-calendar.test.js +94 -0
  21. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-metadata-calendar.test.js.map +1 -0
  22. package/payload/platform/plugins/email/mcp/dist/index.js +1 -1
  23. package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
  24. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +21 -1
  25. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -1
  26. package/payload/platform/plugins/email/mcp/dist/lib/imap.js +49 -8
  27. package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -1
  28. package/payload/platform/plugins/email/references/email-reference.md +4 -0
  29. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js +143 -2
  30. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js.map +1 -1
  31. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js +33 -3
  32. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js.map +1 -1
  33. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-search-paging.test.js +142 -0
  34. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-search-paging.test.js.map +1 -1
  35. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts +8 -0
  36. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -1
  37. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +40 -0
  38. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
  39. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.d.ts.map +1 -1
  40. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js +54 -3
  41. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js.map +1 -1
  42. package/payload/platform/plugins/outlook/references/graph-surfaces.md +9 -3
  43. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +2 -2
  44. package/payload/platform/scripts/__tests__/agents-md-bootstrap.test.sh +47 -0
  45. package/payload/platform/scripts/lib/agents-md-bootstrap.sh +58 -1
  46. package/payload/platform/services/claude-session-manager/dist/config.d.ts +48 -12
  47. package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
  48. package/payload/platform/services/claude-session-manager/dist/config.js +65 -15
  49. package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
  50. package/payload/platform/services/claude-session-manager/dist/index.js +7 -4
  51. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  52. package/payload/platform/services/claude-session-manager/dist/rootless-client-audit.d.ts.map +1 -1
  53. package/payload/platform/services/claude-session-manager/dist/rootless-client-audit.js +17 -2
  54. package/payload/platform/services/claude-session-manager/dist/rootless-client-audit.js.map +1 -1
  55. package/payload/server/public/activity.html +5 -5
  56. package/payload/server/public/agents.html +4 -4
  57. package/payload/server/public/assets/{AdminLoginScreens-Cs1jSnOF.js → AdminLoginScreens-B5qKb3YK.js} +1 -1
  58. package/payload/server/public/assets/AdminLoginScreens-B5qKb3YK.js.br +0 -0
  59. package/payload/server/public/assets/AdminLoginScreens-B5qKb3YK.js.gz +0 -0
  60. package/payload/server/public/assets/{AdminShell-DkrURZnF.js → AdminShell-BgJEq2zJ.js} +1 -1
  61. package/payload/server/public/assets/AdminShell-BgJEq2zJ.js.br +0 -0
  62. package/payload/server/public/assets/AdminShell-BgJEq2zJ.js.gz +0 -0
  63. package/payload/server/public/assets/{activity-BgZISMuE.js → activity-DmnVUDYO.js} +1 -1
  64. package/payload/server/public/assets/activity-DmnVUDYO.js.br +0 -0
  65. package/payload/server/public/assets/activity-DmnVUDYO.js.gz +0 -0
  66. package/payload/server/public/assets/{admin-DjFysc3-.js → admin-Dpge4OG9.js} +1 -1
  67. package/payload/server/public/assets/admin-Dpge4OG9.js.br +0 -0
  68. package/payload/server/public/assets/admin-Dpge4OG9.js.gz +0 -0
  69. package/payload/server/public/assets/{agents-Bx-MSZW6.js → agents-Bmq9X7P3.js} +1 -1
  70. package/payload/server/public/assets/agents-Bmq9X7P3.js.br +0 -0
  71. package/payload/server/public/assets/agents-Bmq9X7P3.js.gz +0 -0
  72. package/payload/server/public/assets/{browser-1I7syhHu.js → browser-B1G-W80B.js} +1 -1
  73. package/payload/server/public/assets/browser-B1G-W80B.js.br +0 -0
  74. package/payload/server/public/assets/browser-B1G-W80B.js.gz +0 -0
  75. package/payload/server/public/assets/{calendar-D_04JIo1.js → calendar-CHgrOFIN.js} +1 -1
  76. package/payload/server/public/assets/calendar-CHgrOFIN.js.br +0 -0
  77. package/payload/server/public/assets/calendar-CHgrOFIN.js.gz +0 -0
  78. package/payload/server/public/assets/chat-CIwmmtwP.js +1 -0
  79. package/payload/server/public/assets/chat-CIwmmtwP.js.br +0 -0
  80. package/payload/server/public/assets/chat-CIwmmtwP.js.gz +0 -0
  81. package/payload/server/public/assets/chevron-left-EQjfaQ-n.js +1 -0
  82. package/payload/server/public/assets/chevron-left-EQjfaQ-n.js.br +0 -0
  83. package/payload/server/public/assets/chevron-right-Ct8jZUGP.js +1 -0
  84. package/payload/server/public/assets/chevron-right-Ct8jZUGP.js.br +0 -0
  85. package/payload/server/public/assets/clock-Cxz5ybck.js +1 -0
  86. package/payload/server/public/assets/clock-Cxz5ybck.js.br +0 -0
  87. package/payload/server/public/assets/clock-Cxz5ybck.js.gz +0 -0
  88. package/payload/server/public/assets/data-BQVXKVsJ.js +1 -0
  89. package/payload/server/public/assets/data-BQVXKVsJ.js.br +1 -0
  90. package/payload/server/public/assets/data-BQVXKVsJ.js.gz +0 -0
  91. package/payload/server/public/assets/{file-text-DkvKqHMx.js → file-text-BVqqaDun.js} +1 -1
  92. package/payload/server/public/assets/file-text-BVqqaDun.js.br +0 -0
  93. package/payload/server/public/assets/file-text-BVqqaDun.js.gz +0 -0
  94. package/payload/server/public/assets/{graph-CCZhrwZX.js → graph-CEcME0lp.js} +1 -1
  95. package/payload/server/public/assets/graph-CEcME0lp.js.br +0 -0
  96. package/payload/server/public/assets/graph-CEcME0lp.js.gz +0 -0
  97. package/payload/server/public/assets/{graph-labels-BJ7puQkX.js → graph-labels-Zl32_AOH.js} +1 -1
  98. package/payload/server/public/assets/graph-labels-Zl32_AOH.js.br +0 -0
  99. package/payload/server/public/assets/graph-labels-Zl32_AOH.js.gz +0 -0
  100. package/payload/server/public/assets/{maximize-2-Xdj804U1.js → maximize-2-rkkMyAhf.js} +1 -1
  101. package/payload/server/public/assets/maximize-2-rkkMyAhf.js.br +0 -0
  102. package/payload/server/public/assets/maximize-2-rkkMyAhf.js.gz +0 -0
  103. package/payload/server/public/assets/{operator-BkfNpBs7.js → operator-DlL023ch.js} +1 -1
  104. package/payload/server/public/assets/operator-DlL023ch.js.br +0 -0
  105. package/payload/server/public/assets/operator-DlL023ch.js.gz +0 -0
  106. package/payload/server/public/assets/{page-D5n8ShE7.js → page-BAmYYqxp.js} +1 -1
  107. package/payload/server/public/assets/page-BAmYYqxp.js.br +0 -0
  108. package/payload/server/public/assets/page-BAmYYqxp.js.gz +0 -0
  109. package/payload/server/public/assets/{page-BoYc9c4a.js → page-k0BhBkA2.js} +1 -1
  110. package/payload/server/public/assets/page-k0BhBkA2.js.br +0 -0
  111. package/payload/server/public/assets/page-k0BhBkA2.js.gz +0 -0
  112. package/payload/server/public/assets/{public-CX5XSrxD.js → public-Cqgfmo1D.js} +1 -1
  113. package/payload/server/public/assets/public-Cqgfmo1D.js.br +0 -0
  114. package/payload/server/public/assets/public-Cqgfmo1D.js.gz +0 -0
  115. package/payload/server/public/assets/{rotate-ccw-dh_OhL23.js → rotate-ccw-O3RmqoTy.js} +1 -1
  116. package/payload/server/public/assets/rotate-ccw-O3RmqoTy.js.br +0 -0
  117. package/payload/server/public/assets/rotate-ccw-O3RmqoTy.js.gz +0 -0
  118. package/payload/server/public/assets/{routines-bb7dxcrr.js → routines-DMYObMUy.js} +1 -1
  119. package/payload/server/public/assets/routines-DMYObMUy.js.br +0 -0
  120. package/payload/server/public/assets/routines-DMYObMUy.js.gz +0 -0
  121. package/payload/server/public/assets/{skills-TeMwxXmJ.js → skills-DON1BKu5.js} +1 -1
  122. package/payload/server/public/assets/skills-DON1BKu5.js.br +0 -0
  123. package/payload/server/public/assets/skills-DON1BKu5.js.gz +0 -0
  124. package/payload/server/public/assets/{tasks-BqBBJlkg.js → tasks-C2PhUSrf.js} +1 -1
  125. package/payload/server/public/assets/tasks-C2PhUSrf.js.br +0 -0
  126. package/payload/server/public/assets/tasks-C2PhUSrf.js.gz +0 -0
  127. package/payload/server/public/assets/{time-entry-format-Cy_T-wiD.js → time-entry-format-4zgmuQI0.js} +1 -1
  128. package/payload/server/public/assets/time-entry-format-4zgmuQI0.js.br +0 -0
  129. package/payload/server/public/assets/time-entry-format-4zgmuQI0.js.gz +0 -0
  130. package/payload/server/public/assets/{triangle-alert-D-bSbPnX.js → triangle-alert-By5D7wuI.js} +1 -1
  131. package/payload/server/public/assets/triangle-alert-By5D7wuI.js.br +0 -0
  132. package/payload/server/public/assets/triangle-alert-By5D7wuI.js.gz +0 -0
  133. package/payload/server/public/assets/{useCopyFeedback-L7L55nFl.js → useCopyFeedback-Dx0vtm9s.js} +1 -1
  134. package/payload/server/public/assets/useCopyFeedback-Dx0vtm9s.js.br +0 -0
  135. package/payload/server/public/assets/useCopyFeedback-Dx0vtm9s.js.gz +0 -0
  136. package/payload/server/public/assets/{useSubAccountSwitcher-BYl2c7xA.css → useSubAccountSwitcher-UQQDcj0B.css} +1 -1
  137. package/payload/server/public/assets/useSubAccountSwitcher-UQQDcj0B.css.br +0 -0
  138. package/payload/server/public/assets/useSubAccountSwitcher-UQQDcj0B.css.gz +0 -0
  139. package/payload/server/public/assets/{useVoiceRecorder-MuZ7lpet.js → useVoiceRecorder-BgwOCCwj.js} +1 -1
  140. package/payload/server/public/assets/useVoiceRecorder-BgwOCCwj.js.br +0 -0
  141. package/payload/server/public/assets/useVoiceRecorder-BgwOCCwj.js.gz +0 -0
  142. package/payload/server/public/assets/{wrench-DUG1SZQB.js → wrench-CHfMwLza.js} +1 -1
  143. package/payload/server/public/assets/wrench-CHfMwLza.js.br +0 -0
  144. package/payload/server/public/assets/wrench-CHfMwLza.js.gz +0 -0
  145. package/payload/server/public/browser.html +4 -4
  146. package/payload/server/public/calendar.html +7 -7
  147. package/payload/server/public/chat.html +13 -13
  148. package/payload/server/public/data.html +11 -11
  149. package/payload/server/public/graph.html +9 -9
  150. package/payload/server/public/index.html +14 -14
  151. package/payload/server/public/operator.html +14 -14
  152. package/payload/server/public/public.html +13 -13
  153. package/payload/server/public/routines.html +6 -6
  154. package/payload/server/public/skills.html +5 -5
  155. package/payload/server/public/tasks.html +6 -6
  156. package/payload/server/server.js +139 -17
  157. package/payload/server/public/assets/AdminLoginScreens-Cs1jSnOF.js.br +0 -0
  158. package/payload/server/public/assets/AdminLoginScreens-Cs1jSnOF.js.gz +0 -0
  159. package/payload/server/public/assets/AdminShell-DkrURZnF.js.br +0 -0
  160. package/payload/server/public/assets/AdminShell-DkrURZnF.js.gz +0 -0
  161. package/payload/server/public/assets/activity-BgZISMuE.js.br +0 -0
  162. package/payload/server/public/assets/activity-BgZISMuE.js.gz +0 -0
  163. package/payload/server/public/assets/admin-DjFysc3-.js.br +0 -0
  164. package/payload/server/public/assets/admin-DjFysc3-.js.gz +0 -0
  165. package/payload/server/public/assets/agents-Bx-MSZW6.js.br +0 -0
  166. package/payload/server/public/assets/agents-Bx-MSZW6.js.gz +0 -0
  167. package/payload/server/public/assets/browser-1I7syhHu.js.br +0 -0
  168. package/payload/server/public/assets/browser-1I7syhHu.js.gz +0 -0
  169. package/payload/server/public/assets/calendar-D_04JIo1.js.br +0 -0
  170. package/payload/server/public/assets/calendar-D_04JIo1.js.gz +0 -0
  171. package/payload/server/public/assets/chat-BFH3FM5a.js +0 -1
  172. package/payload/server/public/assets/chat-BFH3FM5a.js.br +0 -0
  173. package/payload/server/public/assets/chat-BFH3FM5a.js.gz +0 -0
  174. package/payload/server/public/assets/chevron-left-Ux9-qLkk.js +0 -1
  175. package/payload/server/public/assets/chevron-right-BwIuCfyG.js +0 -1
  176. package/payload/server/public/assets/chevron-right-BwIuCfyG.js.br +0 -0
  177. package/payload/server/public/assets/clock-DhJdZRhC.js +0 -1
  178. package/payload/server/public/assets/clock-DhJdZRhC.js.br +0 -0
  179. package/payload/server/public/assets/data-ChY_uSIk.js +0 -1
  180. package/payload/server/public/assets/data-ChY_uSIk.js.br +0 -0
  181. package/payload/server/public/assets/data-ChY_uSIk.js.gz +0 -0
  182. package/payload/server/public/assets/file-text-DkvKqHMx.js.br +0 -0
  183. package/payload/server/public/assets/file-text-DkvKqHMx.js.gz +0 -0
  184. package/payload/server/public/assets/graph-CCZhrwZX.js.br +0 -0
  185. package/payload/server/public/assets/graph-CCZhrwZX.js.gz +0 -0
  186. package/payload/server/public/assets/graph-labels-BJ7puQkX.js.br +0 -0
  187. package/payload/server/public/assets/graph-labels-BJ7puQkX.js.gz +0 -0
  188. package/payload/server/public/assets/maximize-2-Xdj804U1.js.br +0 -0
  189. package/payload/server/public/assets/maximize-2-Xdj804U1.js.gz +0 -0
  190. package/payload/server/public/assets/operator-BkfNpBs7.js.br +0 -0
  191. package/payload/server/public/assets/operator-BkfNpBs7.js.gz +0 -0
  192. package/payload/server/public/assets/page-BoYc9c4a.js.br +0 -0
  193. package/payload/server/public/assets/page-BoYc9c4a.js.gz +0 -0
  194. package/payload/server/public/assets/page-D5n8ShE7.js.br +0 -0
  195. package/payload/server/public/assets/page-D5n8ShE7.js.gz +0 -0
  196. package/payload/server/public/assets/public-CX5XSrxD.js.br +0 -0
  197. package/payload/server/public/assets/public-CX5XSrxD.js.gz +0 -0
  198. package/payload/server/public/assets/rotate-ccw-dh_OhL23.js.br +0 -0
  199. package/payload/server/public/assets/rotate-ccw-dh_OhL23.js.gz +0 -0
  200. package/payload/server/public/assets/routines-bb7dxcrr.js.br +0 -0
  201. package/payload/server/public/assets/routines-bb7dxcrr.js.gz +0 -0
  202. package/payload/server/public/assets/skills-TeMwxXmJ.js.br +0 -0
  203. package/payload/server/public/assets/skills-TeMwxXmJ.js.gz +0 -0
  204. package/payload/server/public/assets/tasks-BqBBJlkg.js.br +0 -0
  205. package/payload/server/public/assets/tasks-BqBBJlkg.js.gz +0 -0
  206. package/payload/server/public/assets/time-entry-format-Cy_T-wiD.js.br +0 -3
  207. package/payload/server/public/assets/time-entry-format-Cy_T-wiD.js.gz +0 -0
  208. package/payload/server/public/assets/triangle-alert-D-bSbPnX.js.br +0 -1
  209. package/payload/server/public/assets/triangle-alert-D-bSbPnX.js.gz +0 -0
  210. package/payload/server/public/assets/useCopyFeedback-L7L55nFl.js.br +0 -0
  211. package/payload/server/public/assets/useCopyFeedback-L7L55nFl.js.gz +0 -0
  212. package/payload/server/public/assets/useSubAccountSwitcher-BYl2c7xA.css.br +0 -0
  213. package/payload/server/public/assets/useSubAccountSwitcher-BYl2c7xA.css.gz +0 -0
  214. package/payload/server/public/assets/useVoiceRecorder-MuZ7lpet.js.br +0 -0
  215. package/payload/server/public/assets/useVoiceRecorder-MuZ7lpet.js.gz +0 -0
  216. package/payload/server/public/assets/wrench-DUG1SZQB.js.br +0 -0
  217. package/payload/server/public/assets/wrench-DUG1SZQB.js.gz +0 -0
  218. /package/payload/server/public/assets/{useSubAccountSwitcher-DH0P6QMV.js → useSubAccountSwitcher-CRWoQXuU.js} +0 -0
  219. /package/payload/server/public/assets/{useSubAccountSwitcher-DH0P6QMV.js.br → useSubAccountSwitcher-CRWoQXuU.js.br} +0 -0
  220. /package/payload/server/public/assets/{useSubAccountSwitcher-DH0P6QMV.js.gz → useSubAccountSwitcher-CRWoQXuU.js.gz} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"graph-client.js","sourceRoot":"","sources":["../../src/lib/graph-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAwC/B,0EAA0E;AAC1E,SAAS,mBAAmB,CAAC,GAAY;IACvC,MAAM,CAAC,GAAG,GAOT,CAAC;IAEF,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,C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AAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAID,wBAAsB,aAAa,CACjC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA+C3B"}
1
+ {"version":3,"file":"mail-search.d.ts","sourceRoot":"","sources":["../../src/tools/mail-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAqED,wBAAsB,aAAa,CACjC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAkD3B"}
@@ -1,6 +1,55 @@
1
- import { callGraphPaged } from "../lib/graph-client.js";
1
+ import { callGraphPaged, postGraph } from "../lib/graph-client.js";
2
2
  import { log, trunc } from "../lib/log.js";
3
3
  const FIELDS = "id,subject,from,receivedDateTime,bodyPreview,isRead,hasAttachments";
4
+ /**
5
+ * Convert `$search` result ids into the immutable namespace.
6
+ *
7
+ * Graph's `$search` ignores `Prefer: IdType="ImmutableId"` — measured against a
8
+ * live mailbox both with and without an explicit per-request header — so this
9
+ * is the one tool still emitting regular ids, which die when any actor moves or
10
+ * re-saves the item — the mortal-handle failure Task 1688 removed everywhere
11
+ * else. Every other tool inherits immutable ids from `createGraphClient`.
12
+ * Adding `Prefer` to this tool's `.header()` chain does NOT fix it; that was
13
+ * tried and refuted.
14
+ *
15
+ * Keyed by `sourceId` rather than by position. A live probe of a 25-hit page
16
+ * returned one entry per input, each `sourceId` equal to its input id, so a
17
+ * positional read would also have worked — but a map costs nothing and turns a
18
+ * reordering into a loud failure instead of a silent id swap.
19
+ *
20
+ * Partial success is refused. Returning some immutable and some regular ids is
21
+ * exactly the mixed-namespace break this exists to prevent, and it would stay
22
+ * invisible until a later call 404'd on the untranslated one.
23
+ */
24
+ async function toImmutableIds(config, ids) {
25
+ let res;
26
+ try {
27
+ res = await postGraph(config, "/me/translateExchangeIds", { inputIds: ids, sourceIdType: "restId", targetIdType: "restImmutableEntryId" }, { tool: "mail-search" });
28
+ }
29
+ catch (err) {
30
+ // A transport-level failure is the same outcome as every entry failing, and
31
+ // is reported the same way: a count, not Graph's raw JSON. The status and
32
+ // code are already on the `graph-error` line callGraph emitted, and the
33
+ // original error rides along as `cause` for anyone reading a stack.
34
+ throw new Error(`mail-search: all ${ids.length} message ids could not be translated to immutable ids — the translation request itself failed. Returning the untranslated ids would hand out handles that stop resolving as soon as the item moves, so the search was refused.`, { cause: err });
35
+ }
36
+ const entries = res.json?.value ?? [];
37
+ const bySource = new Map();
38
+ for (const e of entries) {
39
+ // `== null` on purpose: the field is optional, and a successful entry may
40
+ // either omit it or carry an explicit null. Testing `=== undefined` would
41
+ // read an explicit null as a failure and refuse every search on a tenant
42
+ // that serialises it that way.
43
+ if (e.errorDetails == null && typeof e.sourceId === "string" && typeof e.targetId === "string") {
44
+ bySource.set(e.sourceId, e.targetId);
45
+ }
46
+ }
47
+ const missing = ids.filter((id) => !bySource.has(id)).length;
48
+ if (missing > 0) {
49
+ throw new Error(`mail-search: ${missing} of ${ids.length} message ids could not be translated to immutable ids. Returning the untranslated ids would hand out handles that stop resolving as soon as the item moves, so the search was refused.`);
50
+ }
51
+ return ids.map((id) => bySource.get(id));
52
+ }
4
53
  export async function runMailSearch(config, args) {
5
54
  const top = clampTop(args.top, 25);
6
55
  const query = args.query.trim();
@@ -23,8 +72,10 @@ export async function runMailSearch(config, args) {
23
72
  .select(FIELDS)
24
73
  .header("ConsistencyLevel", "eventual");
25
74
  }, { tool: "mail-search" });
26
- const items = page.value.map((msg) => ({
27
- id: msg.id,
75
+ const rawIds = page.value.map((msg) => msg.id);
76
+ const ids = rawIds.length > 0 ? await toImmutableIds(config, rawIds) : [];
77
+ const items = page.value.map((msg, i) => ({
78
+ id: ids[i],
28
79
  subject: msg.subject ?? null,
29
80
  from: msg.from?.emailAddress?.address ?? null,
30
81
  receivedDateTime: msg.receivedDateTime,
@@ -1 +1 @@
1
- {"version":3,"file":"mail-search.js","sourceRoot":"","sources":["../../src/tools/mail-search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA8B3C,MAAM,MAAM,GAAG,oEAAoE,CAAC;AAEpF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAyB,EACzB,IAAoB;IAEpB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IA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,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
@@ -10,7 +10,9 @@ The plugin therefore opts into **immutable ids**, sending `Prefer: IdType="Immut
10
10
 
11
11
  **This is plugin-wide by necessity, not preference.** The immutable and default namespaces carry *different values for the same item*, so an id produced by a request that omitted the header cannot address that item on a request that sent it. Never add or remove the header per tool or per call. Two `fetch()` calls sit outside the factory and are correctly unaffected: `account-register`'s `/me` lookup (a directory id, not an Outlook item id) and the attachment upload-session `PUT` (a pre-authenticated URL, not a Graph resource path).
12
12
 
13
- A per-request `.header()` (`outlook-mail-search`'s `ConsistencyLevel`) merges with the central header rather than displacing it — asserted in `graph-client.test.ts`, because a silent drop there would leave search alone emitting regular ids. A per-request header of the *same name* is a different matter: `Prefer` is also how Graph carries `outlook.timezone` and `odata.maxpagesize`, and setting it per-call would replace the id opt-in for that call. `Prefer` is comma-separated — append to `IMMUTABLE_ID_PREFER`, never set `Prefer` alone.
13
+ A per-request `.header()` (`outlook-mail-search`'s `ConsistencyLevel`) merges with the central header rather than displacing it — asserted in `graph-client.test.ts`. A per-request header of the *same name* is a different matter: `Prefer` is also how Graph carries `outlook.timezone` and `odata.maxpagesize`, and setting it per-call would replace the id opt-in for that call. `Prefer` is comma-separated — append to `IMMUTABLE_ID_PREFER`, never set `Prefer` alone.
14
+
15
+ **`$search` ignores the opt-in entirely, and the header merge does not protect it.** Measured against a live mailbox: `/me/messages?$search=` returns regular ids (`AQMkAG…`) both with and without an explicit `Prefer: IdType="ImmutableId"` on the request, while every non-search query returns immutable ids (`AAkALgAAAAAA…`) with or without a per-request `.header()`. Adding `Prefer` to `outlook-mail-search`'s header chain therefore does **not** fix it — that was tried and refuted, and it is the intuitive wrong answer a reader will otherwise re-derive. `outlook-mail-search` instead translates each page of results through `POST /me/translateExchangeIds` (`sourceIdType: "restId"`, `targetIdType: "restImmutableEntryId"`) before returning them, keyed by `sourceId`, refusing the page outright if any id fails to translate. Any future `$search` caller must do the same.
14
16
 
15
17
  **Across a plugin restart**, ids and opaque cursors (`nextCursor`) an agent is still holding were minted in the other namespace and will not resolve. This self-heals on the next list or create and affects one conversation; nothing persists a Graph id today.
16
18
 
@@ -343,9 +345,13 @@ All tool failures route through `lib/graph-client.ts:classifyGraphError`. Decisi
343
345
  | HTTP status | Graph `error.code` | Class | Action |
344
346
  |---|---|---|---|
345
347
  | 401 | (any) | `auth` | Refresh once, retry; if still 401 → terminal `auth-required` |
346
- | 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` |
348
+ | 403 | `ErrorRecoverableItemsAccessDenied` | `item-deleted` | Terminal: the item is in Recoverable Items or Deleted Items, deleted outside the platform. Tell the operator to recreate it. Never mentions consent |
349
+ | 403 | (any other) | `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` |
347
350
  | 429 | (any) — header `Retry-After` present | `rate-limit-recoverable` | Backoff per header, retry once |
348
351
  | 429 | (any) — header `Retry-After` absent | `rate-limit-terminal` | Terminal abort |
349
352
  | 503 | `MailboxNotEnabledForRESTAPI` | `on-prem` | Terminal: route operator to IMAP plugin |
350
- | 5xx | (any) | `5xx` | Retry once with 500 ms; then terminal |
353
+ | 503 | `ErrorMailboxMoveInProgress` | `mailbox-moving` | Terminal, **no retry** Microsoft is relocating the mailbox and the move outlasts any retry budget here. Overrides the `5xx` row below |
354
+ | 5xx | (any other) | `5xx` | Retry once with 500 ms; then terminal |
351
355
  | any | (any) | `other` | Re-throw |
356
+
357
+ Rows are evaluated top to bottom, and the two code-specific rows are matched before their status-only neighbours. A 403 or 503 carrying any other code keeps the older behaviour unchanged.
@@ -114,7 +114,7 @@ The platform enforces this at multiple levels:
114
114
  |------|-----------|------|
115
115
  | **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` |
116
116
  | **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` |
117
- | **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 |
117
+ | **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). Like `adminPhones`, the map is authoritative only on the account that owns the paired socket: `add-account-manager` is refused on any other account with `reason: "not-socket-account"` (a binding that also names the house reports `house-account-binding` instead — the value check runs first), and a map left on a non-socket account is inert and purged at boot with `[admin-identity] op=purge-nonsocket-accountmanager`. That boot purge stands down, logging `resolver disagreement`, when the account the manager loads its config from is not the `role:"house"` account, because there the "non-socket" map is the live one. | `managedAccountFor()` in `access-control.ts` resolves the sub-account + mode **once**; `checkDmAccess` returns `effectiveAccountId` + `passive`, and `ensureChannelSession` consumes them without re-resolving |
118
118
  | **Public/unknown** | Any phone that is not self, not in `adminPhones`, and not in `accountManagers`. Subject to DM policy gating. | Everything else in `checkDmAccess()` |
119
119
 
120
120
  **Critical distinction:** The *self phone* is the paired device's number (the WhatsApp account SiteDesk 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.
@@ -139,7 +139,7 @@ A passive-bound phone that DMs a requirement gets exactly one `:Task` filed unde
139
139
 
140
140
  **Single source of truth + fail-closed.** The effective account is resolved **exactly once**, in the gate: `checkDmAccess` returns `effectiveAccountId` (the house account for owner/`adminPhones`/public, the bound sub-account for a manager), and that value threads through the inbound payload → gateway → `ensureChannelSession`, which spawns into it **without re-reading** the `accountManagers` map. There is no second resolution and no `?? accountId` house fallback: if a manager's bound sub-account is not a valid account, the inbound is **rejected** (no session spawned, no reply), never routed to the house. This closes the escalation where a divergence between two independent map reads handed a scoped manager a house-owner admin session. Observable signals: `op=account-manager-route … effectiveAccount=… source=gate` on a routed manager inbound; `op=account-manager-reject … reason=unresolved-effective-account` on the fail-closed drop; a standing `op=escalation-tripwire` belt that can only fire if a future change reintroduces the divergence. The belt compares the manager's effective account against the **house** UUID, not against the account inbound persists to — on an install that sets `channelRoutingAccountId` those differ, and a manager bound to the routing target is a legitimate binding that must admit. The binding write path now refuses a house-account binding at write time, so no new one can be created; a binding written before that refusal existed is still on disk and is what the belt catches.
141
141
 
142
- **The scheduler path fails closed too.** A scheduled dispatch (`POST /api/channel/schedule-inject`) reaches the same spawn machine without going through the gate, resolving its own effective account via `effectiveAccountFor`. That resolver carries the same single-source + fail-closed shape: a non-manager destination scopes to the house (an owner/admin's real scope), a valid manager scopes to the bound sub-account, and a manager whose bound sub-account is not a valid account resolves to nothing — the route **rejects** (`op=schedule-account-manager-reject … reason=unresolved-effective-account`, HTTP 403, no spawn, no reply), never routing to the house. There is no `?? accountId` fallback on this path either. Telegram scheduled dispatch is house-only by construction (no account-manager routing), so there is nothing to fail closed there.
142
+ **The scheduler path fails closed too, and resolves the same account inbound does.** A scheduled dispatch (`POST /api/channel/schedule-inject`) reaches the same spawn machine without going through the gate, resolving its own effective account via `effectiveAccountFor`. That resolver carries the same single-source + fail-closed shape: a non-manager destination scopes to the **channel account**, a valid manager scopes to the bound sub-account, and a manager whose bound sub-account is not a valid account resolves to nothing — the route **rejects** (`op=schedule-account-manager-reject … reason=unresolved-effective-account`, HTTP 403, no spawn, no reply), never routing to the house. There is no `?? accountId` fallback on this path either. The channel account is the `channelRoutingAccountId` target when the house names a valid one and the house itself otherwise, which is exactly what a live inbound scopes to — the session id hashes the account, so a scheduled firing to a phone and that phone's own reply must resolve the same one or they become two sessions for one person. The scheduled resolver is not handed the house at all, so it cannot return it as a scope. One window is still open: the live path resolves the channel account once when the connection starts, so a repoint made while the connection is up is seen by the scheduled path first. Telegram scheduled dispatch is house-only by construction (no account-manager routing), so there is nothing to fail closed there, and Telegram scopes to the house rather than the channel account on both of its paths.
143
143
 
144
144
  **Schedule-time destination validation is a distinct, earlier layer.** The `effectiveAccountFor` resolution above runs at *fire* time to scope the spawn. Separately, when a schedule is *created or updated* (and re-checked every heartbeat by the standing audit), the scheduler validates the WhatsApp `agentDispatch` destination against the same house authority. It reads the authoritative `adminPhones` + `accountManagers` from the socket-owning **house** account — never the event's own `account.json`, whose manager map is inert — via the one shared `validateAgentDestination`. The destination's registered account (the house for an admin, the bound sub-account for a manager) must equal the account that created the schedule; the house/owner may target any registered admin or manager, a sub-account is locked to its own manager(s). A refusal names the true cause: `not-registered` (in no house list) or `cross-account destinationAccount=… scheduleAccount=…` (registered to a different account). Create-time and fire-time emit the identical reason codes, so a schedule that passes creation but later drifts is explained rather than silently dropped. This closes the bug where the validator read a sub-account's own (empty) manager map and refused a genuinely registered manager whose binding lives on the house.
145
145
 
@@ -102,6 +102,53 @@ assert_eq "$AGENTS_LINES" "$CORE_FILES" "doctrine:agents-md-line-count-equals-co
102
102
  assert_not_contains "$TMP/agents/admin/AGENTS.md" "premium--special" "doctrine:premium-plugin-agent-skipped"
103
103
  rm -rf "$TMP"
104
104
 
105
+ # Case 5 (Task 2016) — a name in the disabled store gets no routing line.
106
+ TMP=$(make_account)
107
+ bash "$BOOTSTRAP" "$TMP" >/dev/null
108
+ printf '{"disabled":["beta-specialist.md"]}\n' > "$TMP/agents-disabled.json"
109
+ OUT=$(bash "$BOOTSTRAP" "$TMP")
110
+ assert_not_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:beta-specialist**: " "withhold:beta-line-gone"
111
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:alpha-specialist**: " "withhold:alpha-kept"
112
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:gamma-specialist**: " "withhold:gamma-kept"
113
+ assert_matches "$OUT" "op=specialist-lines account=[^ ]+ kept=2 withheld=beta-specialist" "withhold:log-line"
114
+
115
+ # Case 6 (Task 2016) — clearing the store restores the line on the next run.
116
+ printf '{"disabled":[]}\n' > "$TMP/agents-disabled.json"
117
+ OUT=$(bash "$BOOTSTRAP" "$TMP")
118
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:beta-specialist**: " "restore:beta-back"
119
+ assert_matches "$OUT" "op=specialist-lines account=[^ ]+ kept=3 withheld=none" "restore:log-line"
120
+ rm -rf "$TMP"
121
+
122
+ # Case 7 (Task 2016) — a malformed store removes nothing and says so. A corrupt
123
+ # file is not evidence that an agent was disabled.
124
+ TMP=$(make_account)
125
+ bash "$BOOTSTRAP" "$TMP" >/dev/null
126
+ printf '{ not json' > "$TMP/agents-disabled.json"
127
+ OUT=$(bash "$BOOTSTRAP" "$TMP")
128
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:alpha-specialist**: " "badstore:alpha-kept"
129
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:beta-specialist**: " "badstore:beta-kept"
130
+ assert_matches "$OUT" "op=specialist-lines account=[^ ]+ kept=3 withheld=store-unreadable" "badstore:log-line"
131
+ rm -rf "$TMP"
132
+
133
+ # Case 8 (Task 2016) — a store entry that breaks the `[a-z][a-z0-9-]*` name
134
+ # convention is ignored, never interpolated into the matcher. `.*` would
135
+ # otherwise match every specialist line and delete the whole routing table.
136
+ TMP=$(make_account)
137
+ bash "$BOOTSTRAP" "$TMP" >/dev/null
138
+ printf '{"disabled":[".*.md"]}\n' > "$TMP/agents-disabled.json"
139
+ OUT=$(bash "$BOOTSTRAP" "$TMP")
140
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:alpha-specialist**: " "badname:alpha-kept"
141
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:beta-specialist**: " "badname:beta-kept"
142
+ assert_contains "$TMP/agents/admin/AGENTS.md" "- **specialists:gamma-specialist**: " "badname:gamma-kept"
143
+ assert_matches "$OUT" "op=specialist-lines account=[^ ]+ kept=3 withheld=none" "badname:log-line"
144
+ rm -rf "$TMP"
145
+
146
+ # Case 9 (Task 2016) — no store on disk is the cold-install path.
147
+ TMP=$(make_account)
148
+ OUT=$(bash "$BOOTSTRAP" "$TMP")
149
+ assert_matches "$OUT" "op=specialist-lines account=[^ ]+ kept=3 withheld=none" "nostore:log-line"
150
+ rm -rf "$TMP"
151
+
105
152
  echo
106
153
  echo "PASS: $PASS, FAIL: $FAIL"
107
154
  if [ "$FAIL" -gt 0 ]; then
@@ -10,9 +10,19 @@
10
10
  # matches `^- **specialists:<name>**:` are preserved verbatim (operator-tuned
11
11
  # lines never get clobbered); missing entries are appended.
12
12
  #
13
- # Emits one stdout observability line, two-space indented to match the
13
+ # A name in <account_dir>/agents-disabled.json (Task 2016) gets no routing line:
14
+ # an existing one is removed and the walk below skips it. The store is the
15
+ # operator's intent, so this holds even in the drift state where the file is
16
+ # still live — the standing agent-parity check is what reports that drift. An
17
+ # unreadable store withholds nothing, matching provision-account-dir.sh: a
18
+ # corrupt file is not evidence that an agent was disabled. A store entry that
19
+ # breaks the name convention below is ignored rather than interpolated: `.*`
20
+ # would otherwise match every routing line and take the whole table with it.
21
+ #
22
+ # Emits two stdout observability lines, two-space indented to match the
14
23
  # surrounding setup-account.sh log style:
15
24
  # " [admin-bootstrap] AGENTS.md specialists=<n> appended=<m> existing=<k>"
25
+ # " [agents-md] op=specialist-lines account=<id8> kept=<n> withheld=<comma-list|none|store-unreadable>"
16
26
  #
17
27
  # Names must follow the `[a-z][a-z0-9-]*` convention so direct interpolation
18
28
  # in the regex matcher is safe.
@@ -27,6 +37,48 @@ if [ ! -f "$AGENTS_MD" ]; then
27
37
  printf '# Installed Roles\n\nDispatch via the Agent tool with `subagent_type: "specialists:{name}"`.\n\n' > "$AGENTS_MD"
28
38
  fi
29
39
 
40
+ # --- Disabled-agent reconcile (Task 2016) ------------------------------------
41
+ _store="$ACCOUNT_DIR/agents-disabled.json"
42
+ _withheld_names=""
43
+ _withheld_field="none"
44
+ if [ -f "$_store" ]; then
45
+ if _withheld_names=$(python3 -c '
46
+ import json, re, sys
47
+ try:
48
+ parsed = json.load(open(sys.argv[1]))
49
+ except Exception:
50
+ raise SystemExit(1)
51
+ names = parsed.get("disabled")
52
+ if not isinstance(names, list):
53
+ raise SystemExit(1)
54
+ for n in sorted(names):
55
+ if isinstance(n, str) and n.endswith(".md") and re.fullmatch(r"[a-z][a-z0-9-]*", n[:-3]):
56
+ print(n[:-3])
57
+ ' "$_store" 2>/dev/null); then
58
+ if [ -n "$_withheld_names" ]; then
59
+ _withheld_field=$(echo "$_withheld_names" | paste -sd, -)
60
+ fi
61
+ else
62
+ _withheld_names=""
63
+ _withheld_field="store-unreadable"
64
+ fi
65
+ fi
66
+
67
+ _is_withheld() {
68
+ [ -n "$_withheld_names" ] || return 1
69
+ printf '%s\n' "$_withheld_names" | grep -qxF -- "$1"
70
+ }
71
+
72
+ if [ -n "$_withheld_names" ]; then
73
+ while IFS= read -r _w; do
74
+ [ -n "$_w" ] || continue
75
+ if grep -qE "^- \*\*specialists:${_w}\*\*:" "$AGENTS_MD"; then
76
+ grep -vE "^- \*\*specialists:${_w}\*\*:" "$AGENTS_MD" > "$AGENTS_MD.tmp" || true
77
+ mv "$AGENTS_MD.tmp" "$AGENTS_MD"
78
+ fi
79
+ done <<< "$_withheld_names"
80
+ fi
81
+
30
82
  _specialists=0
31
83
  _appended=0
32
84
  _existing=0
@@ -38,6 +90,7 @@ for specialist in "$ACCOUNT_DIR/specialists/agents/"*.md; do
38
90
  _name=$(sed -n 's/^name: *//p' "$specialist" | head -1)
39
91
  _desc=$(sed -n 's/^description: *"*//p' "$specialist" | sed 's/"$//' | head -1)
40
92
  [ -z "$_name" ] && continue
93
+ if _is_withheld "$_name"; then continue; fi
41
94
  _specialists=$((_specialists + 1))
42
95
  if grep -qE "^- \*\*specialists:${_name}\*\*:" "$AGENTS_MD"; then
43
96
  _existing=$((_existing + 1))
@@ -47,3 +100,7 @@ for specialist in "$ACCOUNT_DIR/specialists/agents/"*.md; do
47
100
  _appended=$((_appended + 1))
48
101
  done
49
102
  echo " [admin-bootstrap] AGENTS.md specialists=$_specialists appended=$_appended existing=$_existing"
103
+
104
+ _kept=$(grep -cE '^- \*\*specialists:' "$AGENTS_MD" || true)
105
+ _id8=$(basename "$ACCOUNT_DIR" | cut -c1-8)
106
+ echo " [agents-md] op=specialist-lines account=$_id8 kept=$_kept withheld=$_withheld_field"
@@ -74,12 +74,24 @@ export type AccountDirDiagnosis = {
74
74
  kind: 'resolved';
75
75
  dir: string;
76
76
  }
77
- /** No directory under `accountsRoot` holds an `account.json` including the
78
- * cases where the root is absent or unreadable. A genuinely empty registry. */
77
+ /** No directory under `accountsRoot` holds an `account.json`, and the root is
78
+ * either absent (`ENOENT`) or present and holding none. A genuinely empty
79
+ * registry, which is the installer's job to fill. `ENOENT` also covers a
80
+ * symlink at `data/accounts` pointing nowhere, which reads as absent. */
79
81
  | {
80
82
  kind: 'no-accounts';
81
83
  accountsRoot: string;
82
84
  }
85
+ /** `accountsRoot` could not be enumerated: `readdirSync` failed with a code
86
+ * other than `ENOENT`. Task 2031 — the registry is unknown, not empty, so
87
+ * its count is not zero and the installer remedy does not apply. An ownership
88
+ * or permission mismatch on `data/accounts` is the routine outcome of moving
89
+ * an install between machines. */
90
+ | {
91
+ kind: 'accounts-root-unreadable';
92
+ accountsRoot: string;
93
+ errno: string;
94
+ }
83
95
  /** No account carries `role:"house"` and more than one candidate exists, so
84
96
  * the pre-migration single-account tolerance cannot apply. */
85
97
  | {
@@ -97,8 +109,9 @@ export type AccountDirDiagnosis = {
97
109
  * managed-service model: the single `role:"house"` account, or the sole
98
110
  * account in the pre-migration window (before `setup-account.sh` stamps the
99
111
  * role). Mirrors the installer's `resolveInstallAccountId` so the runtime reads
100
- * the same account the installer wrote. Reports no accounts and the two genuine
101
- * drift conditions (zero-house with >1 candidate, multiple houses) as distinct
112
+ * the same account the installer wrote. Reports no accounts, an unreadable
113
+ * accounts root, and the two genuine drift conditions (zero-house with >1
114
+ * candidate, multiple houses) as distinct
102
115
  * kinds; the caller surfaces `account-dir-unresolved` naming the kind and
103
116
  * refuses to start, and the boot census (`[account-registry] op=census`) makes
104
117
  * the drift visible in journalctl.
@@ -114,17 +127,18 @@ export declare function diagnoseAccountDir(platformRoot: string): AccountDirDiag
114
127
  export declare function resolveAccountDir(platformRoot: string): string | null;
115
128
  /** The `account-dir-unresolved` boot-refusal message for a non-resolving
116
129
  * diagnosis. Every branch keeps the `account-dir-unresolved` token so existing
117
- * greps still hit, and carries `reason=<kind>` so the three failures are
130
+ * greps still hit, and carries `reason=<kind>` so the four failures are
118
131
  * distinguishable from the log line alone. Only `no-accounts` names the
119
132
  * installer: on the two drift branches re-running it adds another account and
120
- * deepens the fault. Throws on a resolved diagnosis there is no failure to
121
- * describe, and silently returning prose would let a caller print it. */
133
+ * deepens the fault, and on an unreadable root it cannot repair the read.
134
+ * Throws on a resolved diagnosis there is no failure to describe, and
135
+ * silently returning prose would let a caller print it. */
122
136
  export declare function formatAccountDirUnresolved(d: AccountDirDiagnosis): string;
123
- /** Registry census — house / client / total counts of the valid accounts under
124
- * `accountsRoot`. A dir counts when it holds a parseable `account.json`;
125
- * `clients` counts `role:"client"`, and an account with any other or absent
126
- * role (the pre-migration unlabelled window) is neither house nor client but
127
- * still counted in `total`. Reads roles fresh — house designation is
137
+ /** Registry census — house / client / total counts of the accounts under
138
+ * `accountsRoot`. A dir counts when it holds an `account.json`, parseable or
139
+ * not; `clients` counts `role:"client"`, and an account with any other or
140
+ * absent role (the pre-migration unlabelled window) is neither house nor
141
+ * client but still counted in `total`. Reads roles fresh — house designation is
128
142
  * runtime-mutable via the lifecycle tools. Mirrors `resolveAccountDir`'s inline
129
143
  * scan (the manager has no rootDir-clean import path for the account-enumeration
130
144
  * lib). A missing accounts root reads as an empty registry, not a throw. */
@@ -132,12 +146,34 @@ export interface RegistryCensus {
132
146
  houses: number;
133
147
  clients: number;
134
148
  total: number;
149
+ /** Task 2031 — the `account.json` files whose role could not be read, each
150
+ * with the reason. Counted in `total`, the same way a role-less `{}` already
151
+ * is, so this census and `diagnoseAccountDir` agree on how many accounts
152
+ * exist. `detail` carries the actual error rather than assuming one, so the
153
+ * log never claims a file's JSON is malformed when the file could not be
154
+ * opened at all. */
155
+ unreadable: Array<{
156
+ path: string;
157
+ detail: string;
158
+ }>;
159
+ /** Task 2031 — the errno when `accountsRoot` itself could not be enumerated,
160
+ * else null. `ENOENT` is not one: an absent root is an empty registry, so
161
+ * its zeros are facts. For any other code the counts are all zero and are
162
+ * NOT facts, and `formatRegistryCensus` renders the failure in their place. */
163
+ rootErrno: string | null;
135
164
  }
136
165
  export declare function censusAccountsRoot(accountsRoot: string): RegistryCensus;
137
166
  /** The standing census log line body. `houses != 1` is the drift signature the
138
167
  * boot emitter checks. Pure formatter so the emitter and its test share one
139
168
  * wording. */
140
169
  export declare function formatRegistryCensus(c: RegistryCensus): string;
170
+ /** The `op=census-drift` FATAL body, or null when there is no drift to report.
171
+ * Pure so the boot emitter and its test share one rule. `houses` is a fact only
172
+ * when the root was readable: on a read failure every count is zero, and
173
+ * FATAL-logging "exactly one house is required" against those zeros would
174
+ * assert a house count nobody measured (Task 2031). That case is already
175
+ * reported by `formatRegistryCensus` on the `op=census` line. */
176
+ export declare function formatCensusDrift(c: RegistryCensus, accountsRoot: string): string | null;
141
177
  /** True iff `accountId` is the install's house account, by the same resolution
142
178
  * the boot path uses (single role:"house", or the sole pre-migration account).
143
179
  * Returns false on drift (zero-house-with->1-candidate, or multiple houses),
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAA;AAGhC,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD;;4DAEwD;IACxD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB;;;;0BAIsB;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB;;4EAEwE;IACxE,aAAa,EAAE,MAAM,CAAA;IACrB;;;gEAG4D;IAC5D,eAAe,EAAE,MAAM,CAAA;IACvB;;2EAEuE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB;;0EAEsE;IACtE,iBAAiB,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE,cAAc,CAAA;IACpB;;;;;;;8BAO0B;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB;;;qDAGiD;IACjD,iBAAiB,EAAE,iBAAiB,CAAA;IACpC;;gFAE4E;IAC5E,gBAAgB,EAAE,MAAM,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AU,EACtB,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,IAAI,CAIN;AAED;;;;;;;;;;;iBAWiB;AACjB,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACpC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;CAChB,GAAG,MAAM,CAGT;AAED;;;;;;;kCAOkC;AAClC,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/F;AAUD,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,aAAa,CAwE9E"}
@@ -137,8 +137,9 @@ function resolveLanIPv4() {
137
137
  * managed-service model: the single `role:"house"` account, or the sole
138
138
  * account in the pre-migration window (before `setup-account.sh` stamps the
139
139
  * role). Mirrors the installer's `resolveInstallAccountId` so the runtime reads
140
- * the same account the installer wrote. Reports no accounts and the two genuine
141
- * drift conditions (zero-house with >1 candidate, multiple houses) as distinct
140
+ * the same account the installer wrote. Reports no accounts, an unreadable
141
+ * accounts root, and the two genuine drift conditions (zero-house with >1
142
+ * candidate, multiple houses) as distinct
142
143
  * kinds; the caller surfaces `account-dir-unresolved` naming the kind and
143
144
  * refuses to start, and the boot census (`[account-registry] op=census`) makes
144
145
  * the drift visible in journalctl.
@@ -155,10 +156,16 @@ export function diagnoseAccountDir(platformRoot) {
155
156
  try {
156
157
  entries = readdirSync(accountsRoot);
157
158
  }
158
- catch {
159
- // absent or unreadable root indistinguishable from an empty registry to
160
- // the operator, and the installer wording is right for both.
161
- return { kind: 'no-accounts', accountsRoot };
159
+ catch (err) {
160
+ // Task 2031 `ENOENT` is the only code that means the root is absent, and
161
+ // an absent root is an empty registry. Every other code means something is
162
+ // at that path and could not be read, where reporting "no account.json
163
+ // exists, run the installer" states the opposite of the filesystem and
164
+ // prescribes a remedy that cannot repair a read failure.
165
+ const code = err.code;
166
+ if (code === 'ENOENT')
167
+ return { kind: 'no-accounts', accountsRoot };
168
+ return { kind: 'accounts-root-unreadable', accountsRoot, errno: code ?? 'unknown' };
162
169
  }
163
170
  const candidates = [];
164
171
  const houses = [];
@@ -200,11 +207,12 @@ export function resolveAccountDir(platformRoot) {
200
207
  }
201
208
  /** The `account-dir-unresolved` boot-refusal message for a non-resolving
202
209
  * diagnosis. Every branch keeps the `account-dir-unresolved` token so existing
203
- * greps still hit, and carries `reason=<kind>` so the three failures are
210
+ * greps still hit, and carries `reason=<kind>` so the four failures are
204
211
  * distinguishable from the log line alone. Only `no-accounts` names the
205
212
  * installer: on the two drift branches re-running it adds another account and
206
- * deepens the fault. Throws on a resolved diagnosis there is no failure to
207
- * describe, and silently returning prose would let a caller print it. */
213
+ * deepens the fault, and on an unreadable root it cannot repair the read.
214
+ * Throws on a resolved diagnosis there is no failure to describe, and
215
+ * silently returning prose would let a caller print it. */
208
216
  export function formatAccountDirUnresolved(d) {
209
217
  const prefix = `[claude-session-manager] account-dir-unresolved reason=${d.kind}:`;
210
218
  switch (d.kind) {
@@ -213,6 +221,12 @@ export function formatAccountDirUnresolved(d) {
213
221
  case 'no-accounts':
214
222
  return (`${prefix} no <installDir>/data/accounts/<uuid>/account.json under ${d.accountsRoot}. ` +
215
223
  'The installer (setup-account.sh / writeInstallDefaults) must run before manager start.');
224
+ case 'accounts-root-unreadable':
225
+ return (`${prefix} ${d.accountsRoot} exists but could not be read (errno=${d.errno}). ` +
226
+ 'The registry is unknown, not empty: check ownership and permissions on that ' +
227
+ 'directory and its parents, or retry if the errno is transient, then start the ' +
228
+ 'manager again. Accounts already there are untouched, ' +
229
+ 'so do not run the installer, which cannot repair a read failure.');
216
230
  case 'zero-house-ambiguous':
217
231
  return (`${prefix} ${d.candidateIds.length} accounts under ${d.accountsRoot} and none carries role:"house": ` +
218
232
  `${d.candidateIds.join(', ')}. Exactly one must be stamped role:"house" before the manager can start.`);
@@ -227,12 +241,19 @@ export function censusAccountsRoot(accountsRoot) {
227
241
  try {
228
242
  entries = readdirSync(accountsRoot);
229
243
  }
230
- catch {
231
- return { houses: 0, clients: 0, total: 0 };
244
+ catch (err) {
245
+ // Task 2031 same split as `diagnoseAccountDir`: only `ENOENT` means the
246
+ // root is absent, which is an empty registry. Any other code leaves the
247
+ // registry unknown, and reporting houses=0 clients=0 total=0 for it states
248
+ // the opposite of the filesystem on a line that re-emits every 300s.
249
+ const code = err.code;
250
+ const rootErrno = code === 'ENOENT' ? null : (code ?? 'unknown');
251
+ return { houses: 0, clients: 0, total: 0, unreadable: [], rootErrno };
232
252
  }
233
253
  let houses = 0;
234
254
  let clients = 0;
235
255
  let total = 0;
256
+ const unreadable = [];
236
257
  for (const entry of entries) {
237
258
  const configPath = join(accountsRoot, entry, 'account.json');
238
259
  if (!existsSync(configPath))
@@ -241,8 +262,17 @@ export function censusAccountsRoot(accountsRoot) {
241
262
  try {
242
263
  cfg = JSON.parse(readFileSync(configPath, 'utf-8'));
243
264
  }
244
- catch {
245
- // unparseable account.json excluded from the registry entirely
265
+ catch (err) {
266
+ // Task 2031 — an account.json whose role cannot be read is an account
267
+ // whose role is unknown, not an account that is absent.
268
+ // `diagnoseAccountDir` already counts it as a candidate; excluding it here
269
+ // made one boot emit total=1 beside a diagnosis naming two accounts. The
270
+ // cause (parse failure or read failure) is carried, not assumed.
271
+ total++;
272
+ unreadable.push({
273
+ path: configPath,
274
+ detail: err instanceof Error ? err.message : String(err),
275
+ });
246
276
  continue;
247
277
  }
248
278
  total++;
@@ -251,13 +281,33 @@ export function censusAccountsRoot(accountsRoot) {
251
281
  else if (cfg.role === 'client')
252
282
  clients++;
253
283
  }
254
- return { houses, clients, total };
284
+ return { houses, clients, total, unreadable, rootErrno: null };
255
285
  }
256
286
  /** The standing census log line body. `houses != 1` is the drift signature the
257
287
  * boot emitter checks. Pure formatter so the emitter and its test share one
258
288
  * wording. */
259
289
  export function formatRegistryCensus(c) {
260
- return `op=census houses=${c.houses} clients=${c.clients} total=${c.total}`;
290
+ // Task 2031 an unreadable root has no counts to state, so the line reports
291
+ // the read failure instead of three zeros that would read as an empty
292
+ // registry.
293
+ if (c.rootErrno !== null)
294
+ return `op=census root-unreadable errno=${c.rootErrno}`;
295
+ return (`op=census houses=${c.houses} clients=${c.clients} total=${c.total} ` +
296
+ `unreadable=${c.unreadable.length}`);
297
+ }
298
+ /** The `op=census-drift` FATAL body, or null when there is no drift to report.
299
+ * Pure so the boot emitter and its test share one rule. `houses` is a fact only
300
+ * when the root was readable: on a read failure every count is zero, and
301
+ * FATAL-logging "exactly one house is required" against those zeros would
302
+ * assert a house count nobody measured (Task 2031). That case is already
303
+ * reported by `formatRegistryCensus` on the `op=census` line. */
304
+ export function formatCensusDrift(c, accountsRoot) {
305
+ if (c.rootErrno !== null)
306
+ return null;
307
+ if (c.houses === 1)
308
+ return null;
309
+ return (`op=census-drift FATAL houses=${c.houses} clients=${c.clients} total=${c.total} ` +
310
+ `accountsRoot=${accountsRoot} — exactly one role:"house" account is required`);
261
311
  }
262
312
  /** True iff `accountId` is the install's house account, by the same resolution
263
313
  * the boot path uses (single role:"house", or the sole pre-migration account).