@rubytech/create-maxy-code 0.1.543 → 0.1.545

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 (280) hide show
  1. package/dist/__tests__/public-instruction-seed.test.js +102 -0
  2. package/dist/index.js +10 -0
  3. package/dist/public-instruction-seed.js +70 -0
  4. package/package.json +1 -1
  5. package/payload/platform/plugins/admin/PLUGIN.md +2 -0
  6. package/payload/platform/plugins/admin/hooks/__tests__/public-tool-surface.test.sh +173 -0
  7. package/payload/platform/plugins/admin/hooks/public-tool-surface.sh +123 -0
  8. package/payload/platform/plugins/admin/mcp/dist/tools/agent-write.d.ts.map +1 -1
  9. package/payload/platform/plugins/admin/mcp/dist/tools/agent-write.js +13 -1
  10. package/payload/platform/plugins/admin/mcp/dist/tools/agent-write.js.map +1 -1
  11. package/payload/platform/plugins/admin/skills/channel-instruction/SKILL.md +60 -0
  12. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +6 -1
  13. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +12 -0
  14. package/payload/platform/plugins/docs/references/channel-wake-and-prompt.md +2 -0
  15. package/payload/platform/plugins/docs/references/internals.md +2 -0
  16. package/payload/platform/plugins/docs/references/platform.md +1 -0
  17. package/payload/platform/plugins/scheduling/PLUGIN.md +1 -1
  18. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.d.ts +2 -0
  19. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.d.ts.map +1 -0
  20. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.js +80 -0
  21. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.js.map +1 -0
  22. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.d.ts +2 -0
  23. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.d.ts.map +1 -0
  24. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.js +32 -0
  25. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.js.map +1 -0
  26. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.d.ts +67 -0
  27. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.d.ts.map +1 -0
  28. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.js +88 -0
  29. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.js.map +1 -0
  30. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts +2 -1
  31. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts.map +1 -1
  32. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js +59 -54
  33. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js.map +1 -1
  34. package/payload/platform/scripts/__tests__/public-surface-registered.test.sh +102 -0
  35. package/payload/platform/scripts/lib/__tests__/account-settings-public-surface.test.sh +109 -0
  36. package/payload/platform/scripts/lib/account-settings-public-surface.sh +109 -0
  37. package/payload/platform/scripts/lib/provision-account-dir.sh +6 -3
  38. package/payload/platform/scripts/setup-account.sh +14 -0
  39. package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
  40. package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
  41. package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts +22 -0
  42. package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts.map +1 -1
  43. package/payload/platform/services/claude-session-manager/dist/fs-watcher.js +23 -1
  44. package/payload/platform/services/claude-session-manager/dist/fs-watcher.js.map +1 -1
  45. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  46. package/payload/platform/services/claude-session-manager/dist/http-server.js +157 -13
  47. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  48. package/payload/platform/services/claude-session-manager/dist/index.js +86 -40
  49. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  50. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +1 -1
  51. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  52. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +64 -1
  53. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  54. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.d.ts +24 -3
  55. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.d.ts.map +1 -1
  56. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.js +29 -3
  57. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.js.map +1 -1
  58. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.d.ts +27 -0
  59. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.d.ts.map +1 -1
  60. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.js +32 -0
  61. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.js.map +1 -1
  62. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts +15 -0
  63. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts.map +1 -1
  64. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js +8 -0
  65. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js.map +1 -1
  66. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.d.ts +18 -9
  67. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.d.ts.map +1 -1
  68. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.js +18 -9
  69. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.js.map +1 -1
  70. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.d.ts +60 -0
  71. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.d.ts.map +1 -0
  72. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.js +93 -0
  73. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.js.map +1 -0
  74. package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts +12 -1
  75. package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts.map +1 -1
  76. package/payload/platform/services/claude-session-manager/dist/stuck-turn.js +41 -13
  77. package/payload/platform/services/claude-session-manager/dist/stuck-turn.js.map +1 -1
  78. package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -1
  79. package/payload/platform/services/telegram-channel/dist/instructions.js +17 -16
  80. package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -1
  81. package/payload/platform/services/telegram-channel/dist/notification.d.ts +10 -4
  82. package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -1
  83. package/payload/platform/services/telegram-channel/dist/notification.js +19 -12
  84. package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -1
  85. package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
  86. package/payload/platform/services/telegram-channel/dist/server.js +3 -0
  87. package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
  88. package/payload/platform/services/webchat-channel/dist/instructions.js +21 -21
  89. package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -1
  90. package/payload/platform/services/webchat-channel/dist/notification.d.ts +9 -2
  91. package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -1
  92. package/payload/platform/services/webchat-channel/dist/notification.js +20 -10
  93. package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -1
  94. package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
  95. package/payload/platform/services/webchat-channel/dist/server.js +5 -0
  96. package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
  97. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +43 -23
  98. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  99. package/payload/platform/services/whatsapp-channel/dist/notification.js +86 -35
  100. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  101. package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
  102. package/payload/platform/services/whatsapp-channel/dist/server.js +15 -6
  103. package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
  104. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +17 -6
  105. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -1
  106. package/payload/platform/services/whatsapp-channel/dist/targets.js +13 -2
  107. package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -1
  108. package/payload/platform/templates/agents/admin/INSTRUCTION.md +0 -15
  109. package/payload/server/{chunk-MGW536C5.js → chunk-CVUSUNXM.js} +1 -1
  110. package/payload/server/{chunk-BIHII3CT.js → chunk-DU7GPDJJ.js} +1 -0
  111. package/payload/server/{chunk-RSNVIN4G.js → chunk-X2RRMHVV.js} +1 -1
  112. package/payload/server/{manager-GJHKO7WW.js → manager-TI2YJQVZ.js} +2 -2
  113. package/payload/server/maxy-edge.js +2 -2
  114. package/payload/server/public/activity.html +5 -5
  115. package/payload/server/public/agents.html +4 -4
  116. package/payload/server/public/assets/{AdminLoginScreens-C1iXeR-9.js → AdminLoginScreens-BGKtDqAk.js} +1 -1
  117. package/payload/server/public/assets/AdminLoginScreens-BGKtDqAk.js.br +0 -0
  118. package/payload/server/public/assets/AdminLoginScreens-BGKtDqAk.js.gz +0 -0
  119. package/payload/server/public/assets/{AdminShell-BeIGNC1Q.js → AdminShell-DnfgsAQl.js} +1 -1
  120. package/payload/server/public/assets/AdminShell-DnfgsAQl.js.br +0 -0
  121. package/payload/server/public/assets/AdminShell-DnfgsAQl.js.gz +0 -0
  122. package/payload/server/public/assets/{activity-AaFvfwrZ.js → activity-ByJSut0Q.js} +1 -1
  123. package/payload/server/public/assets/activity-ByJSut0Q.js.br +0 -0
  124. package/payload/server/public/assets/activity-ByJSut0Q.js.gz +0 -0
  125. package/payload/server/public/assets/{admin-Bz34CZqL.js → admin-CkeJO6kA.js} +1 -1
  126. package/payload/server/public/assets/admin-CkeJO6kA.js.br +0 -0
  127. package/payload/server/public/assets/admin-CkeJO6kA.js.gz +0 -0
  128. package/payload/server/public/assets/{agents-N0z7qg8a.js → agents-D8phtRX5.js} +1 -1
  129. package/payload/server/public/assets/agents-D8phtRX5.js.br +0 -0
  130. package/payload/server/public/assets/agents-D8phtRX5.js.gz +0 -0
  131. package/payload/server/public/assets/{browser-_k-v0iky.js → browser-DQSTjdom.js} +1 -1
  132. package/payload/server/public/assets/browser-DQSTjdom.js.br +0 -0
  133. package/payload/server/public/assets/browser-DQSTjdom.js.gz +0 -0
  134. package/payload/server/public/assets/{calendar-D_DvVRJS.js → calendar-DFJu1XjP.js} +1 -1
  135. package/payload/server/public/assets/calendar-DFJu1XjP.js.br +0 -0
  136. package/payload/server/public/assets/calendar-DFJu1XjP.js.gz +0 -0
  137. package/payload/server/public/assets/chat-DUqtIsOt.js +1 -0
  138. package/payload/server/public/assets/chat-DUqtIsOt.js.br +0 -0
  139. package/payload/server/public/assets/chat-DUqtIsOt.js.gz +0 -0
  140. package/payload/server/public/assets/chevron-left-DFK18xVX.js +1 -0
  141. package/payload/server/public/assets/chevron-left-DFK18xVX.js.br +0 -0
  142. package/payload/server/public/assets/chevron-right-DJ4oaHoN.js +1 -0
  143. package/payload/server/public/assets/chevron-right-DJ4oaHoN.js.br +0 -0
  144. package/payload/server/public/assets/clock-wHIan2DW.js +1 -0
  145. package/payload/server/public/assets/clock-wHIan2DW.js.br +0 -0
  146. package/payload/server/public/assets/{copy-BDoxl3Oi.js → copy-lFFhXRGk.js} +1 -1
  147. package/payload/server/public/assets/copy-lFFhXRGk.js.br +0 -0
  148. package/payload/server/public/assets/copy-lFFhXRGk.js.gz +0 -0
  149. package/payload/server/public/assets/data-Cxv97ARy.js +1 -0
  150. package/payload/server/public/assets/data-Cxv97ARy.js.br +0 -0
  151. package/payload/server/public/assets/data-Cxv97ARy.js.gz +0 -0
  152. package/payload/server/public/assets/{file-text-DRGn4gjH.js → file-text-D2Y-bkNy.js} +1 -1
  153. package/payload/server/public/assets/file-text-D2Y-bkNy.js.br +0 -0
  154. package/payload/server/public/assets/file-text-D2Y-bkNy.js.gz +0 -0
  155. package/payload/server/public/assets/{graph-D7ECsLPs.js → graph-C-3yN6JD.js} +1 -1
  156. package/payload/server/public/assets/graph-C-3yN6JD.js.br +0 -0
  157. package/payload/server/public/assets/graph-C-3yN6JD.js.gz +0 -0
  158. package/payload/server/public/assets/{graph-labels-ClzmLEoK.js → graph-labels-DiaPLP27.js} +1 -1
  159. package/payload/server/public/assets/graph-labels-DiaPLP27.js.br +0 -0
  160. package/payload/server/public/assets/graph-labels-DiaPLP27.js.gz +0 -0
  161. package/payload/server/public/assets/{operator-jSdha7TP.js → operator-KuGPvSa9.js} +1 -1
  162. package/payload/server/public/assets/operator-KuGPvSa9.js.br +0 -0
  163. package/payload/server/public/assets/operator-KuGPvSa9.js.gz +0 -0
  164. package/payload/server/public/assets/{page-Cq4SkWbr.js → page-BhGeFXWA.js} +1 -1
  165. package/payload/server/public/assets/page-BhGeFXWA.js.br +0 -0
  166. package/payload/server/public/assets/page-BhGeFXWA.js.gz +0 -0
  167. package/payload/server/public/assets/{page-DrwRXi3K.js → page-EnbVC-yM.js} +1 -1
  168. package/payload/server/public/assets/page-EnbVC-yM.js.br +0 -0
  169. package/payload/server/public/assets/page-EnbVC-yM.js.gz +0 -0
  170. package/payload/server/public/assets/play-jZFZAG-t.js +1 -0
  171. package/payload/server/public/assets/play-jZFZAG-t.js.br +0 -0
  172. package/payload/server/public/assets/play-jZFZAG-t.js.gz +0 -0
  173. package/payload/server/public/assets/{public-D7MfkWvM.js → public-CdSgMNC7.js} +1 -1
  174. package/payload/server/public/assets/public-CdSgMNC7.js.br +0 -0
  175. package/payload/server/public/assets/public-CdSgMNC7.js.gz +0 -0
  176. package/payload/server/public/assets/{rotate-ccw-CaWP-njL.js → rotate-ccw-rTRuTqei.js} +1 -1
  177. package/payload/server/public/assets/rotate-ccw-rTRuTqei.js.br +0 -0
  178. package/payload/server/public/assets/rotate-ccw-rTRuTqei.js.gz +0 -0
  179. package/payload/server/public/assets/{routines-XTk0vJUD.js → routines-DNRxNRSQ.js} +1 -1
  180. package/payload/server/public/assets/routines-DNRxNRSQ.js.br +0 -0
  181. package/payload/server/public/assets/routines-DNRxNRSQ.js.gz +0 -0
  182. package/payload/server/public/assets/{skills-sjTaAr0v.js → skills-DFWtZNkW.js} +1 -1
  183. package/payload/server/public/assets/skills-DFWtZNkW.js.br +0 -0
  184. package/payload/server/public/assets/skills-DFWtZNkW.js.gz +0 -0
  185. package/payload/server/public/assets/{tasks-D0-qwWZR.js → tasks-B94AuKSy.js} +1 -1
  186. package/payload/server/public/assets/tasks-B94AuKSy.js.br +0 -0
  187. package/payload/server/public/assets/tasks-B94AuKSy.js.gz +0 -0
  188. package/payload/server/public/assets/{triangle-alert-BCndBPvE.js → triangle-alert-DtWUg6jR.js} +1 -1
  189. package/payload/server/public/assets/triangle-alert-DtWUg6jR.js.br +0 -0
  190. package/payload/server/public/assets/triangle-alert-DtWUg6jR.js.gz +0 -0
  191. package/payload/server/public/assets/{useCopyFeedback-BFMmBvVw.js → useCopyFeedback-CjKYO-Qf.js} +1 -1
  192. package/payload/server/public/assets/useCopyFeedback-CjKYO-Qf.js.br +0 -0
  193. package/payload/server/public/assets/useCopyFeedback-CjKYO-Qf.js.gz +0 -0
  194. package/payload/server/public/assets/{useMediaQuery-CXdUnGSe.css → useMediaQuery-DlOWP56H.css} +1 -1
  195. package/payload/server/public/assets/useMediaQuery-DlOWP56H.css.br +0 -0
  196. package/payload/server/public/assets/{useMediaQuery-CXdUnGSe.css.gz → useMediaQuery-DlOWP56H.css.gz} +0 -0
  197. package/payload/server/public/assets/{useVoiceRecorder-DmW6CW7B.js → useVoiceRecorder-BKFAYuzz.js} +1 -1
  198. package/payload/server/public/assets/useVoiceRecorder-BKFAYuzz.js.br +0 -0
  199. package/payload/server/public/assets/useVoiceRecorder-BKFAYuzz.js.gz +0 -0
  200. package/payload/server/public/assets/{wrench-BBl51xDU.js → wrench-Ct4kf-uv.js} +1 -1
  201. package/payload/server/public/assets/wrench-Ct4kf-uv.js.br +0 -0
  202. package/payload/server/public/assets/wrench-Ct4kf-uv.js.gz +0 -0
  203. package/payload/server/public/browser.html +4 -4
  204. package/payload/server/public/calendar.html +8 -8
  205. package/payload/server/public/chat.html +13 -13
  206. package/payload/server/public/data.html +11 -11
  207. package/payload/server/public/graph.html +9 -9
  208. package/payload/server/public/index.html +14 -14
  209. package/payload/server/public/operator.html +14 -14
  210. package/payload/server/public/public.html +13 -13
  211. package/payload/server/public/routines.html +6 -6
  212. package/payload/server/public/skills.html +5 -5
  213. package/payload/server/public/tasks.html +6 -6
  214. package/payload/server/server.js +48 -21
  215. package/payload/server/public/assets/AdminLoginScreens-C1iXeR-9.js.br +0 -0
  216. package/payload/server/public/assets/AdminLoginScreens-C1iXeR-9.js.gz +0 -0
  217. package/payload/server/public/assets/AdminShell-BeIGNC1Q.js.br +0 -0
  218. package/payload/server/public/assets/AdminShell-BeIGNC1Q.js.gz +0 -0
  219. package/payload/server/public/assets/activity-AaFvfwrZ.js.br +0 -0
  220. package/payload/server/public/assets/activity-AaFvfwrZ.js.gz +0 -0
  221. package/payload/server/public/assets/admin-Bz34CZqL.js.br +0 -0
  222. package/payload/server/public/assets/admin-Bz34CZqL.js.gz +0 -0
  223. package/payload/server/public/assets/agents-N0z7qg8a.js.br +0 -0
  224. package/payload/server/public/assets/agents-N0z7qg8a.js.gz +0 -0
  225. package/payload/server/public/assets/browser-_k-v0iky.js.br +0 -0
  226. package/payload/server/public/assets/browser-_k-v0iky.js.gz +0 -0
  227. package/payload/server/public/assets/calendar-D_DvVRJS.js.br +0 -0
  228. package/payload/server/public/assets/calendar-D_DvVRJS.js.gz +0 -0
  229. package/payload/server/public/assets/chat-BbAsvXL_.js +0 -1
  230. package/payload/server/public/assets/chat-BbAsvXL_.js.br +0 -1
  231. package/payload/server/public/assets/chat-BbAsvXL_.js.gz +0 -0
  232. package/payload/server/public/assets/chevron-left-trZmu0ZU.js +0 -1
  233. package/payload/server/public/assets/chevron-left-trZmu0ZU.js.br +0 -0
  234. package/payload/server/public/assets/chevron-right-BiGJuNSX.js +0 -1
  235. package/payload/server/public/assets/chevron-right-BiGJuNSX.js.br +0 -0
  236. package/payload/server/public/assets/clock-DAeRdj4p.js +0 -1
  237. package/payload/server/public/assets/clock-DAeRdj4p.js.br +0 -0
  238. package/payload/server/public/assets/clock-DAeRdj4p.js.gz +0 -0
  239. package/payload/server/public/assets/copy-BDoxl3Oi.js.br +0 -0
  240. package/payload/server/public/assets/copy-BDoxl3Oi.js.gz +0 -0
  241. package/payload/server/public/assets/data-DB6T1I-w.js +0 -1
  242. package/payload/server/public/assets/data-DB6T1I-w.js.br +0 -1
  243. package/payload/server/public/assets/data-DB6T1I-w.js.gz +0 -0
  244. package/payload/server/public/assets/file-text-DRGn4gjH.js.br +0 -0
  245. package/payload/server/public/assets/file-text-DRGn4gjH.js.gz +0 -0
  246. package/payload/server/public/assets/graph-D7ECsLPs.js.br +0 -0
  247. package/payload/server/public/assets/graph-D7ECsLPs.js.gz +0 -0
  248. package/payload/server/public/assets/graph-labels-ClzmLEoK.js.br +0 -0
  249. package/payload/server/public/assets/graph-labels-ClzmLEoK.js.gz +0 -0
  250. package/payload/server/public/assets/operator-jSdha7TP.js.br +0 -0
  251. package/payload/server/public/assets/operator-jSdha7TP.js.gz +0 -0
  252. package/payload/server/public/assets/page-Cq4SkWbr.js.br +0 -0
  253. package/payload/server/public/assets/page-Cq4SkWbr.js.gz +0 -0
  254. package/payload/server/public/assets/page-DrwRXi3K.js.br +0 -0
  255. package/payload/server/public/assets/page-DrwRXi3K.js.gz +0 -0
  256. package/payload/server/public/assets/play-CWyPEXiB.js +0 -1
  257. package/payload/server/public/assets/play-CWyPEXiB.js.br +0 -0
  258. package/payload/server/public/assets/play-CWyPEXiB.js.gz +0 -0
  259. package/payload/server/public/assets/public-D7MfkWvM.js.br +0 -0
  260. package/payload/server/public/assets/public-D7MfkWvM.js.gz +0 -0
  261. package/payload/server/public/assets/rotate-ccw-CaWP-njL.js.br +0 -0
  262. package/payload/server/public/assets/rotate-ccw-CaWP-njL.js.gz +0 -0
  263. package/payload/server/public/assets/routines-XTk0vJUD.js.br +0 -0
  264. package/payload/server/public/assets/routines-XTk0vJUD.js.gz +0 -0
  265. package/payload/server/public/assets/skills-sjTaAr0v.js.br +0 -0
  266. package/payload/server/public/assets/skills-sjTaAr0v.js.gz +0 -0
  267. package/payload/server/public/assets/tasks-D0-qwWZR.js.br +0 -0
  268. package/payload/server/public/assets/tasks-D0-qwWZR.js.gz +0 -0
  269. package/payload/server/public/assets/triangle-alert-BCndBPvE.js.br +0 -0
  270. package/payload/server/public/assets/triangle-alert-BCndBPvE.js.gz +0 -0
  271. package/payload/server/public/assets/useCopyFeedback-BFMmBvVw.js.br +0 -0
  272. package/payload/server/public/assets/useCopyFeedback-BFMmBvVw.js.gz +0 -0
  273. package/payload/server/public/assets/useMediaQuery-CXdUnGSe.css.br +0 -0
  274. package/payload/server/public/assets/useVoiceRecorder-DmW6CW7B.js.br +0 -0
  275. package/payload/server/public/assets/useVoiceRecorder-DmW6CW7B.js.gz +0 -0
  276. package/payload/server/public/assets/wrench-BBl51xDU.js.br +0 -0
  277. package/payload/server/public/assets/wrench-BBl51xDU.js.gz +0 -0
  278. /package/payload/server/public/assets/{useMediaQuery-q9BSy1Ld.js → useMediaQuery-BYIHo-xL.js} +0 -0
  279. /package/payload/server/public/assets/{useMediaQuery-q9BSy1Ld.js.br → useMediaQuery-BYIHo-xL.js.br} +0 -0
  280. /package/payload/server/public/assets/{useMediaQuery-q9BSy1Ld.js.gz → useMediaQuery-BYIHo-xL.js.gz} +0 -0
