@rubytech/create-sitedesk-code 0.1.521 → 0.1.523

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 (416) hide show
  1. package/dist/index.js +17 -3
  2. package/package.json +1 -1
  3. package/payload/platform/lib/account-schema-regions/package-lock.json +12 -0
  4. package/payload/platform/lib/active-rules/package-lock.json +12 -0
  5. package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -1
  6. package/payload/platform/lib/graph-style/dist/index.js +28 -0
  7. package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
  8. package/payload/platform/lib/graph-style/src/__tests__/caption-coverage.test.ts +7 -0
  9. package/payload/platform/lib/graph-style/src/index.ts +24 -0
  10. package/payload/platform/lib/graph-write/dist/__tests__/merge-on.test.d.ts.map +1 -0
  11. package/payload/platform/lib/graph-write/dist/__tests__/merge-on.test.js.map +1 -0
  12. package/payload/platform/lib/graph-write/dist/index.d.ts +16 -0
  13. package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -1
  14. package/payload/platform/lib/graph-write/dist/index.js +83 -6
  15. package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
  16. package/payload/platform/lib/graph-write/src/index.ts +117 -10
  17. package/payload/platform/lib/mcp-lifeline/package-lock.json +12 -0
  18. package/payload/platform/lib/routine-templates/dist/index.d.ts +151 -0
  19. package/payload/platform/lib/routine-templates/dist/index.d.ts.map +1 -0
  20. package/payload/platform/lib/routine-templates/dist/index.js +207 -0
  21. package/payload/platform/lib/routine-templates/dist/index.js.map +1 -0
  22. package/payload/platform/lib/routine-templates/dist/roster.d.ts +57 -0
  23. package/payload/platform/lib/routine-templates/dist/roster.d.ts.map +1 -0
  24. package/payload/platform/lib/routine-templates/dist/roster.js +182 -0
  25. package/payload/platform/lib/routine-templates/dist/roster.js.map +1 -0
  26. package/payload/platform/lib/routine-templates/dist/seed-cli.d.ts +2 -0
  27. package/payload/platform/lib/routine-templates/dist/seed-cli.d.ts.map +1 -0
  28. package/payload/platform/lib/routine-templates/dist/seed-cli.js +64 -0
  29. package/payload/platform/lib/routine-templates/dist/seed-cli.js.map +1 -0
  30. package/payload/platform/lib/routine-templates/package.json +6 -0
  31. package/payload/platform/lib/routine-templates/src/__tests__/roster.test.ts +170 -0
  32. package/payload/platform/lib/routine-templates/src/__tests__/seed.test.ts +298 -0
  33. package/payload/platform/lib/routine-templates/src/index.ts +299 -0
  34. package/payload/platform/lib/routine-templates/src/roster.ts +206 -0
  35. package/payload/platform/lib/routine-templates/src/seed-cli.ts +65 -0
  36. package/payload/platform/lib/routine-templates/tsconfig.json +9 -0
  37. package/payload/platform/lib/routine-templates/vitest.config.ts +9 -0
  38. package/payload/platform/neo4j/edge-annotations.json +2 -2
  39. package/payload/platform/neo4j/schema.cypher +25 -1
  40. package/payload/platform/package.json +3 -2
  41. package/payload/platform/plugins/admin/PLUGIN.md +2 -2
  42. package/payload/platform/plugins/admin/mcp/dist/index.js +39 -1
  43. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  44. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +319 -66
  45. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +12 -0
  46. package/payload/platform/plugins/docs/references/admin-ui.md +275 -59
  47. package/payload/platform/plugins/docs/references/internals.md +4 -0
  48. package/payload/platform/plugins/docs/references/memory-guide.md +11 -1
  49. package/payload/platform/plugins/docs/references/outlook-guide.md +27 -4
  50. package/payload/platform/plugins/graph/.claude-plugin/plugin.json +1 -1
  51. package/payload/platform/plugins/graph/PLUGIN.md +1 -1
  52. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  53. package/payload/platform/plugins/memory/mcp/dist/index.js +12 -5
  54. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  55. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-estate-census.test.d.ts +2 -0
  56. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-estate-census.test.d.ts.map +1 -0
  57. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-estate-census.test.js +197 -0
  58. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-estate-census.test.js.map +1 -0
  59. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js +55 -9
  60. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js.map +1 -1
  61. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +96 -0
  62. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -1
  63. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/index.d.ts +7 -0
  64. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/index.d.ts.map +1 -1
  65. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.d.ts +29 -0
  66. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.d.ts.map +1 -0
  67. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.js +126 -0
  68. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.js.map +1 -0
  69. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep.js +7 -4
  70. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep.js.map +1 -1
  71. package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.d.ts +1 -0
  72. package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.d.ts.map +1 -1
  73. package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.js +18 -1
  74. package/payload/platform/plugins/memory/mcp/dist/tools/memory-dream-run.js.map +1 -1
  75. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +7 -0
  76. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
  77. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +4 -3
  78. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  79. package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -0
  80. package/payload/platform/plugins/memory/references/schema-estate-agent.md +2 -2
  81. package/payload/platform/plugins/memory/skills/conversation-archive-enrich/SKILL.md +4 -4
  82. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  83. package/payload/platform/plugins/outlook/PLUGIN.md +9 -1
  84. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-resolve.test.d.ts +2 -0
  85. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-resolve.test.d.ts.map +1 -0
  86. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-resolve.test.js +151 -0
  87. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-resolve.test.js.map +1 -0
  88. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-store.test.d.ts +2 -0
  89. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-store.test.d.ts.map +1 -0
  90. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-store.test.js +151 -0
  91. package/payload/platform/plugins/outlook/mcp/dist/__tests__/delegated-store.test.js.map +1 -0
  92. package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js +38 -4
  93. package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js.map +1 -1
  94. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-prefix-wiring.test.d.ts +2 -0
  95. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-prefix-wiring.test.d.ts.map +1 -0
  96. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-prefix-wiring.test.js +146 -0
  97. package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-prefix-wiring.test.js.map +1 -0
  98. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list-delegated.test.d.ts +2 -0
  99. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list-delegated.test.d.ts.map +1 -0
  100. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list-delegated.test.js +120 -0
  101. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list-delegated.test.js.map +1 -0
  102. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list.test.js +8 -8
  103. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list.test.js.map +1 -1
  104. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-path-prefix.test.d.ts +2 -0
  105. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-path-prefix.test.d.ts.map +1 -0
  106. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-path-prefix.test.js +27 -0
  107. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-path-prefix.test.js.map +1 -0
  108. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mail-only-guard.test.d.ts +2 -0
  109. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mail-only-guard.test.d.ts.map +1 -0
  110. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mail-only-guard.test.js +70 -0
  111. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mail-only-guard.test.js.map +1 -0
  112. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mailbox-add.test.d.ts +2 -0
  113. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mailbox-add.test.d.ts.map +1 -0
  114. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mailbox-add.test.js +152 -0
  115. package/payload/platform/plugins/outlook/mcp/dist/__tests__/shared-mailbox-add.test.js.map +1 -0
  116. package/payload/platform/plugins/outlook/mcp/dist/auth/delegated-store.d.ts +57 -0
  117. package/payload/platform/plugins/outlook/mcp/dist/auth/delegated-store.d.ts.map +1 -0
  118. package/payload/platform/plugins/outlook/mcp/dist/auth/delegated-store.js +163 -0
  119. package/payload/platform/plugins/outlook/mcp/dist/auth/delegated-store.js.map +1 -0
  120. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts +12 -0
  121. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts.map +1 -1
  122. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js +21 -1
  123. package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js.map +1 -1
  124. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.d.ts +35 -4
  125. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.d.ts.map +1 -1
  126. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.js +92 -10
  127. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.js.map +1 -1
  128. package/payload/platform/plugins/outlook/mcp/dist/index.js +106 -3
  129. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  130. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts +49 -0
  131. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -1
  132. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +126 -8
  133. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
  134. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.d.ts +13 -0
  135. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.d.ts.map +1 -1
  136. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.js +9 -0
  137. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-info.js.map +1 -1
  138. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.d.ts +42 -8
  139. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.d.ts.map +1 -1
  140. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.js +59 -19
  141. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.js.map +1 -1
  142. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-add.d.ts +47 -0
  143. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-add.d.ts.map +1 -0
  144. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-add.js +67 -0
  145. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-add.js.map +1 -0
  146. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-remove.d.ts +12 -0
  147. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-remove.d.ts.map +1 -0
  148. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-remove.js +18 -0
  149. package/payload/platform/plugins/outlook/mcp/dist/tools/shared-mailbox-remove.js.map +1 -0
  150. package/payload/platform/plugins/outlook/references/auth.md +15 -2
  151. package/payload/platform/plugins/outlook/references/graph-surfaces.md +8 -0
  152. package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +21 -1
  153. package/payload/platform/plugins/quickbooks/PLUGIN.md +10 -10
  154. package/payload/platform/plugins/scheduling/PLUGIN.md +49 -1
  155. package/payload/platform/plugins/scheduling/mcp/dist/index.js +48 -0
  156. package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
  157. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/notes-cap.test.d.ts +2 -0
  158. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/notes-cap.test.d.ts.map +1 -0
  159. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/notes-cap.test.js +78 -0
  160. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/notes-cap.test.js.map +1 -0
  161. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/routine-run.test.d.ts +2 -0
  162. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/routine-run.test.d.ts.map +1 -0
  163. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/routine-run.test.js +457 -0
  164. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/routine-run.test.js.map +1 -0
  165. package/payload/platform/plugins/scheduling/mcp/dist/lib/notes-cap.d.ts +35 -0
  166. package/payload/platform/plugins/scheduling/mcp/dist/lib/notes-cap.d.ts.map +1 -0
  167. package/payload/platform/plugins/scheduling/mcp/dist/lib/notes-cap.js +39 -0
  168. package/payload/platform/plugins/scheduling/mcp/dist/lib/notes-cap.js.map +1 -0
  169. package/payload/platform/plugins/scheduling/mcp/dist/lib/routine-run.d.ts +175 -0
  170. package/payload/platform/plugins/scheduling/mcp/dist/lib/routine-run.d.ts.map +1 -0
  171. package/payload/platform/plugins/scheduling/mcp/dist/lib/routine-run.js +533 -0
  172. package/payload/platform/plugins/scheduling/mcp/dist/lib/routine-run.js.map +1 -0
  173. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js +123 -9
  174. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js.map +1 -1
  175. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/routine-roster-audit.test.d.ts +2 -0
  176. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/routine-roster-audit.test.d.ts.map +1 -0
  177. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/routine-roster-audit.test.js +189 -0
  178. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/routine-roster-audit.test.js.map +1 -0
  179. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/suspension-census.test.d.ts +2 -0
  180. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/suspension-census.test.d.ts.map +1 -0
  181. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/suspension-census.test.js +95 -0
  182. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/suspension-census.test.js.map +1 -0
  183. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/sweep-excludes-suspended.test.d.ts +2 -0
  184. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/sweep-excludes-suspended.test.d.ts.map +1 -0
  185. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/sweep-excludes-suspended.test.js +114 -0
  186. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/sweep-excludes-suspended.test.js.map +1 -0
  187. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts +109 -2
  188. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -1
  189. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +340 -9
  190. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -1
  191. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts +9 -1
  192. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts.map +1 -1
  193. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +210 -45
  194. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
  195. package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js +43 -1
  196. package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js.map +1 -1
  197. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-get-agent.test.js +55 -7
  198. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-get-agent.test.js.map +1 -1
  199. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-list.test.js +45 -1
  200. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-list.test.js.map +1 -1
  201. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-runs.test.d.ts +2 -0
  202. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-runs.test.d.ts.map +1 -0
  203. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-runs.test.js +96 -0
  204. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-runs.test.js.map +1 -0
  205. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts.map +1 -1
  206. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js +2 -1
  207. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js.map +1 -1
  208. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.d.ts +5 -0
  209. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.d.ts.map +1 -1
  210. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.js +13 -0
  211. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.js.map +1 -1
  212. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.d.ts +4 -0
  213. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.d.ts.map +1 -1
  214. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.js +24 -3
  215. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-list.js.map +1 -1
  216. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-runs.d.ts +33 -0
  217. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-runs.d.ts.map +1 -0
  218. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-runs.js +51 -0
  219. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-runs.js.map +1 -0
  220. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts.map +1 -1
  221. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js +12 -2
  222. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js.map +1 -1
  223. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +30 -2
  224. package/payload/platform/plugins/whatsapp/skills/connect-whatsapp/SKILL.md +1 -1
  225. package/payload/platform/scripts/check-specialist-tool-surface.mjs +92 -16
  226. package/payload/platform/scripts/seed-neo4j.sh +41 -0
  227. package/payload/platform/scripts/verify-skill-tool-surface.sh +91 -2
  228. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  229. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +3 -0
  230. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  231. package/payload/platform/templates/specialists/agents/librarian.md +1 -1
  232. package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
  233. package/payload/server/{chunk-AZLT4LVO.js → chunk-VUXKXOJU.js} +755 -335
  234. package/payload/server/{chunk-UX2FRNO7.js → chunk-WT2PFGY4.js} +37 -265
  235. package/payload/server/{chunk-PXNY2TAP.js → chunk-XCR5D2G3.js} +239 -10
  236. package/payload/server/{manager-CQBSUJXR.js → manager-4TJK3YOY.js} +4 -2
  237. package/payload/server/maxy-edge.js +2 -2
  238. package/payload/server/public/activity.html +5 -5
  239. package/payload/server/public/agents.html +4 -4
  240. package/payload/server/public/assets/{AdminLoginScreens-Dar_MMJm.js → AdminLoginScreens-uknqh2Pm.js} +1 -1
  241. package/payload/server/public/assets/AdminLoginScreens-uknqh2Pm.js.br +0 -0
  242. package/payload/server/public/assets/AdminLoginScreens-uknqh2Pm.js.gz +0 -0
  243. package/payload/server/public/assets/AdminShell-GqtMImyQ.js +2 -0
  244. package/payload/server/public/assets/AdminShell-GqtMImyQ.js.br +0 -0
  245. package/payload/server/public/assets/AdminShell-GqtMImyQ.js.gz +0 -0
  246. package/payload/server/public/assets/{activity-B1rt4GIy.js → activity-B4KfMJqO.js} +1 -1
  247. package/payload/server/public/assets/activity-B4KfMJqO.js.br +0 -0
  248. package/payload/server/public/assets/activity-B4KfMJqO.js.gz +0 -0
  249. package/payload/server/public/assets/admin-DxCZeVw0.js +1 -0
  250. package/payload/server/public/assets/admin-DxCZeVw0.js.br +0 -0
  251. package/payload/server/public/assets/admin-DxCZeVw0.js.gz +0 -0
  252. package/payload/server/public/assets/agents-BtwBuO4G.js +1 -0
  253. package/payload/server/public/assets/agents-BtwBuO4G.js.br +0 -0
  254. package/payload/server/public/assets/agents-BtwBuO4G.js.gz +0 -0
  255. package/payload/server/public/assets/{browser-1QSCPl3X.js → browser-B3hSzI3O.js} +1 -1
  256. package/payload/server/public/assets/browser-B3hSzI3O.js.br +0 -0
  257. package/payload/server/public/assets/browser-B3hSzI3O.js.gz +0 -0
  258. package/payload/server/public/assets/{calendar-D009qWVV.js → calendar-BggxXxhS.js} +1 -1
  259. package/payload/server/public/assets/calendar-BggxXxhS.js.br +0 -0
  260. package/payload/server/public/assets/calendar-BggxXxhS.js.gz +0 -0
  261. package/payload/server/public/assets/chat-flivHt0t.js +1 -0
  262. package/payload/server/public/assets/chat-flivHt0t.js.br +0 -0
  263. package/payload/server/public/assets/chat-flivHt0t.js.gz +0 -0
  264. package/payload/server/public/assets/chevron-left-nVRThX7f.js +1 -0
  265. package/payload/server/public/assets/chevron-right-CLqfrkRA.js +1 -0
  266. package/payload/server/public/assets/chevron-right-CLqfrkRA.js.br +0 -0
  267. package/payload/server/public/assets/clock-Dj3SRZKo.js +1 -0
  268. package/payload/server/public/assets/clock-Dj3SRZKo.js.br +0 -0
  269. package/payload/server/public/assets/clock-Dj3SRZKo.js.gz +0 -0
  270. package/payload/server/public/assets/data-Ckjkne54.js +1 -0
  271. package/payload/server/public/assets/data-Ckjkne54.js.br +3 -0
  272. package/payload/server/public/assets/data-Ckjkne54.js.gz +0 -0
  273. package/payload/server/public/assets/{file-text-DwGAfCsd.js → file-text-BKs9eyiw.js} +1 -1
  274. package/payload/server/public/assets/file-text-BKs9eyiw.js.br +0 -0
  275. package/payload/server/public/assets/file-text-BKs9eyiw.js.gz +0 -0
  276. package/payload/server/public/assets/{graph-D-DGlfhW.js → graph-DTi71NaZ.js} +3 -3
  277. package/payload/server/public/assets/graph-DTi71NaZ.js.br +0 -0
  278. package/payload/server/public/assets/graph-DTi71NaZ.js.gz +0 -0
  279. package/payload/server/public/assets/graph-labels-BT3S6e9H.js +1 -0
  280. package/payload/server/public/assets/graph-labels-BT3S6e9H.js.br +0 -0
  281. package/payload/server/public/assets/graph-labels-BT3S6e9H.js.gz +0 -0
  282. package/payload/server/public/assets/{maximize-2-C_-KapxH.js → maximize-2-zC94tsxY.js} +1 -1
  283. package/payload/server/public/assets/maximize-2-zC94tsxY.js.br +0 -0
  284. package/payload/server/public/assets/maximize-2-zC94tsxY.js.gz +0 -0
  285. package/payload/server/public/assets/operator-BtWNEMh-.js +1 -0
  286. package/payload/server/public/assets/operator-BtWNEMh-.js.br +0 -0
  287. package/payload/server/public/assets/operator-BtWNEMh-.js.gz +0 -0
  288. package/payload/server/public/assets/page-BFm91p0e.js +1 -0
  289. package/payload/server/public/assets/page-BFm91p0e.js.br +0 -0
  290. package/payload/server/public/assets/page-BFm91p0e.js.gz +0 -0
  291. package/payload/server/public/assets/{page-E74MYB18.js → page-Ccl0FazM.js} +3 -3
  292. package/payload/server/public/assets/page-Ccl0FazM.js.br +0 -0
  293. package/payload/server/public/assets/page-Ccl0FazM.js.gz +0 -0
  294. package/payload/server/public/assets/{public-CI6K1sNW.js → public-BpC6cn9S.js} +1 -1
  295. package/payload/server/public/assets/public-BpC6cn9S.js.br +0 -0
  296. package/payload/server/public/assets/public-BpC6cn9S.js.gz +0 -0
  297. package/payload/server/public/assets/{rotate-ccw-PWu_QGrD.js → rotate-ccw-BNcqbHkZ.js} +1 -1
  298. package/payload/server/public/assets/rotate-ccw-BNcqbHkZ.js.br +0 -0
  299. package/payload/server/public/assets/rotate-ccw-BNcqbHkZ.js.gz +0 -0
  300. package/payload/server/public/assets/routines-D5iia-XG.js +1 -0
  301. package/payload/server/public/assets/routines-D5iia-XG.js.br +0 -0
  302. package/payload/server/public/assets/routines-D5iia-XG.js.gz +0 -0
  303. package/payload/server/public/assets/{skills-g8HvunPA.js → skills-COLAw_jt.js} +1 -1
  304. package/payload/server/public/assets/skills-COLAw_jt.js.br +0 -0
  305. package/payload/server/public/assets/skills-COLAw_jt.js.gz +0 -0
  306. package/payload/server/public/assets/tasks-CZDQI4nB.js +1 -0
  307. package/payload/server/public/assets/tasks-CZDQI4nB.js.br +0 -0
  308. package/payload/server/public/assets/tasks-CZDQI4nB.js.gz +0 -0
  309. package/payload/server/public/assets/{time-entry-format-BXWuQ6Sw.js → time-entry-format-laTFzawg.js} +1 -1
  310. package/payload/server/public/assets/time-entry-format-laTFzawg.js.br +0 -0
  311. package/payload/server/public/assets/time-entry-format-laTFzawg.js.gz +0 -0
  312. package/payload/server/public/assets/{triangle-alert-BNshRC13.js → triangle-alert-DrwqhEog.js} +1 -1
  313. package/payload/server/public/assets/triangle-alert-DrwqhEog.js.br +0 -0
  314. package/payload/server/public/assets/triangle-alert-DrwqhEog.js.gz +0 -0
  315. package/payload/server/public/assets/{useCopyFeedback-CwTZ9DqH.js → useCopyFeedback-Cxme5GK6.js} +1 -1
  316. package/payload/server/public/assets/useCopyFeedback-Cxme5GK6.js.br +0 -0
  317. package/payload/server/public/assets/useCopyFeedback-Cxme5GK6.js.gz +0 -0
  318. package/payload/server/public/assets/useSubAccountSwitcher-B-K8y5a4.css +1 -0
  319. package/payload/server/public/assets/useSubAccountSwitcher-B-K8y5a4.css.br +0 -0
  320. package/payload/server/public/assets/useSubAccountSwitcher-B-K8y5a4.css.gz +0 -0
  321. package/payload/server/public/assets/useSubAccountSwitcher-C_1E11Dv.js +14 -0
  322. package/payload/server/public/assets/useSubAccountSwitcher-C_1E11Dv.js.br +0 -0
  323. package/payload/server/public/assets/useSubAccountSwitcher-C_1E11Dv.js.gz +0 -0
  324. package/payload/server/public/assets/{useVoiceRecorder-BGqV5R6u.js → useVoiceRecorder-DUBpVa2T.js} +1 -1
  325. package/payload/server/public/assets/useVoiceRecorder-DUBpVa2T.js.br +0 -0
  326. package/payload/server/public/assets/useVoiceRecorder-DUBpVa2T.js.gz +0 -0
  327. package/payload/server/public/assets/{wrench-DQ045Pyk.js → wrench-DWuxPnzF.js} +1 -1
  328. package/payload/server/public/assets/wrench-DWuxPnzF.js.br +0 -0
  329. package/payload/server/public/assets/wrench-DWuxPnzF.js.gz +0 -0
  330. package/payload/server/public/browser.html +4 -4
  331. package/payload/server/public/calendar.html +7 -7
  332. package/payload/server/public/chat.html +13 -13
  333. package/payload/server/public/data.html +11 -11
  334. package/payload/server/public/graph.html +9 -9
  335. package/payload/server/public/index.html +14 -14
  336. package/payload/server/public/operator.html +14 -14
  337. package/payload/server/public/public.html +13 -13
  338. package/payload/server/public/routines.html +6 -6
  339. package/payload/server/public/skills.html +5 -5
  340. package/payload/server/public/tasks.html +6 -6
  341. package/payload/server/server.js +6631 -5690
  342. package/payload/server/public/assets/AdminLoginScreens-Dar_MMJm.js.br +0 -0
  343. package/payload/server/public/assets/AdminLoginScreens-Dar_MMJm.js.gz +0 -0
  344. package/payload/server/public/assets/AdminShell-CpaI2F_p.js +0 -2
  345. package/payload/server/public/assets/AdminShell-CpaI2F_p.js.br +0 -0
  346. package/payload/server/public/assets/AdminShell-CpaI2F_p.js.gz +0 -0
  347. package/payload/server/public/assets/activity-B1rt4GIy.js.br +0 -0
  348. package/payload/server/public/assets/activity-B1rt4GIy.js.gz +0 -0
  349. package/payload/server/public/assets/admin-DE3lLNje.js +0 -1
  350. package/payload/server/public/assets/admin-DE3lLNje.js.br +0 -0
  351. package/payload/server/public/assets/admin-DE3lLNje.js.gz +0 -0
  352. package/payload/server/public/assets/agents-BXq8woVf.js +0 -1
  353. package/payload/server/public/assets/agents-BXq8woVf.js.br +0 -0
  354. package/payload/server/public/assets/agents-BXq8woVf.js.gz +0 -0
  355. package/payload/server/public/assets/browser-1QSCPl3X.js.br +0 -0
  356. package/payload/server/public/assets/browser-1QSCPl3X.js.gz +0 -0
  357. package/payload/server/public/assets/calendar-D009qWVV.js.br +0 -0
  358. package/payload/server/public/assets/calendar-D009qWVV.js.gz +0 -0
  359. package/payload/server/public/assets/chat-CUg1fTqJ.js +0 -1
  360. package/payload/server/public/assets/chat-CUg1fTqJ.js.br +0 -1
  361. package/payload/server/public/assets/chat-CUg1fTqJ.js.gz +0 -0
  362. package/payload/server/public/assets/chevron-left-C2JEy7uU.js +0 -1
  363. package/payload/server/public/assets/chevron-left-C2JEy7uU.js.br +0 -0
  364. package/payload/server/public/assets/chevron-right-DWa047Ys.js +0 -1
  365. package/payload/server/public/assets/chevron-right-DWa047Ys.js.br +0 -0
  366. package/payload/server/public/assets/clock-C3OqfCnn.js +0 -1
  367. package/payload/server/public/assets/clock-C3OqfCnn.js.br +0 -0
  368. package/payload/server/public/assets/clock-C3OqfCnn.js.gz +0 -0
  369. package/payload/server/public/assets/data-Bu_yCScC.js +0 -1
  370. package/payload/server/public/assets/data-Bu_yCScC.js.br +0 -0
  371. package/payload/server/public/assets/data-Bu_yCScC.js.gz +0 -0
  372. package/payload/server/public/assets/file-text-DwGAfCsd.js.br +0 -0
  373. package/payload/server/public/assets/file-text-DwGAfCsd.js.gz +0 -0
  374. package/payload/server/public/assets/graph-D-DGlfhW.js.br +0 -0
  375. package/payload/server/public/assets/graph-D-DGlfhW.js.gz +0 -0
  376. package/payload/server/public/assets/graph-labels-BbX3fXzl.js +0 -1
  377. package/payload/server/public/assets/graph-labels-BbX3fXzl.js.br +0 -0
  378. package/payload/server/public/assets/graph-labels-BbX3fXzl.js.gz +0 -0
  379. package/payload/server/public/assets/maximize-2-C_-KapxH.js.br +0 -0
  380. package/payload/server/public/assets/maximize-2-C_-KapxH.js.gz +0 -0
  381. package/payload/server/public/assets/operator-CFrZVcv6.js +0 -1
  382. package/payload/server/public/assets/operator-CFrZVcv6.js.br +0 -0
  383. package/payload/server/public/assets/operator-CFrZVcv6.js.gz +0 -0
  384. package/payload/server/public/assets/page-CHt62f1_.js +0 -1
  385. package/payload/server/public/assets/page-CHt62f1_.js.br +0 -0
  386. package/payload/server/public/assets/page-CHt62f1_.js.gz +0 -0
  387. package/payload/server/public/assets/page-E74MYB18.js.br +0 -0
  388. package/payload/server/public/assets/page-E74MYB18.js.gz +0 -0
  389. package/payload/server/public/assets/public-CI6K1sNW.js.br +0 -0
  390. package/payload/server/public/assets/public-CI6K1sNW.js.gz +0 -0
  391. package/payload/server/public/assets/rotate-ccw-PWu_QGrD.js.br +0 -0
  392. package/payload/server/public/assets/rotate-ccw-PWu_QGrD.js.gz +0 -0
  393. package/payload/server/public/assets/routines-Cp3_XS7S.js +0 -1
  394. package/payload/server/public/assets/routines-Cp3_XS7S.js.br +0 -0
  395. package/payload/server/public/assets/routines-Cp3_XS7S.js.gz +0 -0
  396. package/payload/server/public/assets/skills-g8HvunPA.js.br +0 -0
  397. package/payload/server/public/assets/skills-g8HvunPA.js.gz +0 -0
  398. package/payload/server/public/assets/tasks-CMC_jDVm.js +0 -1
  399. package/payload/server/public/assets/tasks-CMC_jDVm.js.br +0 -0
  400. package/payload/server/public/assets/tasks-CMC_jDVm.js.gz +0 -0
  401. package/payload/server/public/assets/time-entry-format-BXWuQ6Sw.js.br +0 -2
  402. package/payload/server/public/assets/time-entry-format-BXWuQ6Sw.js.gz +0 -0
  403. package/payload/server/public/assets/triangle-alert-BNshRC13.js.br +0 -0
  404. package/payload/server/public/assets/triangle-alert-BNshRC13.js.gz +0 -0
  405. package/payload/server/public/assets/useCopyFeedback-CwTZ9DqH.js.br +0 -0
  406. package/payload/server/public/assets/useCopyFeedback-CwTZ9DqH.js.gz +0 -0
  407. package/payload/server/public/assets/useSubAccountSwitcher-BuUYMDWl.js +0 -14
  408. package/payload/server/public/assets/useSubAccountSwitcher-BuUYMDWl.js.br +0 -0
  409. package/payload/server/public/assets/useSubAccountSwitcher-BuUYMDWl.js.gz +0 -0
  410. package/payload/server/public/assets/useSubAccountSwitcher-dzDnmWq9.css +0 -1
  411. package/payload/server/public/assets/useSubAccountSwitcher-dzDnmWq9.css.br +0 -0
  412. package/payload/server/public/assets/useSubAccountSwitcher-dzDnmWq9.css.gz +0 -0
  413. package/payload/server/public/assets/useVoiceRecorder-BGqV5R6u.js.br +0 -0
  414. package/payload/server/public/assets/useVoiceRecorder-BGqV5R6u.js.gz +0 -0
  415. package/payload/server/public/assets/wrench-DQ045Pyk.js.br +0 -0
  416. package/payload/server/public/assets/wrench-DQ045Pyk.js.gz +0 -0
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Task 2130 — the shipped routine roster.
3
+ *
4
+ * A fresh install used to ship zero routines, so the only working examples
5
+ * lived in one customer's graph and every operator wrote the prompts from
6
+ * scratch. These eleven are the catalogue that ships with the platform instead.
7
+ *
8
+ * Two properties make a routine shippable, and both are load-bearing:
9
+ *
10
+ * 1. It resolves its own surfaces at run time. Every prompt opens on
11
+ * `capabilities-here`, which reports the account's live install set, and
12
+ * ends the turn without replying when the surface it needs is absent. That
13
+ * is what makes the same eleven rows correct on an estate agency, a web studio
14
+ * and a field-service install rather than a template someone must edit.
15
+ *
16
+ * 2. It names nobody. No prompt carries a person's name, an email address, a
17
+ * phone number, a hostname or a database name. `scripts/check-routine-
18
+ * templates-generic.sh` is the standing control for that; a review pass is
19
+ * not, because the failure is silent and the routine still works.
20
+ *
21
+ * The `recurrence` on each row is a PROPOSAL, not a schedule. Seeded rows carry
22
+ * `eventStatus:'suspended'` and `nextRun:NULL`, so nothing here fires until an
23
+ * operator enables it and supplies the cron and zone they actually want (see
24
+ * `.docs/routine-roster.md` for why the enable path takes all four arguments).
25
+ *
26
+ * Every tool name cited in a prompt exists in
27
+ * `platform/services/claude-session-manager/src/canonical-tool-names.generated.ts`.
28
+ * The roster test asserts that, so a renamed tool breaks the build rather than
29
+ * shipping a prompt that reaches for a tool no install serves.
30
+ */
31
+
32
+ /** Bumped whenever any prompt in the roster changes. The seed refreshes a
33
+ * routine's prompt only when the stored `routineTemplateVersion` is BELOW this
34
+ * and no operator has edited the row, so an unbumped edit ships to new installs
35
+ * and never reaches existing ones — bump it in the same commit as the edit. */
36
+ export const ROUTINE_TEMPLATE_VERSION = 1;
37
+
38
+ export interface RoutineTemplate {
39
+ /** Stable identity. Half of the MERGE key `(accountId, routineTemplate)`, so
40
+ * it is never renamed: a renamed key seeds a duplicate row and orphans the
41
+ * original, which the operator then has to delete by hand. */
42
+ readonly key: string;
43
+ /** The title shown on `/routines`. */
44
+ readonly name: string;
45
+ /** The proposed cron. Written ON CREATE only, never refreshed, so an operator
46
+ * who retimes a routine keeps their expression across upgrades. */
47
+ readonly recurrence: string;
48
+ /** The injected turn. Refreshed on a version bump when the row is unedited. */
49
+ readonly prompt: string;
50
+ }
51
+
52
+ const START_OF_DAY = `Prepare the operator's morning briefing and reply with it as a single message.
53
+
54
+ Call capabilities-here first and work only with the plugins it reports as enabled. Nothing below is mandatory: each part is included when its surface is present and skipped in silence when it is not.
55
+
56
+ Mail: read today's unread and overnight messages with email-read, or outlook-mail-list when the mailbox is on the Microsoft side. Report what actually needs the operator, not a count.
57
+ Diary: list today's appointments with outlook-calendar-list or google-calendar-list, plus schedule-list for anything booked in the graph rather than a provider calendar.
58
+ Work: list what is open and due today or overdue with work-list.
59
+ Connected systems: if a connector is registered, call connector-call for whatever it treats as today's queue.
60
+
61
+ Write it the way a colleague would say it out loud: what needs a decision, what is time-bound, what changed overnight. Lead with the thing that will cost the most if it is missed. No headings, no counts for their own sake, no restating the sections above.
62
+
63
+ If every surface is absent, or every surface is present and there is genuinely nothing worth saying, end the turn without replying. A silent morning is a correct result and is better than a message that says there is nothing to report.`;
64
+
65
+ const INBOUND_CHECK = `Triage inbound messages that arrived since the last check and prepare replies for the operator to approve. Never send anything.
66
+
67
+ Call capabilities-here first. If no mail plugin is enabled, end the turn without replying.
68
+
69
+ Search for messages received since the previous run with email-search, or outlook-mail-search on the Microsoft side. Ignore anything already answered, anything automated, and anything the operator has clearly seen.
70
+
71
+ For each message that genuinely needs a human reply, write a draft with email-draft or outlook-draft. Drafts only: this routine has no authority to send, and a sent message it should not have sent cannot be recalled. Match the operator's usual register from the surrounding thread rather than a house style.
72
+
73
+ When a message commits the business to doing something rather than to saying something, record it with work-create so the obligation survives the inbox.
74
+
75
+ Reply with one short message naming what you drafted and what you deliberately left alone, so the operator can open the drafts and send them. If there was nothing new that needed a reply, end the turn without replying.`;
76
+
77
+ const END_OF_DAY = `Close the operator's day and reply with a single message.
78
+
79
+ Call capabilities-here first and include only the parts whose surface is enabled.
80
+
81
+ Waiting on the operator: list unsent drafts with email-draft-list. A draft written today and still unsent is the single most common thing that falls through, so name each one.
82
+ Overdue: list work that is past due or due today and still open with work-list.
83
+ Tomorrow: list tomorrow's appointments with outlook-calendar-list or google-calendar-list, and schedule-list for anything booked in the graph.
84
+
85
+ Say what is unfinished and what tomorrow looks like, in that order, in plain sentences. Do not congratulate, do not summarise the day back, do not pad the message to look thorough.
86
+
87
+ If nothing is waiting, nothing is overdue and tomorrow is empty, end the turn without replying.`;
88
+
89
+ const APPOINTMENT_REMINDER = `Remind the people attending an appointment that is coming up, so nobody is reminded twice and nobody is missed.
90
+
91
+ Call capabilities-here first. If neither a mail plugin nor a messaging channel is enabled, end the turn without replying.
92
+
93
+ Find appointments starting within the next reminder window with schedule-list, and read each one's attendees. Resolve each attendee to a person and a contact route with contact-lookup. An attendee you cannot resolve to a route is not a failure to work around: leave them, and say so at the end.
94
+
95
+ Send each attendee one reminder on the route they are already reachable on: email-send for a mailbox, whatsapp-reply or the Telegram message tool for a messaging thread that already exists. Carry the time, the place and what the appointment is about. Do not open a new conversation with someone who has never messaged the business.
96
+
97
+ Send at most one reminder per attendee per appointment. Before sending, check the appointment's notes for a reminder already recorded, and record the one you send there.
98
+
99
+ Reply with one line naming who was reminded and who could not be reached. If no appointment falls in the window, end the turn without replying.`;
100
+
101
+ const COMMITMENT_CHASE = `Find the promises the business has made and not kept, and the promises made to it that nobody has kept.
102
+
103
+ Call capabilities-here first and use only the surfaces it reports.
104
+
105
+ Outbound: search sent mail with email-search for messages where the business undertook to do something, and check whether the thing happened. A promise with a date attached and no follow-up is the case worth surfacing.
106
+ Inbound: find threads where the business asked for something and received no reply. Age matters more than volume; a three-week silence is worth naming and a two-day one is not.
107
+ Work: list items past their due date with work-list.
108
+ Context: check memory-search for what was previously agreed before deciding something has been dropped, so a commitment already met elsewhere is not chased again.
109
+
110
+ Reply with the short list, each item saying what was promised, by whom, and how long it has been outstanding. Judgement is the point here, not coverage: three real items beat thirty possible ones.
111
+
112
+ If nothing has been dropped, end the turn without replying.`;
113
+
114
+ const CALENDAR_RECONCILE = `Reconcile the provider calendars against the appointments held in the graph, so the operator's diary and the agent's view of it are the same diary.
115
+
116
+ Call capabilities-here first. If no calendar surface is enabled, end the turn without replying.
117
+
118
+ Read the provider side with outlook-calendar-list or google-calendar-list, and the graph side with schedule-list, over the same window. Compare them.
119
+
120
+ An appointment on the provider calendar with no counterpart in the graph is invisible to every other routine: write it with schedule-event. An appointment in the graph that has been cancelled provider-side should be marked cancelled, not deleted, so its history survives. Where the two disagree on time or attendees, the provider calendar is authoritative, because that is the one the operator edits.
121
+
122
+ If the account has a busy-time sync configured, run schedule-connector-busy-sync so availability reflects what was just reconciled.
123
+
124
+ Reply only when something was actually changed, naming what and why. A clean reconcile ends the turn without replying, every time. This routine runs often, so a message on every clean run trains the operator to ignore it.`;
125
+
126
+ const CONTACT_RECONCILE = `Reconcile the people the business actually deals with against the people it has recorded.
127
+
128
+ Call capabilities-here first. If neither a mail plugin nor the contacts plugin is enabled, end the turn without replying.
129
+
130
+ Find the counterparties in recent correspondence with email-graph-query, and on the Microsoft side read the address book with outlook-contacts-list. Read the recorded people with contact-list.
131
+
132
+ Someone corresponded with repeatedly and never recorded should be created with contact-create. Someone recorded with a stale route, a changed employer or a missing name should be updated with contact-update, taking the newer value from the correspondence.
133
+
134
+ Two rules keep this from making the graph worse. A single inbound message is not a relationship, so do not create a contact from one. And two records that look like the same person may be two people, so surface the possible duplicate rather than merging it.
135
+
136
+ Reply only when records were created or updated, naming the counts and anything ambiguous you left alone. A clean reconcile ends the turn without replying.`;
137
+
138
+ const CRM_RECONCILE = `Reconcile whatever operational system this business runs against the graph, so the agent answers from the same records the operator works in.
139
+
140
+ Call capabilities-here first and read the registered connectors with connector-register. If none is registered, end the turn without replying. This routine is deliberately unopinionated about which system that is: read what the connector actually exposes rather than assuming a shape.
141
+
142
+ Pull the records that changed since the last run with connector-call. For each, decide whether the graph already holds it. Write what is genuinely new or genuinely changed with memory-write, and leave the rest alone.
143
+
144
+ The connector is the system of record. Where the graph disagrees, the graph is stale and the connector wins. Never write back to the connector from here: this routine reads.
145
+
146
+ Reply only when something changed, in one or two lines. A run with nothing to bring across ends the turn without replying.`;
147
+
148
+ const FINANCE_RECONCILE = `Reconcile the accounting system against the ledger held in the graph.
149
+
150
+ Call capabilities-here first. If no accounting connector is enabled, end the turn without replying.
151
+
152
+ Read the accounting side with quickbooks-query over the period since the last run. Reconcile it against the internal ledger with ledger-reconcile, then read the resulting position with ledger-balance.
153
+
154
+ Report only what an operator would act on: entries present on one side and not the other, amounts that disagree, and anything unreconciled long enough to be a problem rather than a timing difference. A difference explained by a payment still clearing is not a discrepancy.
155
+
156
+ Never adjust an entry to make the two sides agree. An unexplained difference is the finding; silencing it destroys the only evidence that something is wrong.
157
+
158
+ Reply with the discrepancies and the closing position. If everything reconciles, end the turn without replying.`;
159
+
160
+ const WEEKLY_DIGEST = `Write the week in review and reply with it as a single message.
161
+
162
+ Call capabilities-here first and cover only the surfaces that are enabled.
163
+
164
+ Correspondence: what came in and what went out that mattered, from email-search or outlook-mail-search across the week.
165
+ Diary: what happened and what is coming, from outlook-calendar-list, google-calendar-list and schedule-list.
166
+ Work: what was completed, what slipped, what is still open, from work-list.
167
+ Systems: if a connector is registered, what changed in it over the week, from connector-call.
168
+ Context: check memory-search for what was said last week, so the digest reports movement rather than restating a standing position.
169
+
170
+ This is the one routine written for a person with a few minutes, not for completeness. Say what changed, what is stuck, and what next week turns on. Three paragraphs at most. No section headings, no counts presented as achievements, no restating the categories above.
171
+
172
+ If the week was genuinely empty, end the turn without replying.`;
173
+
174
+ const CHANNEL_LINK_CHECK = `Check whether the business's messaging links are still up, and speak only when one is down.
175
+
176
+ Call capabilities-here first. If no messaging channel is enabled, end the turn without replying.
177
+
178
+ Read the link state with whatsapp-status. It reports, per link, whether it is connected, the number it is paired to, how many reconnect attempts it has made, and the error it last failed on.
179
+
180
+ If every link is connected, end the turn without replying. A message on a healthy check is what trains an operator to ignore this routine, and an ignored check is worth less than no check.
181
+
182
+ When a link is down, reply with one message naming the number it is paired to, the exact error it last reported, and how long it has been down. Say plainly whether the platform is still retrying it or has stopped. A link that was logged out, or replaced by another device, will not come back on its own: re-pairing needs someone holding the phone, so say that rather than implying it will recover by itself.
183
+
184
+ Never disconnect a link and never begin a re-pair from here. This routine reports; the remedy is a person's decision.`;
185
+
186
+ /** The eleven. Order is the display order on `/routines` before the operator
187
+ * retimes anything: the daily rhythm first, then the reconciles, then the
188
+ * weekly, then the standing check. */
189
+ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
190
+ { key: "start-of-day", name: "Start of day briefing", recurrence: "30 7 * * 1-5", prompt: START_OF_DAY },
191
+ { key: "inbound-check", name: "Working-hours inbound check", recurrence: "*/30 9-17 * * 1-5", prompt: INBOUND_CHECK },
192
+ { key: "end-of-day", name: "End of day wrap-up", recurrence: "0 18 * * 1-5", prompt: END_OF_DAY },
193
+ { key: "appointment-reminder", name: "Appointment reminders", recurrence: "0 * * * *", prompt: APPOINTMENT_REMINDER },
194
+ { key: "commitment-chase", name: "Commitment chase", recurrence: "0 10 * * 2", prompt: COMMITMENT_CHASE },
195
+ { key: "calendar-reconcile", name: "Calendar reconcile", recurrence: "15 */4 * * *", prompt: CALENDAR_RECONCILE },
196
+ { key: "contact-reconcile", name: "Contact reconcile", recurrence: "45 6 * * 1-5", prompt: CONTACT_RECONCILE },
197
+ { key: "crm-reconcile", name: "Operational system reconcile", recurrence: "0 3 * * *", prompt: CRM_RECONCILE },
198
+ { key: "finance-reconcile", name: "Finance reconcile", recurrence: "0 4 * * 1", prompt: FINANCE_RECONCILE },
199
+ { key: "weekly-digest", name: "Weekly digest", recurrence: "0 16 * * 5", prompt: WEEKLY_DIGEST },
200
+ { key: "channel-link-check", name: "Channel link check", recurrence: "*/15 * * * *", prompt: CHANNEL_LINK_CHECK },
201
+ ];
202
+
203
+ /** Every roster key, in roster order. The scheduling heartbeat's `op=roster`
204
+ * drift check reconciles this expected set against what is actually in the
205
+ * graph, so it is exported rather than re-derived there. */
206
+ export const ROUTINE_ROSTER_KEYS: readonly string[] = ROUTINE_ROSTER.map((r) => r.key);
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Task 2130 — the install/upgrade entry point for the routine-roster seed.
3
+ *
4
+ * `platform/scripts/seed-neo4j.sh` is bash driving cypher-shell and cannot
5
+ * import the roster, so it invokes this instead. Everything about the seed —
6
+ * the MERGE, the classification, the whole `[routine-seed]` lifecycle — lives
7
+ * in `index.ts` and is shared verbatim with the sub-account path in the admin
8
+ * plugin. This file is only the process boundary: read the environment,
9
+ * connect, call the seed, decide the exit code.
10
+ *
11
+ * This runs on every install AND every upgrade, which is what carries the
12
+ * roster to the existing fleet rather than to new installs alone.
13
+ *
14
+ * NEO4J_URI=… NEO4J_PASSWORD=… ROUTINE_SEED_ACCOUNT_ID=… node dist/seed-cli.js
15
+ *
16
+ * Exit codes:
17
+ * 0 the roster is present and complete (`expected === actual`)
18
+ * 1 a required variable is missing, Neo4j refused, or the post-condition
19
+ * read came back short
20
+ */
21
+ import neo4j from "neo4j-driver";
22
+ import { acctTag, seedRoutineRoster } from "./index.js";
23
+
24
+ function requireEnv(name: string): string {
25
+ const value = process.env[name];
26
+ if (!value || value.trim() === "") {
27
+ process.stderr.write(`[routine-seed] op=abort reason=missing-env var=${name}\n`);
28
+ process.exit(1);
29
+ }
30
+ return value;
31
+ }
32
+
33
+ async function main(): Promise<void> {
34
+ const uri = requireEnv("NEO4J_URI");
35
+ const password = requireEnv("NEO4J_PASSWORD");
36
+ const accountId = requireEnv("ROUTINE_SEED_ACCOUNT_ID");
37
+ const user = process.env.NEO4J_USER ?? "neo4j";
38
+
39
+ const driver = neo4j.driver(uri, neo4j.auth.basic(user, password));
40
+ const session = driver.session();
41
+ try {
42
+ const report = await seedRoutineRoster({ session, accountId });
43
+ // The read-back is the gate, not the fact that the statements ran. A seed
44
+ // that issued ten MERGEs and left nine rows in the graph has failed, and
45
+ // the install must say so here rather than leave a short roster to be
46
+ // noticed later by the heartbeat's op=roster drift check.
47
+ if (report.verify.actual < report.verify.expected) {
48
+ process.stderr.write(
49
+ `[routine-seed] op=abort acct=${acctTag(accountId)} reason=short-roster ` +
50
+ `expected=${report.verify.expected} actual=${report.verify.actual}\n`,
51
+ );
52
+ process.exitCode = 1;
53
+ }
54
+ } finally {
55
+ await session.close();
56
+ await driver.close();
57
+ }
58
+ }
59
+
60
+ main().catch((err) => {
61
+ process.stderr.write(
62
+ `[routine-seed] op=abort reason=error detail=${err instanceof Error ? err.message : String(err)}\n`,
63
+ );
64
+ process.exit(1);
65
+ });
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["src"],
8
+ "exclude": ["src/__tests__"]
9
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ globals: false,
7
+ include: ["src/__tests__/**/*.test.ts"],
8
+ },
9
+ });
@@ -33,8 +33,8 @@
33
33
  "note": "Workflow composition."