@@ -18,17 +18,37 @@
18
18
  * overlapping runs. Each run records the outcome to a local last-publish.json so
19
19
  * the server's audit tick can report snapshot age independent of this job.
20
20
  *
21
- * Observability — one [calendar-availability] op=publish line per run.
21
+ * Observability — one dated [calendar-availability] op=publish line per run,
22
+ * carrying d1Ms (time in D1, the bound is 60 s) and attempt (1 or 2).
22
23
  *
23
24
  * PLATFORM_ROOT=... MAXY_UI_INTERNAL_PORT=... PUBLISH_ACCOUNT_DIR=... \
24
25
  * PUBLISH_ACCOUNT_ID=... node dist/scripts/publish-availability.js
25
26
  */
26
- import { spawnSync } from "node:child_process";
27
- import { readFileSync, writeFileSync, existsSync, unlinkSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
27
+ import { readFileSync, writeFileSync, existsSync, unlinkSync, mkdirSync } from "node:fs";
28
28
  import { resolve, join, basename } from "node:path";
29
- import { homedir, tmpdir } from "node:os";
29
+ import { homedir } from "node:os";
30
30
  import { resolveHouseScopedToken } from "../lib/house-scoped-token.js";
31
31
  import { buildFreeBusyUrl } from "../lib/free-busy-url.js";
32
+ import { createD1Client } from "../lib/d1-command.js";
33
+ import { writeSnapshot } from "../lib/availability-snapshot.js";
34
+ /** Every line this dispatcher emits, dated.
35
+ *
36
+ * Task 2349 — the server spawns this script with `stdio: 'inherit'`, so its
37
+ * lines land in server.log beside the server's own timestamped audit lines
38
+ * while carrying no timestamp of their own. Dating the 2026-08-02 publish
39
+ * failure meant bracketing it against its neighbours by line number. */
40
+ function log(line) {
41
+ console.error(`${new Date().toISOString()} ${line}`);
42
+ }
43
+ /** One log-safe line from a failure message.
44
+ *
45
+ * The HEAD, not the tail. The D1 client's message opens with its context and
46
+ * the HTTP status (`scheduling: d1 query failed: 403 …`), so the first
47
+ * characters are the diagnosis and a long response body is the part worth
48
+ * dropping. Newlines and quotes collapse so the field stays on one line. */
49
+ function errField(message) {
50
+ return (message ?? "").replace(/[\n\r"]+/g, " ").slice(0, 200);
51
+ }
32
52
  function resolveConfigDir() {
33
53
  const platformRoot = process.env.PLATFORM_ROOT;
34
54
  if (!platformRoot)
@@ -121,13 +141,13 @@ function utcMidnight(now, addDays) {
121
141
  }
122
142
  async function main() {
123
143
  if (!acquireLock()) {
124
- console.error("[calendar-availability] op=publish result=skipped reason=lock-held");
144
+ log("[calendar-availability] op=publish result=skipped reason=lock-held");
125
145
  return;
126
146
  }
127
147
  try {
128
148
  const accountDir = process.env.PUBLISH_ACCOUNT_DIR;
129
149
  if (!accountDir) {
130
- console.error("[calendar-availability] op=publish result=skipped reason=no-account");
150
+ log("[calendar-availability] op=publish result=skipped reason=no-account");
131
151
  return;
132
152
  }
133
153
  const accountId = process.env.PUBLISH_ACCOUNT_ID ?? basename(accountDir);
@@ -141,44 +161,53 @@ async function main() {
141
161
  avail = JSON.parse(readFileSync(availPath, "utf-8"));
142
162
  }
143
163
  catch {
144
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=error reason=bad-availability-json`);
164
+ log(`[calendar-availability] op=publish accountId=${accountId} result=error reason=bad-availability-json`);
145
165
  writeLastPublish(accountDir, "error", null, readPriorSuccessAt(accountDir));
146
166
  return;
147
167
  }
148
168
  const dbName = avail.bookingDbName;
149
169
  if (!dbName) {
150
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-booking-db`);
170
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-booking-db`);
151
171
  return;
152
172
  }
153
173
  // Task 1631 — house code uses the house-only Cloudflare credential, never a
154
174
  // per-account token. The booking DB is still targeted by its per-account name.
155
175
  const platformRoot = process.env.PLATFORM_ROOT;
156
176
  if (!platformRoot) {
157
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-platform-root`);
177
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-platform-root`);
158
178
  return;
159
179
  }
160
180
  const houseEnvPath = join(platformRoot, "config", "cloudflare-house.env");
161
181
  const houseCred = readEnvFile(houseEnvPath);
162
182
  const token = houseCred.CLOUDFLARE_API_TOKEN;
163
183
  if (!token) {
164
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-house-cloudflare-credential`);
184
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-house-cloudflare-credential`);
185
+ return;
186
+ }
187
+ // Task 1805/2349 — the D1 endpoint is addressed per Cloudflare account, so
188
+ // the id is required rather than inferred. cf-token.sh already refuses to
189
+ // resolve any scope without it, so no install that publishes today can
190
+ // reach here lacking one; an absent id is reported rather than guessed.
191
+ const houseAccountId = houseCred.CLOUDFLARE_ACCOUNT_ID;
192
+ if (!houseAccountId) {
193
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=no-house-cloudflare-account-id`);
165
194
  return;
166
195
  }
167
196
  // Task 1670 — the house credential is a minter; mint (then reuse) a D1-only
168
- // scoped token from it via cf-token.sh and run wrangler on THAT, never the
169
- // minter directly (a minter returns 10000 on wrangler d1).
197
+ // scoped token from it via cf-token.sh and authenticate on THAT, never the
198
+ // minter directly (a minter returns 10000 against the D1 surface).
170
199
  const cfTokenSh = join(platformRoot, "plugins/cloudflare/bin/cf-token.sh");
171
200
  let scopedToken;
172
201
  try {
173
202
  scopedToken = resolveHouseScopedToken("calendar-d1", houseEnvPath, cfTokenSh);
174
203
  }
175
204
  catch (err) {
176
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=scoped-token-mint-failed err="${err.message}"`);
205
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=scoped-token-mint-failed err="${err.message}"`);
177
206
  return;
178
207
  }
179
208
  const port = process.env.MAXY_UI_INTERNAL_PORT;
180
209
  if (!port) {
181
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=error reason=no-internal-port`);
210
+ log(`[calendar-availability] op=publish accountId=${accountId} result=error reason=no-internal-port`);
182
211
  writeLastPublish(accountDir, "error", null, readPriorSuccessAt(accountDir));
183
212
  return;
184
213
  }
@@ -203,7 +232,7 @@ async function main() {
203
232
  }
204
233
  catch (err) {
205
234
  // Device/local endpoint unreachable — leave the last edge snapshot intact.
206
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=skipped-unreachable err="${err.message}"`);
235
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped-unreachable err="${err.message}"`);
207
236
  writeLastPublish(accountDir, "skipped-unreachable", null, readPriorSuccessAt(accountDir));
208
237
  return;
209
238
  }
@@ -216,48 +245,24 @@ async function main() {
216
245
  slotCount = parsed.slots.length;
217
246
  }
218
247
  catch (err) {
219
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=bad-payload err="${err.message}"`);
248
+ log(`[calendar-availability] op=publish accountId=${accountId} result=skipped reason=bad-payload err="${err.message}"`);
220
249
  writeLastPublish(accountDir, "skipped", null, readPriorSuccessAt(accountDir));
221
250
  return;
222
251
  }
223
- // Upsert via a temp SQL file robust for a large payload where a --command
224
- // argv would be fragile. Single quotes are escaped for the SQL literal. The
225
- // CREATE first makes this self-healing: a booking site provisioned before
226
- // this feature (its D1 has `bookings` but no `availability_snapshot`) gets
227
- // the table here on the first publish, without waiting for a skill re-run.
228
- const esc = payload.replace(/'/g, "''");
229
- const sql = `CREATE TABLE IF NOT EXISTS availability_snapshot (
230
- id INTEGER PRIMARY KEY CHECK (id = 1),
231
- payload TEXT,
232
- updatedAt TEXT
233
- );
234
- INSERT INTO availability_snapshot (id, payload, updatedAt)
235
- VALUES (1, '${esc}', '${nowIso}')
236
- ON CONFLICT(id) DO UPDATE SET payload=excluded.payload, updatedAt=excluded.updatedAt;`;
237
- const workDir = mkdtempSync(join(tmpdir(), "publish-availability-"));
238
- const sqlFile = join(workDir, "upsert.sql");
239
- try {
240
- writeFileSync(sqlFile, sql);
241
- const wranglerEnv = {
242
- CLOUDFLARE_API_TOKEN: scopedToken,
243
- ...(houseCred.CLOUDFLARE_ACCOUNT_ID ? { CLOUDFLARE_ACCOUNT_ID: houseCred.CLOUDFLARE_ACCOUNT_ID } : {}),
244
- };
245
- const proc = spawnSync("npx", ["wrangler", "d1", "execute", dbName, "--remote", "--file", sqlFile], {
246
- env: { ...process.env, ...wranglerEnv },
247
- encoding: "utf-8",
248
- maxBuffer: 16 * 1024 * 1024,
249
- timeout: 60_000,
250
- });
251
- if (proc.status !== 0) {
252
- console.error(`[calendar-availability] op=publish accountId=${accountId} result=error reason=d1-write-failed status=${proc.status}${proc.signal ? ` signal=${proc.signal}` : ""}`);
253
- writeLastPublish(accountDir, "error", slotCount, readPriorSuccessAt(accountDir));
254
- return;
255
- }
256
- }
257
- finally {
258
- rmSync(workDir, { recursive: true, force: true });
252
+ // Task 2349 the write goes over the D1 HTTP API (Task 1805's transport),
253
+ // not `npx wrangler d1 execute` through spawnSync. The client carries the
254
+ // spawn's 60 s bound as a request timeout, and its failures name the HTTP
255
+ // status and the response body, which the spawn's discarded stderr did not.
256
+ const client = createD1Client({ accountId: houseAccountId, token: scopedToken });
257
+ const write = await writeSnapshot(client, dbName, payload, nowIso);
258
+ if (!write.ok) {
259
+ log(`[calendar-availability] op=publish accountId=${accountId} result=error reason=d1-write-failed ` +
260
+ `d1Ms=${write.elapsedMs} attempt=${write.attempts} err="${errField(write.error)}"`);
261
+ writeLastPublish(accountDir, "error", slotCount, readPriorSuccessAt(accountDir));
262
+ return;
259
263
  }
260
- console.error(`[calendar-availability] op=publish accountId=${accountId} slots=${slotCount} result=success`);
264
+ log(`[calendar-availability] op=publish accountId=${accountId} slots=${slotCount} result=success ` +
265
+ `d1Ms=${write.elapsedMs} attempt=${write.attempts}`);
261
266
  writeLastPublish(accountDir, "success", slotCount, nowIso);
262
267
  }
263
268
  finally {
@@ -265,7 +270,7 @@ ON CONFLICT(id) DO UPDATE SET payload=excluded.payload, updatedAt=excluded.updat
265
270
  }
266
271
  }