34
34
  },
35
35
  "RUN_OF": {
36
- "direction": "(WorkflowRun)-[:RUN_OF]->(Workflow)",
37
- "note": "Workflow execution instance."
36
+ "direction": "(WorkflowRun)-[:RUN_OF]->(Workflow) | (RoutineRun)-[:RUN_OF]->(Event)",
37
+ "note": "Execution instance. Two shapes: a workflow run against its workflow, and a routine run against its scheduled event (Task 2136)."
38
38
  },
39
39
  "HAS_SECTION": {
40
40
  "direction": "(KnowledgeDocument)-[:HAS_SECTION]->(Section)",
@@ -409,6 +409,7 @@ OPTIONS {
409
409
  // UserMessage, AssistantMessage, ToolCall
410
410
  // - Tasks/projects/events: Task, Project, Event, Meeting, Attachment
411
411
  // - Workflows: Workflow, WorkflowStep, WorkflowRun, StepResult
412
+ // - Routine runs (Task 2136): RoutineRun
412
413
  // - Email: EmailAccount (config node only — email threads land on
413
414
  // :ConversationArchive {source:'email'} since Task 426)
414
415
  // - CV/career sublabels: Position, Credential
@@ -472,7 +473,7 @@ FOR (n:LocalBusiness|Service|PriceSpecification|OpeningHoursSpecification|Organi
472
473
  |KnowledgeDocument|ConversationArchive|Section|Chunk|DigitalDocument|CreativeWork|Question|FAQPage|DefinedTerm|Review|ImageObject
473
474
  |Conversation|AdminConversation|PublicConversation|Message|UserMessage|AssistantMessage|ToolCall
474
475
  |Task|Project|Event|Meeting|Attachment
475
- |Workflow|WorkflowStep|WorkflowRun|StepResult
476
+ |Workflow|WorkflowStep|WorkflowRun|StepResult|RoutineRun
476
477
  |EmailAccount
477
478
  |Position|Credential|Agent|Idea|Concept
478
479
  |VoiceProfile|VoiceEdit|SocialPost|AEOAudit|Page
@@ -775,6 +776,29 @@ FOR (r:WorkflowRun) ON (r.accountId);
775
776
  CREATE INDEX step_result_run IF NOT EXISTS
776
777
  FOR (sr:StepResult) ON (sr.runId);
777
778
 
779
+ // ----------------------------------------------------------
780
+ // RoutineRun — execution history for one routine fire (Task 2136).
781
+ // Linked (r:RoutineRun)-[:RUN_OF]->(e:Event), the same shape
782
+ // WorkflowRun uses against Workflow. Before this label a fire
783
+ // wrote five last-write-wins scalars onto the Event itself, so
784
+ // firing N+1 destroyed firing N and no surface could show what
785
+ // a run produced.
786
+ // `startedAt` is indexed because the 30-day retention sweep and
787
+ // the run-census both range over it every 120 s.
788
+ // ----------------------------------------------------------
789
+
790
+ CREATE CONSTRAINT routine_run_id_unique IF NOT EXISTS
791
+ FOR (r:RoutineRun) REQUIRE r.runId IS UNIQUE;
792
+
793
+ CREATE INDEX routine_run_event IF NOT EXISTS
794
+ FOR (r:RoutineRun) ON (r.eventId);
795
+
796
+ CREATE INDEX routine_run_account IF NOT EXISTS
797
+ FOR (r:RoutineRun) ON (r.accountId);
798
+
799
+ CREATE INDEX routine_run_started IF NOT EXISTS
800
+ FOR (r:RoutineRun) ON (r.startedAt);
801
+
778
802
  // ----------------------------------------------------------
779
803
  // UserProfile node — structured knowledge about the business owner
780
804
  // Platform-native (no Schema.org equivalent). One per (accountId, userId).
@@ -6,11 +6,12 @@
6
6
  "services/*"
7
7
  ],
8
8
  "dependencies": {
9
+ "neo4j-driver": "^5.28.1",
9
10
  "pdf-lib": "^1.17.1"
10
11
  },
11
12
  "scripts": {
12
- "build": "tsc -p lib/account-schema-regions/tsconfig.json && tsc -p lib/models/tsconfig.json && tsc -p lib/mcp-spawn-tee/tsconfig.json && tsc -p lib/mcp-lifeline/tsconfig.json && tsc -p lib/mcp-eager/tsconfig.json && tsc -p lib/account-enumeration/tsconfig.json && tsc -p lib/account-scope/tsconfig.json && tsc -p lib/graph-write/tsconfig.json && tsc -p lib/ledger-core/tsconfig.json && tsc -p lib/embed-client/tsconfig.json && tsc -p lib/graph-mcp/tsconfig.json && tsc -p lib/graph-trash/tsconfig.json && tsc -p lib/active-rules/tsconfig.json && tsc -p lib/admin-conversation-purge/tsconfig.json && tsc -p lib/graph-search/tsconfig.json && tsc -p lib/graph-style/tsconfig.json && tsc -p lib/device-url/tsconfig.json && tsc -p lib/brand-templating/tsconfig.json && tsc -p lib/entitlement/tsconfig.json && tsc -p lib/task-secrets/tsconfig.json && tsc -p lib/admins-write/tsconfig.json && tsc -p lib/admin-access-password/tsconfig.json && tsc -p lib/persistent-components/tsconfig.json && tsc -p lib/require-port-env/tsconfig.json && tsc -p lib/aeo-llms-txt-writer/tsconfig.json && tsc -p lib/obsidian-parser/tsconfig.json && tsc -p lib/storage-broker/tsconfig.json && tsc -p services/claude-session-manager/tsconfig.json && tsc -p services/whatsapp-channel/tsconfig.json && tsc -p services/webchat-channel/tsconfig.json && tsc -p services/telegram-channel/tsconfig.json && NODE_OPTIONS='--max-old-space-size=8192' tsc -b plugins/*/mcp/tsconfig.json",
13
- "build:lib": "tsc -p lib/account-schema-regions/tsconfig.json && tsc -p lib/models/tsconfig.json && tsc -p lib/mcp-spawn-tee/tsconfig.json && tsc -p lib/mcp-lifeline/tsconfig.json && tsc -p lib/mcp-eager/tsconfig.json && tsc -p lib/account-enumeration/tsconfig.json && tsc -p lib/account-scope/tsconfig.json && tsc -p lib/graph-write/tsconfig.json && tsc -p lib/ledger-core/tsconfig.json && tsc -p lib/embed-client/tsconfig.json && tsc -p lib/graph-mcp/tsconfig.json && tsc -p lib/graph-trash/tsconfig.json && tsc -p lib/active-rules/tsconfig.json && tsc -p lib/admin-conversation-purge/tsconfig.json && tsc -p lib/graph-search/tsconfig.json && tsc -p lib/graph-style/tsconfig.json && tsc -p lib/device-url/tsconfig.json && tsc -p lib/brand-templating/tsconfig.json && tsc -p lib/entitlement/tsconfig.json && tsc -p lib/task-secrets/tsconfig.json && tsc -p lib/admins-write/tsconfig.json && tsc -p lib/admin-access-password/tsconfig.json && tsc -p lib/persistent-components/tsconfig.json && tsc -p lib/require-port-env/tsconfig.json && tsc -p lib/aeo-llms-txt-writer/tsconfig.json && tsc -p lib/obsidian-parser/tsconfig.json && tsc -p lib/storage-broker/tsconfig.json",
13
+ "build": "tsc -p lib/account-schema-regions/tsconfig.json && tsc -p lib/models/tsconfig.json && tsc -p lib/mcp-spawn-tee/tsconfig.json && tsc -p lib/mcp-lifeline/tsconfig.json && tsc -p lib/mcp-eager/tsconfig.json && tsc -p lib/account-enumeration/tsconfig.json && tsc -p lib/account-scope/tsconfig.json && tsc -p lib/graph-write/tsconfig.json && tsc -p lib/ledger-core/tsconfig.json && tsc -p lib/embed-client/tsconfig.json && tsc -p lib/graph-mcp/tsconfig.json && tsc -p lib/graph-trash/tsconfig.json && tsc -p lib/active-rules/tsconfig.json && tsc -p lib/admin-conversation-purge/tsconfig.json && tsc -p lib/graph-search/tsconfig.json && tsc -p lib/graph-style/tsconfig.json && tsc -p lib/device-url/tsconfig.json && tsc -p lib/brand-templating/tsconfig.json && tsc -p lib/entitlement/tsconfig.json && tsc -p lib/task-secrets/tsconfig.json && tsc -p lib/admins-write/tsconfig.json && tsc -p lib/admin-access-password/tsconfig.json && tsc -p lib/persistent-components/tsconfig.json && tsc -p lib/require-port-env/tsconfig.json && tsc -p lib/aeo-llms-txt-writer/tsconfig.json && tsc -p lib/obsidian-parser/tsconfig.json && tsc -p lib/storage-broker/tsconfig.json && tsc -p lib/routine-templates/tsconfig.json && tsc -p services/claude-session-manager/tsconfig.json && tsc -p services/whatsapp-channel/tsconfig.json && tsc -p services/webchat-channel/tsconfig.json && tsc -p services/telegram-channel/tsconfig.json && NODE_OPTIONS='--max-old-space-size=8192' tsc -b plugins/*/mcp/tsconfig.json",
14
+ "build:lib": "tsc -p lib/account-schema-regions/tsconfig.json && tsc -p lib/models/tsconfig.json && tsc -p lib/mcp-spawn-tee/tsconfig.json && tsc -p lib/mcp-lifeline/tsconfig.json && tsc -p lib/mcp-eager/tsconfig.json && tsc -p lib/account-enumeration/tsconfig.json && tsc -p lib/account-scope/tsconfig.json && tsc -p lib/graph-write/tsconfig.json && tsc -p lib/ledger-core/tsconfig.json && tsc -p lib/embed-client/tsconfig.json && tsc -p lib/graph-mcp/tsconfig.json && tsc -p lib/graph-trash/tsconfig.json && tsc -p lib/active-rules/tsconfig.json && tsc -p lib/admin-conversation-purge/tsconfig.json && tsc -p lib/graph-search/tsconfig.json && tsc -p lib/graph-style/tsconfig.json && tsc -p lib/device-url/tsconfig.json && tsc -p lib/brand-templating/tsconfig.json && tsc -p lib/entitlement/tsconfig.json && tsc -p lib/task-secrets/tsconfig.json && tsc -p lib/admins-write/tsconfig.json && tsc -p lib/admin-access-password/tsconfig.json && tsc -p lib/persistent-components/tsconfig.json && tsc -p lib/require-port-env/tsconfig.json && tsc -p lib/aeo-llms-txt-writer/tsconfig.json && tsc -p lib/obsidian-parser/tsconfig.json && tsc -p lib/storage-broker/tsconfig.json && tsc -p lib/routine-templates/tsconfig.json",
14
15
  "gen:canonical-tools": "node scripts/generate-canonical-tool-names.mjs",
15
16
  "build:memory": "tsc -p plugins/memory/mcp/tsconfig.json",
16
17
  "build:contacts": "tsc -p plugins/contacts/mcp/tsconfig.json",
@@ -14,7 +14,7 @@ tools:
14
14
  riskClass: read
15
15
  - name: admin-hostname
16
16
  publicAllowlist: false
17
- adminAllowlist: false
17
+ adminAllowlist: true
18
18
  riskClass: read
19
19
  - name: publish-site
20
20
  publicAllowlist: false
@@ -30,7 +30,7 @@ tools:
30
30
  riskClass: write_local
31
31
  - name: capabilities-here
32
32
  publicAllowlist: false
33
- adminAllowlist: false
33
+ adminAllowlist: true
34
34
  riskClass: read
35
35
  - name: account-update
36
36
  publicAllowlist: false
@@ -29,6 +29,10 @@ import { resolveCapabilitiesHere } from "./tools/capabilities-here.js";
29
29
  import { startCpuTriage, readCpuTriage } from "./tools/cpu-triage.js";
30
30
  import { runCatalogueCensus } from "./lib/catalogue-census.js";
31
31
  import { lifelineTool } from "../../../../lib/mcp-lifeline/dist/index.js";
32
+ // Task 2130 — the same roster and the same MERGE seed-neo4j.sh runs for the
33
+ // house account. Shared rather than reimplemented: two copies would drift, and
34
+ // the drift would surface only as "the sub-accounts have different routines".
35
+ import { seedRoutineRoster } from "../../../../lib/routine-templates/dist/index.js";
32
36
  import { listAccountsFromDir, isHouseAccount, archiveAccountDir, provisionClientAccount, findHouseAccount, getChannelRoutingAccountId, setChannelRoutingAccountId, seedAccountGraphRoot, isPlaceholderOwnerName, isBlankBusinessName, isValidTimeZone, refuseClientAdminAdd, readHouseAdminUserIds, setManagingAdmin, findClientAccountsManagedBy, reassignManagingAdmin, ACCOUNT_NODE_COUNT_CYPHER, ACCOUNT_PURGE_CYPHER, classifyManagingAdmin, ownerNameStatus, readManagingAdminUserId, setOwnerName, } from "./tools/account-lifecycle.js";
33
37
  function refusalGuidance(kind) {
34
38
  switch (kind) {
@@ -3544,7 +3548,41 @@ eagerTool(server, "account_create", "Provision a new CLIENT sub-account on this
3544
3548
  const managedNote = managingAdminUserId
3545
3549
  ? `managed by admin ${managingAdminUserId}`
3546
3550
  : `with no managing admin (its passive-intake tasks route to the primary admin; use account_reassign_admin to assign one)`;
3547
- return { content: [{ type: "text", text: `Created client sub-account ${newId}, ${managedNote}. Switch to it from the sub-account picker to work in its data.` }] };
3551
+ // Task 2130 seed the routine roster onto the new sub-account. Without
3552
+ // this a client sub-account ships with a blank /routines page while the
3553
+ // house account has ten, because seed-neo4j.sh only ever reaches the one
3554
+ // account its resolver returns.
3555
+ //
3556
+ // Last, and never a create failure. At this point the account exists, is
3557
+ // rooted and carries its managing admin, so reporting a generic failure
3558
+ // would push the operator to retry and orphan a second account. It also
3559
+ // runs after seedAccountGraphRoot on purpose: the seed resolves the
3560
+ // timezone by reading back the owner :UserProfile that seed just wrote.
3561
+ // A shortfall is reported in the success text and on stderr, where the
3562
+ // heartbeat's op=roster drift check will keep reporting it every tick
3563
+ // until it is fixed.
3564
+ let rosterNote = "";
3565
+ const rosterSession = getSession();
3566
+ try {
3567
+ const roster = await seedRoutineRoster({ session: rosterSession, accountId: newId });
3568
+ if (roster.verify.actual < roster.verify.expected) {
3569
+ process.stderr.write(`[account-lifecycle] op=create-roster accountId=${newId} result=short ` +
3570
+ `expected=${roster.verify.expected} actual=${roster.verify.actual}\n`);
3571
+ rosterNote = ` Its Routines page is incomplete (${roster.verify.actual} of ${roster.verify.expected} seeded) — re-running the installer re-seeds every account.`;
3572
+ }
3573
+ else {
3574
+ process.stderr.write(`[account-lifecycle] op=create-roster accountId=${newId} result=ok routines=${roster.verify.actual}\n`);
3575
+ }
3576
+ }
3577
+ catch (err) {
3578
+ const msg = err instanceof Error ? err.message : String(err);
3579
+ process.stderr.write(`[account-lifecycle] op=create-roster accountId=${newId} result=failed error=${msg}\n`);
3580
+ rosterNote = ` Its Routines page is empty — the routine seed failed (${msg}). Re-running the installer re-seeds every account.`;
3581
+ }
3582
+ finally {
3583
+ await rosterSession.close();
3584
+ }
3585
+ return { content: [{ type: "text", text: `Created client sub-account ${newId}, ${managedNote}. Switch to it from the sub-account picker to work in its data.${rosterNote}` }] };
3548
3586
  }
3549
3587
  catch (err) {
3550
3588
  const msg = err instanceof Error ? err.message : String(err);