267
272
  main().catch((err) => {
268
- console.error(`[calendar-availability] op=publish result=error reason=fatal err="${err instanceof Error ? err.message : String(err)}"`);
273
+ log(`[calendar-availability] op=publish result=error reason=fatal err="${err instanceof Error ? err.message : String(err)}"`);
269
274
  releaseLock();
270
275
  process.exit(1);
271
276
  });
@@ -1 +1 @@
1
- {"version":3,"file":"publish-availability.js","sourceRoot":"","sources":["../../src/scripts/publish-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,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YAAS,CAAC;QACT,WAAW,EAAE,CAAC;IAChB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,GAAG,CAAC,qEAAqE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9H,WAAW,EAAE,CAAC;IACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ # Task 2339 — the hook must be registered in BOTH writers, on BOTH events, with
3
+ # the SAME resolved command string. The provision-time heredoc is a frequent
4
+ # merge-conflict site and the backfill lib is the only thing that reaches client
5
+ # sub-accounts, so losing either is silent. Drift between them is worse than
6
+ # losing one: the backfill would not recognise what provision wrote and would
7
+ # append a second copy to every house account on every install.
8
+ set -uo pipefail
9
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ PROV="$DIR/../lib/provision-account-dir.sh"
11
+ BACKFILL="$DIR/../lib/account-settings-public-surface.sh"
12
+ SETUP="$DIR/../setup-account.sh"
13
+ PASS=0; FAIL=0
14
+
15
+ ok() { echo "PASS: $1"; PASS=$((PASS+1)); }
16
+ bad() { echo "FAIL: $1" >&2; FAIL=$((FAIL+1)); }
17
+
18
+ PROV_LINE='{ "type": "command", "command": "bash $HOOKS_PATH/public-tool-surface.sh" }'
19
+ RESOLVED='bash $PLATFORM_ROOT/plugins/admin/hooks/public-tool-surface.sh'
20
+
21
+ if [ "$(/usr/bin/grep -cF "$PROV_LINE" "$PROV")" = "3" ]; then
22
+ ok "provision-account-dir.sh writes the hook exactly three times"
23
+ else
24
+ bad "expected 3 provision command lines in $PROV"
25
+ fi
26
+
27
+ # The matcher-less PreToolUse entry is the one that matches every tool. A
28
+ # matcher key on that entry would silently narrow the hook to one tool.
29
+ if python3 - "$PROV" <<'PY'
30
+ import re, sys
31
+ src = open(sys.argv[1], encoding="utf-8").read()
32
+ m = re.search(r'"PreToolUse"\s*:\s*\[(.*?)\n \]', src, re.S)
33
+ if not m:
34
+ sys.exit(1)
35
+ block = m.group(1)
36
+ entries = re.split(r'\n \},\n', block)
37
+ hit = [e for e in entries if "public-tool-surface.sh" in e]
38
+ sys.exit(0 if len(hit) == 1 and '"matcher"' not in hit[0] else 1)
39
+ PY
40
+ then
41
+ ok "the PreToolUse entry is matcher-less, so it matches every tool"
42
+ else
43
+ bad "public-tool-surface.sh is absent from, or matcher-scoped in, PreToolUse"
44
+ fi
45
+
46
+ if python3 - "$PROV" <<'PY'
47
+ import re, sys
48
+ src = open(sys.argv[1], encoding="utf-8").read()
49
+ m = re.search(r'"Stop"\s*:\s*\[(.*?)\n \]', src, re.S)
50
+ sys.exit(0 if m and "public-tool-surface.sh" in m.group(1) else 1)
51
+ PY
52
+ then
53
+ ok "the census entry sits inside the Stop array"
54
+ else
55
+ bad "public-tool-surface.sh is not inside the Stop array in $PROV"
56
+ fi
57
+
58
+ # The turn-start reset. Without it a killed turn's tally inflates the next
59
+ # turn's census, which is the number the task's verification asserts against.
60
+ if python3 - "$PROV" <<'PY'
61
+ import re, sys
62
+ src = open(sys.argv[1], encoding="utf-8").read()
63
+ m = re.search(r'"UserPromptSubmit"\s*:\s*\[(.*?)\n \]', src, re.S)
64
+ sys.exit(0 if m and "public-tool-surface.sh" in m.group(1) else 1)
65
+ PY
66
+ then
67
+ ok "the turn-start reset sits inside the UserPromptSubmit array"
68
+ else
69
+ bad "public-tool-surface.sh is not inside the UserPromptSubmit array in $PROV"
70
+ fi
71
+
72
+ if /usr/bin/grep -qF "_PUBSURFACE_CMD='$RESOLVED'" "$BACKFILL"; then
73
+ ok "the backfill lib writes the same resolved command string"
74
+ else
75
+ bad "backfill _PUBSURFACE_CMD is not '$RESOLVED' in $BACKFILL"
76
+ fi
77
+
78
+ if /usr/bin/grep -qF 'HOOKS_PATH="\$PLATFORM_ROOT/plugins/admin/hooks"' "$PROV"; then
79
+ ok "HOOKS_PATH resolves to the path the backfill lib assumes"
80
+ else
81
+ bad "HOOKS_PATH in $PROV no longer matches the backfill lib assumption"
82
+ fi
83
+
84
+ if /usr/bin/grep -qF 'account-settings-public-surface.sh' "$SETUP"; then
85
+ ok "backfill lib sourced by setup-account.sh"
86
+ else
87
+ bad "backfill lib not sourced by $SETUP"
88
+ fi
89
+
90
+ if /usr/bin/grep -qE '^reconcile_all_accounts_public_surface "\$ACCOUNTS_DIR"' "$SETUP"; then
91
+ ok "backfill invoked over every account by setup-account.sh"
92
+ else
93
+ bad "reconcile_all_accounts_public_surface not invoked in $SETUP"
94
+ fi
95
+
96
+ echo "----"
97
+ echo "PASS=$PASS FAIL=$FAIL"
98
+ if [ $((PASS+FAIL)) -ne 8 ]; then
99
+ echo "FAIL: expected 8 checks, ran $((PASS+FAIL))" >&2
100
+ exit 1
101
+ fi
102
+ [ "$FAIL" -eq 0 ]
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env bash
2
+ # Task 2339 — the backfill must reach an account provisioned before the hook
3
+ # existed, must be a byte-identical no-op on a second run, and must never damage
4
+ # a file it cannot patch.
5
+ set -uo pipefail
6
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ # shellcheck source=../account-settings-public-surface.sh
8
+ . "$DIR/../account-settings-public-surface.sh"
9
+ PASS=0; FAIL=0
10
+ ok() { echo "PASS: $1"; PASS=$((PASS+1)); }
11
+ bad() { echo "FAIL: $1" >&2; FAIL=$((FAIL+1)); }
12
+ CMD='bash $PLATFORM_ROOT/plugins/admin/hooks/public-tool-surface.sh'
13
+
14
+ # A pre-2339 settings file: all three arrays present, none carrying the command.
15
+ mkpre() {
16
+ local f="$1"
17
+ cat > "$f" <<'JSON'
18
+ {
19
+ "permissions": { "defaultMode": "bypassPermissions", "allow": [], "deny": [] },
20
+ "hooks": {
21
+ "PreToolUse": [
22
+ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "bash $PLATFORM_ROOT/plugins/admin/hooks/quote-engine-gate.sh" } ] },
23
+ { "hooks": [ { "type": "command", "command": "bash $PLATFORM_ROOT/plugins/admin/hooks/archive-ingest-surface-gate.sh" } ] }
24
+ ],
25
+ "UserPromptSubmit": [
26
+ { "hooks": [ { "type": "command", "command": "bash $PLATFORM_ROOT/plugins/admin/hooks/datetime-inject.sh" } ] }
27
+ ],
28
+ "Stop": [
29
+ { "hooks": [ { "type": "command", "command": "bash $PLATFORM_ROOT/plugins/admin/hooks/prompt-optimiser-compliance.sh" } ] }
30
+ ]
31
+ }
32
+ }
33
+ JSON
34
+ }
35
+
36
+ D=$(mktemp -d)
37
+ F="$D/settings.json"
38
+ mkpre "$F"
39
+ OUT=$(ensure_public_surface_hook "$F")
40
+ if [[ "$OUT" == *"status=updated"* ]]; then ok "a pre-2339 file is updated"; else bad "expected updated, got: $OUT"; fi
41
+ if [ "$(jq -r --arg c "$CMD" '[.hooks.PreToolUse[] | select(has("matcher") | not) | .hooks[] | select(.command == $c)] | length' "$F")" = "1" ]; then
42
+ ok "the command lands on the matcher-less PreToolUse entry"
43
+ else
44
+ bad "command not on the matcher-less PreToolUse entry"
45
+ fi
46
+ if [ "$(jq -r --arg c "$CMD" '[.hooks.PreToolUse[] | select(has("matcher")) | .hooks[] | select(.command == $c)] | length' "$F")" = "0" ]; then
47
+ ok "no matcher-scoped entry gained the command"
48
+ else
49
+ bad "a matcher-scoped entry gained the command"
50
+ fi
51
+ if [ "$(jq -r --arg c "$CMD" '[.hooks.Stop[].hooks[] | select(.command == $c)] | length' "$F")" = "1" ]; then
52
+ ok "the command lands on the Stop entry"
53
+ else
54
+ bad "command absent from Stop"
55
+ fi
56
+ if [ "$(jq -r --arg c "$CMD" '[.hooks.UserPromptSubmit[].hooks[] | select(.command == $c)] | length' "$F")" = "1" ]; then
57
+ ok "the command lands on the UserPromptSubmit entry"
58
+ else
59
+ bad "command absent from UserPromptSubmit"
60
+ fi
61
+
62
+ BEFORE=$(cat "$F")
63
+ OUT=$(ensure_public_surface_hook "$F")
64
+ if [[ "$OUT" == *"status=already-set"* ]]; then ok "a second run reports already-set"; else bad "expected already-set, got: $OUT"; fi
65
+ if [ "$BEFORE" = "$(cat "$F")" ]; then ok "a second run leaves the file byte-identical"; else bad "second run rewrote the file"; fi
66
+
67
+ # Missing file.
68
+ OUT=$(ensure_public_surface_hook "$D/nope.json")
69
+ if [[ "$OUT" == *"status=absent"* ]]; then ok "a missing file reports absent"; else bad "expected absent, got: $OUT"; fi
70
+
71
+ # Valid JSON with no hooks block.
72
+ echo '{"permissions":{}}' > "$D/nohooks.json"
73
+ OUT=$(ensure_public_surface_hook "$D/nohooks.json")
74
+ if [[ "$OUT" == *"status=no-hooks"* ]]; then ok "a hookless file reports no-hooks"; else bad "expected no-hooks, got: $OUT"; fi
75
+
76
+ # Malformed JSON is reported and left untouched.
77
+ printf '{ not json' > "$D/bad.json"
78
+ BAD_BEFORE=$(cat "$D/bad.json")
79
+ OUT=$(ensure_public_surface_hook "$D/bad.json")
80
+ if [[ "$OUT" == *"status=rewrite-failed"* ]]; then ok "a malformed file reports rewrite-failed"; else bad "expected rewrite-failed, got: $OUT"; fi
81
+ if [ "$BAD_BEFORE" = "$(cat "$D/bad.json")" ]; then ok "a malformed file is left untouched"; else bad "malformed file was modified"; fi
82
+
83
+ # An empty Stop array gains a whole entry.
84
+ mkpre "$D/emptystop.json"
85
+ jq '.hooks.Stop = []' "$D/emptystop.json" > "$D/es.tmp" && mv "$D/es.tmp" "$D/emptystop.json"
86
+ ensure_public_surface_hook "$D/emptystop.json" >/dev/null
87
+ if [ "$(jq -r --arg c "$CMD" '[.hooks.Stop[].hooks[] | select(.command == $c)] | length' "$D/emptystop.json")" = "1" ]; then
88
+ ok "an empty Stop array gains a whole entry"
89
+ else
90
+ bad "empty Stop array not handled"
91
+ fi
92
+
93
+ # A PreToolUse array with no matcher-less entry gains one.
94
+ mkpre "$D/nocatchall.json"
95
+ jq 'del(.hooks.PreToolUse[] | select(has("matcher") | not))' "$D/nocatchall.json" > "$D/nc.tmp" && mv "$D/nc.tmp" "$D/nocatchall.json"
96
+ ensure_public_surface_hook "$D/nocatchall.json" >/dev/null
97
+ if [ "$(jq -r --arg c "$CMD" '[.hooks.PreToolUse[] | select(has("matcher") | not) | .hooks[] | select(.command == $c)] | length' "$D/nocatchall.json")" = "1" ]; then
98
+ ok "a PreToolUse array with no matcher-less entry gains one"
99
+ else
100
+ bad "missing catch-all entry not handled"
101
+ fi
102
+
103
+ echo "----"
104
+ echo "PASS=$PASS FAIL=$FAIL"
105
+ if [ $((PASS+FAIL)) -ne 13 ]; then
106
+ echo "FAIL: expected 13 checks, ran $((PASS+FAIL))" >&2
107
+ exit 1
108
+ fi
109
+ [ "$FAIL" -eq 0 ]
@@ -0,0 +1,109 @@
1
+ # account-settings-public-surface.sh — retrofit the realised-public-tool-surface
2
+ # hook onto existing accounts' .claude/settings.json. Task 2339.
3
+ #
4
+ # provision-account-dir.sh writes the hooks block only at provision time, and
5
+ # setup-account.sh re-provisions the HOUSE account only: a client sub-account's
6
+ # settings.json is written once, at creation, by the admin-core account-lifecycle
7
+ # tool, and no install ever rewrites it. Without this lib the hook reaches house
8
+ # accounts only, and the account the 2026-08-01 breach was observed on would keep
9
+ # a settings file with no such command — so the instrumentation could not be
10
+ # verified where the defect was seen. Same shape as
11
+ # account-settings-mailbox-inject.sh (Task 2157).
12
+ #
13
+ # Requires jq. Idempotent. Never echoes file contents. Fail-open (nudge, not
14
+ # brick): any unusable file logs a status and is left untouched.
15
+ #
16
+ # Sourced by setup-account.sh; also runnable standalone for a manual repair.
17
+
18
+ # The exact command string provision-account-dir.sh writes. $PLATFORM_ROOT is a
19
+ # literal in the settings file, resolved by Claude Code at hook-run time.
20
+ _PUBSURFACE_CMD='bash $PLATFORM_ROOT/plugins/admin/hooks/public-tool-surface.sh'
21
+
22
+ # ensure_public_surface_hook <settings_file>
23
+ # Guarantees the matcher-less PreToolUse entry, the UserPromptSubmit entry and
24
+ # the Stop entry all carry the command. The PreToolUse target is the
25
+ # matcher-less entry specifically: a matcher-scoped entry would narrow the hook
26
+ # to one tool, and the whole point is every tool. UserPromptSubmit is the
27
+ # turn-start reset without which a killed turn's tally inflates the next turn's
28
+ # census. Logs exactly one
29
+ # `[backfill-2339] file=<f> status=<absent|no-hooks|already-set|updated|rewrite-failed>`
30
+ # to stdout. Always returns 0.
31
+ ensure_public_surface_hook() {
32
+ local f="$1"
33
+ if [ ! -f "$f" ]; then
34
+ echo "[backfill-2339] file=$f status=absent"
35
+ return 0
36
+ fi
37
+ # Patchable only when the file is valid JSON with both arrays.
38
+ if ! jq -e '(.hooks.PreToolUse | type == "array") and (.hooks.UserPromptSubmit | type == "array") and (.hooks.Stop | type == "array")' "$f" >/dev/null 2>&1; then
39
+ if jq -e . "$f" >/dev/null 2>&1; then
40
+ echo "[backfill-2339] file=$f status=no-hooks"
41
+ else
42
+ echo "[backfill-2339] file=$f status=rewrite-failed"
43
+ fi
44
+ return 0
45
+ fi
46
+ local tmp="$f.2339.tmp"
47
+ if ! jq --arg cmd "$_PUBSURFACE_CMD" '
48
+ .hooks.PreToolUse |= (
49
+ if any(.[]; (.hooks // []) | any(.[]; .command == $cmd))
50
+ then .
51
+ elif any(.[]; has("matcher") | not)
52
+ then map(if (has("matcher") | not)
53
+ then .hooks = ((.hooks // []) + [{type: "command", command: $cmd}])
54
+ else . end)
55
+ else . + [{hooks: [{type: "command", command: $cmd}]}]
56
+ end)
57
+ | .hooks.UserPromptSubmit |= (
58
+ if any(.[]; (.hooks // []) | any(.[]; .command == $cmd))
59
+ then .
60
+ elif length == 0
61
+ then [{hooks: [{type: "command", command: $cmd}]}]
62
+ else (.[0].hooks = ((.[0].hooks // []) + [{type: "command", command: $cmd}]))
63
+ end)
64
+ | .hooks.Stop |= (
65
+ if any(.[]; (.hooks // []) | any(.[]; .command == $cmd))
66
+ then .
67
+ elif length == 0
68
+ then [{hooks: [{type: "command", command: $cmd}]}]
69
+ else (.[0].hooks = ((.[0].hooks // []) + [{type: "command", command: $cmd}]))
70
+ end)
71
+ ' "$f" > "$tmp" 2>/dev/null; then
72
+ rm -f "$tmp"
73
+ echo "[backfill-2339] file=$f status=rewrite-failed"
74
+ return 0
75
+ fi
76
+ # Semantic no-op? Compare canonical forms; leave the file byte-identical if so.
77
+ # `|| true` keeps a jq failure here (e.g. $f truncated by a concurrent writer
78
+ # between the type-check above and this read) from tripping a caller's `set -e`
79
+ # and aborting the whole install — this lib is fail-open by contract.
80
+ local before after
81
+ before="$(jq -S . "$f" 2>/dev/null || true)"
82
+ after="$(jq -S . "$tmp" 2>/dev/null || true)"
83
+ if [ "$before" = "$after" ]; then
84
+ rm -f "$tmp"
85
+ echo "[backfill-2339] file=$f status=already-set"
86
+ return 0
87
+ fi
88
+ if mv "$tmp" "$f"; then
89
+ echo "[backfill-2339] file=$f status=updated"
90
+ else
91
+ rm -f "$tmp"
92
+ echo "[backfill-2339] file=$f status=rewrite-failed"
93
+ fi
94
+ return 0
95
+ }
96
+
97
+ # reconcile_all_accounts_public_surface <accounts_dir>
98
+ # Standing check + backfill: every account dir with an account.json gets the
99
+ # realised-surface hook ensured on both events. Mirrors
100
+ # reconcile_all_accounts_mailbox_inject.
101
+ reconcile_all_accounts_public_surface() {
102
+ local accts="$1"
103
+ [ -d "$accts" ] || return 0
104
+ local acct
105
+ for acct in "$accts"/*/; do
106
+ [ -f "$acct/account.json" ] || continue
107
+ ensure_public_surface_hook "$acct/.claude/settings.json"
108
+ done
109
+ }
@@ -101,7 +101,8 @@ provision_account_dir() {
101
101
  },
102
102
  {
103
103
  "hooks": [
104
- { "type": "command", "command": "bash $HOOKS_PATH/archive-ingest-surface-gate.sh" }
104
+ { "type": "command", "command": "bash $HOOKS_PATH/archive-ingest-surface-gate.sh" },
105
+ { "type": "command", "command": "bash $HOOKS_PATH/public-tool-surface.sh" }
105
106
  ]
106
107
  },
107
108
  {
@@ -187,14 +188,16 @@ provision_account_dir() {
187
188
  { "type": "command", "command": "bash $HOOKS_PATH/prompt-optimiser-directive.sh" },
188
189
  { "type": "command", "command": "bash $HOOKS_PATH/datetime-inject.sh" },
189
190
  { "type": "command", "command": "bash $HOOKS_PATH/mailbox-inject.sh" },
190
- { "type": "command", "command": "bash $HOOKS_PATH/preference-consult-directive.sh" }
191
+ { "type": "command", "command": "bash $HOOKS_PATH/preference-consult-directive.sh" },
192
+ { "type": "command", "command": "bash $HOOKS_PATH/public-tool-surface.sh" }
191
193
  ]
192
194
  }
193
195
  ],
194
196
  "Stop": [
195
197
  {
196
198
  "hooks": [
197
- { "type": "command", "command": "bash $HOOKS_PATH/prompt-optimiser-compliance.sh" }
199
+ { "type": "command", "command": "bash $HOOKS_PATH/prompt-optimiser-compliance.sh" },
200
+ { "type": "command", "command": "bash $HOOKS_PATH/public-tool-surface.sh" }
198
201
  ]
199
202
  }
200
203
  ]
@@ -40,6 +40,8 @@ ACCOUNTS_DIR="$INSTALL_DIR/data/accounts"
40
40
  . "$SCRIPT_DIR/lib/account-settings-pdf-conformance.sh"
41
41
  # shellcheck source=lib/account-settings-mailbox-inject.sh
42
42
  . "$SCRIPT_DIR/lib/account-settings-mailbox-inject.sh"
43
+ # shellcheck source=lib/account-settings-public-surface.sh
44
+ . "$SCRIPT_DIR/lib/account-settings-public-surface.sh"
43
45
  # shellcheck source=lib/read-brand-json.sh
44
46
  . "$SCRIPT_DIR/lib/read-brand-json.sh"
45
47
  # Resolve brand-aware persistent users.json path before the resolver runs.
@@ -105,3 +107,15 @@ reconcile_all_accounts_pdf_conformance "$ACCOUNTS_DIR"
105
107
  # Reconcile every account on every install. Idempotent; logs one [backfill-2157]
106
108
  # line per account.
107
109
  reconcile_all_accounts_mailbox_inject "$ACCOUNTS_DIR"
110
+
111
+ # ------------------------------------------------------------------
112
+ # 7. Retrofit the realised-public-tool-surface hook onto every account
113
+ # ------------------------------------------------------------------
114
+ # Standing check + durable backfill (Task 2339): provision_account_dir writes the
115
+ # matcher-less PreToolUse entry and the Stop entry only at provision time, and
116
+ # this script re-provisions only the house account. Without this, the hook that
117
+ # records what a public spawn's tools actually did would reach house accounts
118
+ # only — including not reaching the account where five tools were seen running
119
+ # under a one-tool allowlist. Reconcile every account on every install.
120
+ # Idempotent; logs one [backfill-2339] line per account.
121
+ reconcile_all_accounts_public_surface "$ACCOUNTS_DIR"
@@ -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,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,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,gBA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