@rubytech/create-maxy-code 0.1.542 → 0.1.544

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 (371) hide show
  1. package/dist/__tests__/public-instruction-seed.test.js +102 -0
  2. package/dist/index.js +47 -0
  3. package/dist/public-instruction-seed.js +70 -0
  4. package/package.json +1 -1
  5. package/payload/platform/lib/shared-folder/dist/index.d.ts +47 -0
  6. package/payload/platform/lib/shared-folder/dist/index.d.ts.map +1 -0
  7. package/payload/platform/lib/shared-folder/dist/index.js +93 -0
  8. package/payload/platform/lib/shared-folder/dist/index.js.map +1 -0
  9. package/payload/platform/lib/shared-folder/src/index.ts +92 -0
  10. package/payload/platform/lib/shared-folder/tsconfig.json +5 -0
  11. package/payload/platform/package.json +2 -2
  12. package/payload/platform/plugins/admin/PLUGIN.md +2 -0
  13. package/payload/platform/plugins/admin/hooks/__tests__/public-tool-surface.test.sh +173 -0
  14. package/payload/platform/plugins/admin/hooks/public-tool-surface.sh +123 -0
  15. package/payload/platform/plugins/admin/mcp/dist/tools/agent-write.d.ts.map +1 -1
  16. package/payload/platform/plugins/admin/mcp/dist/tools/agent-write.js +13 -1
  17. package/payload/platform/plugins/admin/mcp/dist/tools/agent-write.js.map +1 -1
  18. package/payload/platform/plugins/admin/skills/channel-instruction/SKILL.md +46 -0
  19. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +18 -1
  20. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +15 -0
  21. package/payload/platform/plugins/docs/references/access-control.md +14 -0
  22. package/payload/platform/plugins/docs/references/internals.md +2 -0
  23. package/payload/platform/plugins/docs/references/platform.md +1 -0
  24. package/payload/platform/plugins/filesystem/.claude-plugin/plugin.json +1 -1
  25. package/payload/platform/plugins/filesystem/PLUGIN.md +11 -1
  26. package/payload/platform/plugins/filesystem/mcp/dist/index.js +23 -7
  27. package/payload/platform/plugins/filesystem/mcp/dist/index.js.map +1 -1
  28. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js +104 -4
  29. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js.map +1 -1
  30. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/shared-folder.test.d.ts +2 -0
  31. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/shared-folder.test.d.ts.map +1 -0
  32. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/shared-folder.test.js +67 -0
  33. package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/shared-folder.test.js.map +1 -0
  34. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts +16 -2
  35. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts.map +1 -1
  36. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js +54 -1
  37. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js.map +1 -1
  38. package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js +76 -2
  39. package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js.map +1 -1
  40. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-edit.d.ts +1 -0
  41. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-edit.d.ts.map +1 -1
  42. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-edit.js +3 -3
  43. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-edit.js.map +1 -1
  44. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-glob.d.ts +1 -0
  45. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-glob.d.ts.map +1 -1
  46. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-glob.js +1 -1
  47. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-glob.js.map +1 -1
  48. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-grep.d.ts +1 -0
  49. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-grep.d.ts.map +1 -1
  50. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-grep.js +3 -3
  51. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-grep.js.map +1 -1
  52. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-list.d.ts +1 -0
  53. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-list.d.ts.map +1 -1
  54. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-list.js +3 -3
  55. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-list.js.map +1 -1
  56. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-read.d.ts +1 -0
  57. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-read.d.ts.map +1 -1
  58. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-read.js +3 -3
  59. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-read.js.map +1 -1
  60. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-write.d.ts +1 -0
  61. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-write.d.ts.map +1 -1
  62. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-write.js +3 -3
  63. package/payload/platform/plugins/filesystem/mcp/dist/tools/file-write.js.map +1 -1
  64. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js +81 -1
  65. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js.map +1 -1
  66. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts +22 -0
  67. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -1
  68. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +80 -0
  69. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -1
  70. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +13 -1
  71. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
  72. package/payload/platform/plugins/whatsapp/PLUGIN.md +2 -2
  73. package/payload/platform/plugins/whatsapp/mcp/dist/index.js +1 -1
  74. package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
  75. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +1 -1
  76. package/payload/platform/scripts/__tests__/public-surface-registered.test.sh +102 -0
  77. package/payload/platform/scripts/check-no-esm-require.mjs +5 -0
  78. package/payload/platform/scripts/lib/__tests__/account-settings-public-surface.test.sh +109 -0
  79. package/payload/platform/scripts/lib/account-settings-public-surface.sh +109 -0
  80. package/payload/platform/scripts/lib/provision-account-dir.sh +6 -3
  81. package/payload/platform/scripts/setup-account.sh +14 -0
  82. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts +8 -4
  83. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts.map +1 -1
  84. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js +27 -7
  85. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js.map +1 -1
  86. package/payload/platform/services/claude-session-manager/dist/config.d.ts +11 -6
  87. package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
  88. package/payload/platform/services/claude-session-manager/dist/config.js +8 -4
  89. package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
  90. package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts +24 -2
  91. package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts.map +1 -1
  92. package/payload/platform/services/claude-session-manager/dist/fs-watcher.js +23 -1
  93. package/payload/platform/services/claude-session-manager/dist/fs-watcher.js.map +1 -1
  94. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +35 -0
  95. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  96. package/payload/platform/services/claude-session-manager/dist/http-server.js +286 -25
  97. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  98. package/payload/platform/services/claude-session-manager/dist/index.js +169 -51
  99. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  100. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +24 -12
  101. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  102. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +194 -28
  103. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  104. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
  105. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +4 -0
  106. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
  107. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.d.ts +24 -3
  108. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.d.ts.map +1 -1
  109. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.js +29 -3
  110. package/payload/platform/services/claude-session-manager/dist/public-surface-audit.js.map +1 -1
  111. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.d.ts +27 -0
  112. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.d.ts.map +1 -1
  113. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.js +32 -0
  114. package/payload/platform/services/claude-session-manager/dist/rc-public-lockdown.js.map +1 -1
  115. package/payload/platform/services/claude-session-manager/dist/role-census.d.ts +24 -0
  116. package/payload/platform/services/claude-session-manager/dist/role-census.d.ts.map +1 -0
  117. package/payload/platform/services/claude-session-manager/dist/role-census.js +50 -0
  118. package/payload/platform/services/claude-session-manager/dist/role-census.js.map +1 -0
  119. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts +24 -2
  120. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts.map +1 -1
  121. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js +21 -0
  122. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js.map +1 -1
  123. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.d.ts +76 -0
  124. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.d.ts.map +1 -1
  125. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.js +110 -19
  126. package/payload/platform/services/claude-session-manager/dist/stuck-turn-recover.js.map +1 -1
  127. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.d.ts +60 -0
  128. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.d.ts.map +1 -0
  129. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.js +93 -0
  130. package/payload/platform/services/claude-session-manager/dist/stuck-turn-respawn.js.map +1 -0
  131. package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts +31 -1
  132. package/payload/platform/services/claude-session-manager/dist/stuck-turn.d.ts.map +1 -1
  133. package/payload/platform/services/claude-session-manager/dist/stuck-turn.js +72 -9
  134. package/payload/platform/services/claude-session-manager/dist/stuck-turn.js.map +1 -1
  135. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +1 -1
  136. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
  137. package/payload/platform/services/claude-session-manager/dist/system-prompt.js +9 -1
  138. package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
  139. package/payload/platform/services/claude-session-manager/dist/types.d.ts +9 -3
  140. package/payload/platform/services/claude-session-manager/dist/types.d.ts.map +1 -1
  141. package/payload/platform/services/telegram-channel/dist/instructions.d.ts +0 -1
  142. package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -1
  143. package/payload/platform/services/telegram-channel/dist/instructions.js +0 -46
  144. package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -1
  145. package/payload/platform/services/telegram-channel/dist/notification.d.ts +16 -4
  146. package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -1
  147. package/payload/platform/services/telegram-channel/dist/notification.js +27 -14
  148. package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -1
  149. package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
  150. package/payload/platform/services/telegram-channel/dist/server.js +10 -0
  151. package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
  152. package/payload/platform/services/webchat-channel/dist/instructions.d.ts +0 -1
  153. package/payload/platform/services/webchat-channel/dist/instructions.d.ts.map +1 -1
  154. package/payload/platform/services/webchat-channel/dist/instructions.js +0 -60
  155. package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -1
  156. package/payload/platform/services/webchat-channel/dist/notification.d.ts +14 -2
  157. package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -1
  158. package/payload/platform/services/webchat-channel/dist/notification.js +28 -12
  159. package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -1
  160. package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
  161. package/payload/platform/services/webchat-channel/dist/server.js +10 -0
  162. package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
  163. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +97 -33
  164. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  165. package/payload/platform/services/whatsapp-channel/dist/notification.js +98 -76
  166. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  167. package/payload/platform/services/whatsapp-channel/dist/server.d.ts +18 -0
  168. package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
  169. package/payload/platform/services/whatsapp-channel/dist/server.js +87 -5
  170. package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
  171. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +41 -9
  172. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -1
  173. package/payload/platform/services/whatsapp-channel/dist/targets.js +42 -7
  174. package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -1
  175. package/payload/platform/templates/agents/admin/INSTRUCTION.md +0 -0
  176. package/payload/server/{adminuser-self-heal-LC7HZAC6.js → adminuser-self-heal-ZHFNDKJK.js} +1 -1
  177. package/payload/server/{chunk-HZP7BKBF.js → chunk-CVUSUNXM.js} +128 -4
  178. package/payload/server/{chunk-CKTHAHL4.js → chunk-DU7GPDJJ.js} +4 -2
  179. package/payload/server/{chunk-PFF6I7KP.js → chunk-HYQNUVGO.js} +8 -1
  180. package/payload/server/{chunk-ERIM3EFB.js → chunk-X2RRMHVV.js} +1 -1
  181. package/payload/server/{manager-CM55K4J2.js → manager-TI2YJQVZ.js} +3 -3
  182. package/payload/server/maxy-edge.js +3 -3
  183. package/payload/server/public/activity.html +5 -5
  184. package/payload/server/public/agents.html +4 -4
  185. package/payload/server/public/assets/AdminLoginScreens-BGKtDqAk.js +1 -0
  186. package/payload/server/public/assets/AdminLoginScreens-BGKtDqAk.js.br +0 -0
  187. package/payload/server/public/assets/AdminLoginScreens-BGKtDqAk.js.gz +0 -0
  188. package/payload/server/public/assets/AdminShell-DnfgsAQl.js +2 -0
  189. package/payload/server/public/assets/AdminShell-DnfgsAQl.js.br +0 -0
  190. package/payload/server/public/assets/AdminShell-DnfgsAQl.js.gz +0 -0
  191. package/payload/server/public/assets/activity-ByJSut0Q.js +1 -0
  192. package/payload/server/public/assets/activity-ByJSut0Q.js.br +0 -0
  193. package/payload/server/public/assets/activity-ByJSut0Q.js.gz +0 -0
  194. package/payload/server/public/assets/admin-CkeJO6kA.js +1 -0
  195. package/payload/server/public/assets/admin-CkeJO6kA.js.br +0 -0
  196. package/payload/server/public/assets/admin-CkeJO6kA.js.gz +0 -0
  197. package/payload/server/public/assets/agents-D8phtRX5.js +1 -0
  198. package/payload/server/public/assets/agents-D8phtRX5.js.br +0 -0
  199. package/payload/server/public/assets/agents-D8phtRX5.js.gz +0 -0
  200. package/payload/server/public/assets/browser-DQSTjdom.js +1 -0
  201. package/payload/server/public/assets/browser-DQSTjdom.js.br +0 -0
  202. package/payload/server/public/assets/browser-DQSTjdom.js.gz +0 -0
  203. package/payload/server/public/assets/calendar-DFJu1XjP.js +1 -0
  204. package/payload/server/public/assets/calendar-DFJu1XjP.js.br +0 -0
  205. package/payload/server/public/assets/calendar-DFJu1XjP.js.gz +0 -0
  206. package/payload/server/public/assets/chat-DUqtIsOt.js +1 -0
  207. package/payload/server/public/assets/chat-DUqtIsOt.js.br +0 -0
  208. package/payload/server/public/assets/chat-DUqtIsOt.js.gz +0 -0
  209. package/payload/server/public/assets/chevron-left-DFK18xVX.js +1 -0
  210. package/payload/server/public/assets/chevron-left-DFK18xVX.js.br +0 -0
  211. package/payload/server/public/assets/chevron-right-DJ4oaHoN.js +1 -0
  212. package/payload/server/public/assets/chevron-right-DJ4oaHoN.js.br +0 -0
  213. package/payload/server/public/assets/clock-wHIan2DW.js +1 -0
  214. package/payload/server/public/assets/clock-wHIan2DW.js.br +0 -0
  215. package/payload/server/public/assets/{copy-3kj9Oaoc.js → copy-lFFhXRGk.js} +1 -1
  216. package/payload/server/public/assets/copy-lFFhXRGk.js.br +0 -0
  217. package/payload/server/public/assets/copy-lFFhXRGk.js.gz +0 -0
  218. package/payload/server/public/assets/data-Cxv97ARy.js +1 -0
  219. package/payload/server/public/assets/data-Cxv97ARy.js.br +0 -0
  220. package/payload/server/public/assets/data-Cxv97ARy.js.gz +0 -0
  221. package/payload/server/public/assets/{file-text-CBaewT76.js → file-text-D2Y-bkNy.js} +1 -1
  222. package/payload/server/public/assets/file-text-D2Y-bkNy.js.br +0 -0
  223. package/payload/server/public/assets/file-text-D2Y-bkNy.js.gz +0 -0
  224. package/payload/server/public/assets/{graph-B8-e2_Z-.js → graph-C-3yN6JD.js} +3 -3
  225. package/payload/server/public/assets/graph-C-3yN6JD.js.br +0 -0
  226. package/payload/server/public/assets/graph-C-3yN6JD.js.gz +0 -0
  227. package/payload/server/public/assets/{graph-labels-Bsc23eZU.js → graph-labels-DiaPLP27.js} +1 -1
  228. package/payload/server/public/assets/graph-labels-DiaPLP27.js.br +0 -0
  229. package/payload/server/public/assets/graph-labels-DiaPLP27.js.gz +0 -0
  230. package/payload/server/public/assets/operator-KuGPvSa9.js +1 -0
  231. package/payload/server/public/assets/operator-KuGPvSa9.js.br +0 -0
  232. package/payload/server/public/assets/operator-KuGPvSa9.js.gz +0 -0
  233. package/payload/server/public/assets/page-BhGeFXWA.js +1 -0
  234. package/payload/server/public/assets/page-BhGeFXWA.js.br +0 -0
  235. package/payload/server/public/assets/page-BhGeFXWA.js.gz +0 -0
  236. package/payload/server/public/assets/page-EnbVC-yM.js +32 -0
  237. package/payload/server/public/assets/page-EnbVC-yM.js.br +0 -0
  238. package/payload/server/public/assets/page-EnbVC-yM.js.gz +0 -0
  239. package/payload/server/public/assets/play-jZFZAG-t.js +1 -0
  240. package/payload/server/public/assets/play-jZFZAG-t.js.br +0 -0
  241. package/payload/server/public/assets/play-jZFZAG-t.js.gz +0 -0
  242. package/payload/server/public/assets/public-CdSgMNC7.js +1 -0
  243. package/payload/server/public/assets/public-CdSgMNC7.js.br +0 -0
  244. package/payload/server/public/assets/public-CdSgMNC7.js.gz +0 -0
  245. package/payload/server/public/assets/{rotate-ccw-FZW7c8p8.js → rotate-ccw-rTRuTqei.js} +1 -1
  246. package/payload/server/public/assets/rotate-ccw-rTRuTqei.js.br +0 -0
  247. package/payload/server/public/assets/rotate-ccw-rTRuTqei.js.gz +0 -0
  248. package/payload/server/public/assets/routines-DNRxNRSQ.js +2 -0
  249. package/payload/server/public/assets/routines-DNRxNRSQ.js.br +0 -0
  250. package/payload/server/public/assets/routines-DNRxNRSQ.js.gz +0 -0
  251. package/payload/server/public/assets/skills-DFWtZNkW.js +1 -0
  252. package/payload/server/public/assets/skills-DFWtZNkW.js.br +0 -0
  253. package/payload/server/public/assets/skills-DFWtZNkW.js.gz +0 -0
  254. package/payload/server/public/assets/tasks-B94AuKSy.js +3 -0
  255. package/payload/server/public/assets/tasks-B94AuKSy.js.br +0 -0
  256. package/payload/server/public/assets/tasks-B94AuKSy.js.gz +0 -0
  257. package/payload/server/public/assets/{triangle-alert-CR-jRJdI.js → triangle-alert-DtWUg6jR.js} +1 -1
  258. package/payload/server/public/assets/triangle-alert-DtWUg6jR.js.br +0 -0
  259. package/payload/server/public/assets/triangle-alert-DtWUg6jR.js.gz +0 -0
  260. package/payload/server/public/assets/useCopyFeedback-CjKYO-Qf.js +1 -0
  261. package/payload/server/public/assets/useCopyFeedback-CjKYO-Qf.js.br +0 -0
  262. package/payload/server/public/assets/useCopyFeedback-CjKYO-Qf.js.gz +0 -0
  263. package/payload/server/public/assets/useMediaQuery-BYIHo-xL.js +14 -0
  264. package/payload/server/public/assets/useMediaQuery-BYIHo-xL.js.br +0 -0
  265. package/payload/server/public/assets/useMediaQuery-BYIHo-xL.js.gz +0 -0
  266. package/payload/server/public/assets/useMediaQuery-DlOWP56H.css +1 -0
  267. package/payload/server/public/assets/useMediaQuery-DlOWP56H.css.br +0 -0
  268. package/payload/server/public/assets/useMediaQuery-DlOWP56H.css.gz +0 -0
  269. package/payload/server/public/assets/useVoiceRecorder-BKFAYuzz.js +2 -0
  270. package/payload/server/public/assets/useVoiceRecorder-BKFAYuzz.js.br +0 -0
  271. package/payload/server/public/assets/useVoiceRecorder-BKFAYuzz.js.gz +0 -0
  272. package/payload/server/public/assets/{wrench-CpCOYUBc.js → wrench-Ct4kf-uv.js} +1 -1
  273. package/payload/server/public/assets/wrench-Ct4kf-uv.js.br +0 -0
  274. package/payload/server/public/assets/wrench-Ct4kf-uv.js.gz +0 -0
  275. package/payload/server/public/browser.html +4 -4
  276. package/payload/server/public/calendar.html +8 -8
  277. package/payload/server/public/chat.html +13 -13
  278. package/payload/server/public/data.html +11 -11
  279. package/payload/server/public/graph.html +9 -9
  280. package/payload/server/public/index.html +14 -14
  281. package/payload/server/public/operator.html +14 -14
  282. package/payload/server/public/public.html +13 -13
  283. package/payload/server/public/routines.html +6 -6
  284. package/payload/server/public/skills.html +5 -5
  285. package/payload/server/public/tasks.html +6 -6
  286. package/payload/server/server.js +537 -263
  287. package/payload/server/{src-JN6PIAJN.js → src-MM64CYYZ.js} +1 -1
  288. package/payload/server/{userprofile-reconcile-QHVLY2AH.js → userprofile-reconcile-TL4JKBPG.js} +1 -1
  289. package/payload/server/public/assets/AdminLoginScreens-DuFCjbz2.js +0 -1
  290. package/payload/server/public/assets/AdminLoginScreens-DuFCjbz2.js.br +0 -0
  291. package/payload/server/public/assets/AdminLoginScreens-DuFCjbz2.js.gz +0 -0
  292. package/payload/server/public/assets/AdminShell-DJL5DzRX.js +0 -2
  293. package/payload/server/public/assets/AdminShell-DJL5DzRX.js.br +0 -0
  294. package/payload/server/public/assets/AdminShell-DJL5DzRX.js.gz +0 -0
  295. package/payload/server/public/assets/activity-CpMnNr5c.js +0 -1
  296. package/payload/server/public/assets/activity-CpMnNr5c.js.br +0 -0
  297. package/payload/server/public/assets/activity-CpMnNr5c.js.gz +0 -0
  298. package/payload/server/public/assets/admin-CBwKIfaI.js +0 -1
  299. package/payload/server/public/assets/admin-CBwKIfaI.js.br +0 -0
  300. package/payload/server/public/assets/admin-CBwKIfaI.js.gz +0 -0
  301. package/payload/server/public/assets/agents-C4LmSKjb.js +0 -1
  302. package/payload/server/public/assets/agents-C4LmSKjb.js.br +0 -0
  303. package/payload/server/public/assets/agents-C4LmSKjb.js.gz +0 -0
  304. package/payload/server/public/assets/browser-Bm9xm_yc.js +0 -1
  305. package/payload/server/public/assets/browser-Bm9xm_yc.js.br +0 -0
  306. package/payload/server/public/assets/browser-Bm9xm_yc.js.gz +0 -0
  307. package/payload/server/public/assets/calendar-CNY9FTWe.js +0 -1
  308. package/payload/server/public/assets/calendar-CNY9FTWe.js.br +0 -0
  309. package/payload/server/public/assets/calendar-CNY9FTWe.js.gz +0 -0
  310. package/payload/server/public/assets/chat-3WoUGCTd.js +0 -1
  311. package/payload/server/public/assets/chat-3WoUGCTd.js.br +0 -0
  312. package/payload/server/public/assets/chat-3WoUGCTd.js.gz +0 -0
  313. package/payload/server/public/assets/chevron-left-BE16BJnw.js +0 -1
  314. package/payload/server/public/assets/chevron-left-BE16BJnw.js.br +0 -0
  315. package/payload/server/public/assets/chevron-right-Bu2VKpeU.js +0 -1
  316. package/payload/server/public/assets/chevron-right-Bu2VKpeU.js.br +0 -0
  317. package/payload/server/public/assets/clock-C4Nu2aRV.js +0 -1
  318. package/payload/server/public/assets/clock-C4Nu2aRV.js.br +0 -0
  319. package/payload/server/public/assets/copy-3kj9Oaoc.js.br +0 -0
  320. package/payload/server/public/assets/copy-3kj9Oaoc.js.gz +0 -0
  321. package/payload/server/public/assets/data-C-x5EHyi.js +0 -1
  322. package/payload/server/public/assets/data-C-x5EHyi.js.br +0 -1
  323. package/payload/server/public/assets/data-C-x5EHyi.js.gz +0 -0
  324. package/payload/server/public/assets/file-text-CBaewT76.js.br +0 -0
  325. package/payload/server/public/assets/file-text-CBaewT76.js.gz +0 -0
  326. package/payload/server/public/assets/graph-B8-e2_Z-.js.br +0 -0
  327. package/payload/server/public/assets/graph-B8-e2_Z-.js.gz +0 -0
  328. package/payload/server/public/assets/graph-labels-Bsc23eZU.js.br +0 -0
  329. package/payload/server/public/assets/graph-labels-Bsc23eZU.js.gz +0 -0
  330. package/payload/server/public/assets/operator-Cve0-qfO.js +0 -1
  331. package/payload/server/public/assets/operator-Cve0-qfO.js.br +0 -0
  332. package/payload/server/public/assets/operator-Cve0-qfO.js.gz +0 -0
  333. package/payload/server/public/assets/page-BgVMs6Vf.js +0 -1
  334. package/payload/server/public/assets/page-BgVMs6Vf.js.br +0 -0
  335. package/payload/server/public/assets/page-BgVMs6Vf.js.gz +0 -0
  336. package/payload/server/public/assets/page-fABub-w8.js +0 -32
  337. package/payload/server/public/assets/page-fABub-w8.js.br +0 -0
  338. package/payload/server/public/assets/page-fABub-w8.js.gz +0 -0
  339. package/payload/server/public/assets/play-B6zXB9K7.js +0 -1
  340. package/payload/server/public/assets/play-B6zXB9K7.js.br +0 -0
  341. package/payload/server/public/assets/play-B6zXB9K7.js.gz +0 -0
  342. package/payload/server/public/assets/public--R2DbdWs.js +0 -1
  343. package/payload/server/public/assets/public--R2DbdWs.js.br +0 -0
  344. package/payload/server/public/assets/public--R2DbdWs.js.gz +0 -0
  345. package/payload/server/public/assets/rotate-ccw-FZW7c8p8.js.br +0 -0
  346. package/payload/server/public/assets/rotate-ccw-FZW7c8p8.js.gz +0 -0
  347. package/payload/server/public/assets/routines-BpZs2SaT.js +0 -2
  348. package/payload/server/public/assets/routines-BpZs2SaT.js.br +0 -0
  349. package/payload/server/public/assets/routines-BpZs2SaT.js.gz +0 -0
  350. package/payload/server/public/assets/skills-DF7uyEEz.js +0 -1
  351. package/payload/server/public/assets/skills-DF7uyEEz.js.br +0 -0
  352. package/payload/server/public/assets/skills-DF7uyEEz.js.gz +0 -0
  353. package/payload/server/public/assets/tasks-BfJJmoWO.js +0 -3
  354. package/payload/server/public/assets/tasks-BfJJmoWO.js.br +0 -0
  355. package/payload/server/public/assets/tasks-BfJJmoWO.js.gz +0 -0
  356. package/payload/server/public/assets/triangle-alert-CR-jRJdI.js.br +0 -0
  357. package/payload/server/public/assets/triangle-alert-CR-jRJdI.js.gz +0 -0
  358. package/payload/server/public/assets/useCopyFeedback-IOuPUAHY.js +0 -1
  359. package/payload/server/public/assets/useCopyFeedback-IOuPUAHY.js.br +0 -0
  360. package/payload/server/public/assets/useCopyFeedback-IOuPUAHY.js.gz +0 -0
  361. package/payload/server/public/assets/useMediaQuery-CA6dR5iz.js +0 -14
  362. package/payload/server/public/assets/useMediaQuery-CA6dR5iz.js.br +0 -0
  363. package/payload/server/public/assets/useMediaQuery-CA6dR5iz.js.gz +0 -0
  364. package/payload/server/public/assets/useMediaQuery-DpwgV1Da.css +0 -1
  365. package/payload/server/public/assets/useMediaQuery-DpwgV1Da.css.br +0 -0
  366. package/payload/server/public/assets/useMediaQuery-DpwgV1Da.css.gz +0 -0
  367. package/payload/server/public/assets/useVoiceRecorder-DGhsN7nV.js +0 -2
  368. package/payload/server/public/assets/useVoiceRecorder-DGhsN7nV.js.br +0 -0
  369. package/payload/server/public/assets/useVoiceRecorder-DGhsN7nV.js.gz +0 -0
  370. package/payload/server/public/assets/wrench-CpCOYUBc.js.br +0 -0
  371. package/payload/server/public/assets/wrench-CpCOYUBc.js.gz +0 -0
@@ -18,9 +18,23 @@ export interface ScheduleProvenance {
18
18
  * inline on `DoorInbound.source` in targets.ts, which this package's other
19
19
  * local mirrors (MediaInbound, ReplyContext) already model. */
20
20
  export type InboundSource = 'user' | 'schedule' | 'public-relay';
21
+ /** Task 2312 — the composer's own decision for one inbound, carried on the
22
+ * receipt ack. The gateway logs it, because `composeAdminContent` runs in this
23
+ * process (a stdio MCP child with no stderr tee) and a line printed here never
24
+ * reaches server.log. */
25
+ export interface AckMeta {
26
+ provenance: boolean;
27
+ source: InboundSource;
28
+ }
21
29
  export interface InboundPayload {
22
30
  /** The WhatsApp sender this payload is for (E.164 digits or JID). */
23
31
  senderId: string;
32
+ /** Task 2312 — the effective session account, so a real inbound can carry a
33
+ * platform-verified provenance preamble naming who wrote it and where a reply
34
+ * lands. Single-target reads it from WA_CHANNEL_ACCOUNT_ID; the multi-target
35
+ * WhatsApp door carries it on the frame. Absent on the webchat door, which
36
+ * suppresses the block rather than half-filling it. */
37
+ accountId?: string;
24
38
  /** The message body, verbatim — multi-line content is preserved. */
25
39
  text: string;
26
40
  /** The WhatsApp message id, for dedup/observability. */
@@ -41,6 +55,13 @@ export interface InboundPayload {
41
55
  * every turn even after the long-lived session has compacted. Absent/blank on
42
56
  * a turn with no active rules. */
43
57
  standingRules?: string;
58
+ /** Task 2321 — the account's own `## Instruction` body, resolved by the
59
+ * gateway from that account's admin agent files and carried verbatim. Empty
60
+ * or missing means the account has none: the WhatsApp door then refuses the
61
+ * turn rather than substituting platform prose. Typed optional because the
62
+ * SSE frame is JSON-parsed and untyped at runtime, so the composer must treat
63
+ * missing and empty identically. */
64
+ turnInstruction?: string;
44
65
  /** Task 1516 — the dispatcher's operator-provenance marker on a scheduled
45
66
  * inject. Rendered as a platform-verified preamble ABOVE `## Context` (and
46
67
  * above the standing-rules block), outside the reframed untrusted payload.
@@ -74,32 +95,10 @@ export declare const QUOTED_TEXT_CAP = 500;
74
95
  *
75
96
  * Byte-identical to `composeReplyNote` in platform/ui's
76
97
  * app/lib/whatsapp/reply-quote.ts, which serves the passive one-shot door. The
77
- * two packages never cross-import (the arrangement REFRAME_INSTRUCTION and
78
- * MediaInbound already use), so each side hardcodes the strings in its own test
79
- * and a drift fails there.
98
+ * two packages never cross-import (the arrangement MediaInbound already uses),
99
+ * so each side hardcodes the strings in its own test and a drift fails there.
80
100
  */
81
101
  export declare function composeReplyNote(rc: ReplyContext): string;
82
- /**
83
- * The standing per-turn admin reframe. Every channel inbound is demoted to
84
- * payload under `## Context`; this directive rides under `## Instruction` (see
85
- * {@link composeAdminContent}), so the turn becomes a routing question. It
86
- * carries six guarantees, each stated once: (1) dispatch the owning specialist —
87
- * content-producer for any deliverable artefact, including follow-up edits — else
88
- * load the owning skill, else just answer; (2) search skills and tools before
89
- * telling the sender something cannot be done; (3) reply-tool cadence — ack,
90
- * progress, result; (4) channel visibility — the peer sees only reply-tool text,
91
- * so a turn ending without a reply-tool call delivers nothing; (5) deliver files
92
- * via SendUserFile; (6) plain English per the plainly skill.
93
- *
94
- * Compressed under Task 1497 (history: 753/761/805/890/919/980/982). Clauses 5–6
95
- * are recipient-neutral and byte-identical to the webchat and telegram twins'
96
- * ADMIN_REFRAME_INSTRUCTION, drift-guarded by a test in each service. Clauses 3–4
97
- * are byte-identical to the telegram twin only: Task 2075 retired admin webchat's
98
- * reply tool, so webchat rewrote both — its peer reads the session transcript
99
- * rather than reply-tool text. Exported so the unit tests assert the exact
100
- * wrapped shape.
101
- */
102
- export declare const REFRAME_INSTRUCTION: string;
103
102
  /** Task 853 — the two doors a unified (multi-target) session can be bound to.
104
103
  * Task 1516 — 'scheduler' is not a physical door; it labels a scheduler-injected
105
104
  * turn on the wrapped tag so a multi-target reader attributes it to the platform
@@ -113,6 +112,25 @@ export type ChannelSource = 'whatsapp' | 'webchat' | 'scheduler';
113
112
  * em-dashes) so the outbound redactor never trips on it.
114
113
  */
115
114
  export declare function composeScheduleMarker(pv: ScheduleProvenance): string;
115
+ /**
116
+ * Task 2312 — render a real inbound's provenance as a platform-verified
117
+ * preamble. Every value is server-held (the sender comes off the gateway frame,
118
+ * the account from spawn env), so an inbound payload cannot forge this block.
119
+ *
120
+ * It exists because the asymmetry it removes inverted the session's trust
121
+ * ordering: a scheduled inject and a public-relay wake were both attributed and
122
+ * the account's own admin was not, so an agent using attribution as its
123
+ * authenticity test refused its owner and trusted the injection surface. The
124
+ * last line states where the reply tool lands, which the agent cannot observe
125
+ * from inside the turn and which a relay wake already discloses.
126
+ *
127
+ * Copy stays operator-clean (no task numbers, repo paths, or em-dashes) so the
128
+ * outbound redactor never trips on it.
129
+ */
130
+ export declare function composeInboundProvenance(input: {
131
+ senderE164: string;
132
+ accountId: string;
133
+ }): string;
116
134
  /** Task 753 — the reframe decision for one inbound: the wrapped `content` the
117
135
  * agent receives, and `payloadBytes`, the byte length of the inner payload
118
136
  * (message + woven media notes, excluding the wrapper) for the observability
@@ -123,17 +141,38 @@ export interface ComposedInbound {
123
141
  /** Task 853 — the door this inbound arrived on. Default 'whatsapp'
124
142
  * (single-target back-compat); the multi-target loop passes the door. */
125
143
  source: ChannelSource;
144
+ /** Task 2312 — whether this turn carries the inbound provenance preamble. The
145
+ * composer is the only place that knows, and the receipt ack carries it to the
146
+ * gateway so `provenance=no source=user` is greppable in server.log without
147
+ * reproducing the incident. */
148
+ provenance: boolean;
149
+ /** Task 2321 / 2331 — where this turn's `## Instruction` body came from.
150
+ * 'account' is the door reading the body the gateway resolved from the
151
+ * account's own file; 'absent' means the composer REFUSED and `content` is
152
+ * empty, so the caller must not emit. Both doors behave alike: 2331 removed
153
+ * the 'webchat-default' member together with the branch that produced it. */
154
+ instructionSource: 'account' | 'absent';
126
155
  }
127
156
  /**
128
157
  * Shape an inbound WhatsApp payload as a Claude Code channel notification.
129
158
  *
130
- * The event carries ONLY the reframed message text no `meta`. The sender,
131
- * session id, and WhatsApp message id are all held server-side (the reply is
132
- * pinned to the server's fixed sender), so none of it needs to reach the
133
- * model's context. Two reasons: (1) data minimisation the operator's phone
134
- * number is never handed to Claude; (2) a bare event gives the agent nothing to
135
- * narrate, so it acts on the message instead of announcing "incoming message
136
- * from +44 …".
159
+ * The event carries the reframed message text plus, for a real user inbound, the
160
+ * platform-verified provenance preamble naming the sender, the account, and the
161
+ * handset the reply tool reaches (Task 2312). The session id and WhatsApp message
162
+ * id are still held server-side and never reach the model, and there is still no
163
+ * `meta` on the event.
164
+ *
165
+ * That preamble reverses an earlier data-minimisation decision, deliberately and
166
+ * only for a real user inbound on this path. Withholding the sender number is
167
+ * what made the account's own admin the one unattributed voice in their own
168
+ * session, while every platform-authored turn was stamped: an agent using
169
+ * attribution as its authenticity test then refused its owner and trusted the
170
+ * injection surface. A scheduled inject and a public-relay wake carry their own
171
+ * attribution and are not stamped again.
172
+ *
173
+ * The second reason for the original decision survives intact: the preamble
174
+ * states mechanism, so the agent still acts on the message instead of announcing
175
+ * "incoming message from +44 …".
137
176
  */
138
177
  export declare function buildInboundNotification(p: InboundPayload): {
139
178
  method: "notifications/claude/channel";
@@ -144,7 +183,10 @@ export declare function buildInboundNotification(p: InboundPayload): {
144
183
  /**
145
184
  * Task 753 — frame the composed payload as two markdown sections so the agent
146
185
  * routes the request instead of authoring it inline: `## Context` carries the
147
- * inbound payload, then `## Instruction` carries {@link REFRAME_INSTRUCTION}.
186
+ * inbound payload, then `## Instruction` carries the account's own body, which
187
+ * the gateway resolved and put on the payload (Task 2321 for the WhatsApp door,
188
+ * Task 2331 for the unified server's webchat door). A payload with no body is
189
+ * refused rather than framed with an empty instruction.
148
190
  * Every channel turn is framed — there is no deterministic trivia-skip (operator
149
191
  * decision): a greeting is handled by the cascade's `direct` branch, not by a
150
192
  * pre-classifier here. Returns the framed `content` plus `payloadBytes` (the
@@ -191,6 +233,26 @@ export declare function buildReplyDocumentPostBody(mySenderId: string, files: st
191
233
  files: string[];
192
234
  caption?: string;
193
235
  };
236
+ /**
237
+ * Task 2312 — build the body for POST /wa-channel/send-party, the agent's send
238
+ * to a registered counterparty of this account.
239
+ *
240
+ * Both `senderId` and `accountId` come from the server's spawn env, never from
241
+ * the model, exactly as the reply builders do. `phone` IS model-supplied and is
242
+ * deliberately passed through unvalidated: the recipient control is the
243
+ * gateway's allowlist check against this account's registered parties, and a
244
+ * check performed here would be a check the model can talk its way past.
245
+ *
246
+ * The account rides along because the allowlist is scoped: a phone registered
247
+ * on a different account of the same install must not be reachable from this
248
+ * session, and the gateway cannot infer the session's account from the sender.
249
+ */
250
+ export declare function buildSendPartyPostBody(mySenderId: string, myAccountId: string, phone: string, text: string): {
251
+ senderId: string;
252
+ accountId: string;
253
+ phone: string;
254
+ text: string;
255
+ };
194
256
  /**
195
257
  * Build the body for POST /wa-channel/received — the receipt ack the channel
196
258
  * server sends after it has emitted a drained inbound to the agent. It confirms
@@ -198,10 +260,12 @@ export declare function buildReplyDocumentPostBody(mySenderId: string, files: st
198
260
  * (op=channel-received) instead of timing out as drain-undelivered. The senderId
199
261
  * is the server's fixed sender, never model-supplied.
200
262
  */
201
- export declare function buildReceivedPostBody(mySenderId: string, waMessageId: string, myAccountId: string): {
263
+ export declare function buildReceivedPostBody(mySenderId: string, waMessageId: string, myAccountId: string, meta: AckMeta): {
202
264
  senderId: string;
203
265
  waMessageId: string;
204
266
  accountId: string;
267
+ provenance: boolean;
268
+ source: InboundSource;
205
269
  };
206
270
  /**
207
271
  * Retry an idempotent POST until it is accepted or the attempt cap is reached.
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../src/notification.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;sEAEsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CA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ACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,EAAE,CAAA;CAAE,CAU5F"}
@@ -13,9 +13,8 @@ export const QUOTED_TEXT_CAP = 500;
13
13
  *
14
14
  * Byte-identical to `composeReplyNote` in platform/ui's
15
15
  * app/lib/whatsapp/reply-quote.ts, which serves the passive one-shot door. The
16
- * two packages never cross-import (the arrangement REFRAME_INSTRUCTION and
17
- * MediaInbound already use), so each side hardcodes the strings in its own test
18
- * and a drift fails there.
16
+ * two packages never cross-import (the arrangement MediaInbound already uses),
17
+ * so each side hardcodes the strings in its own test and a drift fails there.
19
18
  */
20
19
  export function composeReplyNote(rc) {
21
20
  if (!rc.text)
@@ -27,68 +26,6 @@ export function composeReplyNote(rc) {
27
26
  const quoted = chars.length > QUOTED_TEXT_CAP ? `${chars.slice(0, QUOTED_TEXT_CAP).join('')}…` : rc.text;
28
27
  return `[In reply to an earlier message in this conversation: "${quoted}"]`;
29
28
  }
30
- /**
31
- * The standing per-turn admin reframe. Every channel inbound is demoted to
32
- * payload under `## Context`; this directive rides under `## Instruction` (see
33
- * {@link composeAdminContent}), so the turn becomes a routing question. It
34
- * carries six guarantees, each stated once: (1) dispatch the owning specialist —
35
- * content-producer for any deliverable artefact, including follow-up edits — else
36
- * load the owning skill, else just answer; (2) search skills and tools before
37
- * telling the sender something cannot be done; (3) reply-tool cadence — ack,
38
- * progress, result; (4) channel visibility — the peer sees only reply-tool text,
39
- * so a turn ending without a reply-tool call delivers nothing; (5) deliver files
40
- * via SendUserFile; (6) plain English per the plainly skill.
41
- *
42
- * Compressed under Task 1497 (history: 753/761/805/890/919/980/982). Clauses 5–6
43
- * are recipient-neutral and byte-identical to the webchat and telegram twins'
44
- * ADMIN_REFRAME_INSTRUCTION, drift-guarded by a test in each service. Clauses 3–4
45
- * are byte-identical to the telegram twin only: Task 2075 retired admin webchat's
46
- * reply tool, so webchat rewrote both — its peer reads the session transcript
47
- * rather than reply-tool text. Exported so the unit tests assert the exact
48
- * wrapped shape.
49
- */
50
- export const REFRAME_INSTRUCTION = 'Dispatch the owning specialist with the Agent tool. ' +
51
- 'Every deliverable artefact (email, letter, quote, order, report, PDF, image, page) goes to the installed specialist that owns that artefact type, never produced inline, including follow-up edits to one already produced; ' +
52
- 'only when no specialist owns the artefact type is it content-producer work. ' +
53
- 'Else load the owning skill; else (a greeting, quick question, confirmation) just answer. ' +
54
- 'Artefact work with neither is the violation signal — reconsider. ' +
55
- 'Your capabilities here are very well defined: before telling the sender something cannot be done, ' +
56
- 'search the skills and tools for the owning capability — a denial is valid only once that search comes back empty. ' +
57
- 'Acknowledge on the reply tool, a brief progress note before each long step, then the result on the reply tool too — never silent to the end. ' +
58
- // Channel/visibility model (Task 980): the peer sees ONLY reply-tool text, so a
59
- // turn-final plain text block delivers nothing. Byte-identical to the telegram
60
- // twin, drift-guarded by a test in each service. Webchat diverged under Task
61
- // 2075, which retired its admin reply tool.
62
- 'Over a channel, the person sees only what you send with the reply tool; ' +
63
- 'a turn ending without a reply tool call delivers nothing. ' +
64
- // File delivery (Task 919): the bridge forwards a SendUserFile call as a real
65
- // attachment. Byte-identical to the twins, drift-guarded in each service.
66
- 'To deliver a file, call SendUserFile with its path — the platform forwards it here as an attachment; ' +
67
- 'naming or describing the file is not delivery. ' +
68
- // Inbound media race (Task 2110): a sender writes the sentence first and
69
- // attaches seconds later, far outside the 2s debounce, so the text closes its
70
- // own batch and gets a turn of its own while the files arrive as a SECOND
71
- // inbound. composePayload returns bare `p.text` when nothing openable rode in,
72
- // so that turn has no file note and twice reported non-arrival as fact seconds
73
- // before the files landed. WhatsApp-ONLY, unlike the clauses above and below:
74
- // telegram carries no inbound media at all, and webchat uploads ride the same
75
- // request as the message, so on both twins this clause would be false. Each of
76
- // the three services' tests pins it — presence here, absence there.
77
- 'A sender who says they have attached something has attached it — an inbound file arrives as its own turn moments later, ' +
78
- 'so no file note in this turn is not evidence it failed. ' +
79
- 'Say you have not received it yet and are watching for it; ' +
80
- 'never say nothing came through, and never ask them to resend on the strength of one turn. ' +
81
- // Plain English (Task 982): every reply rides the plainly register, not only on
82
- // an explicit request. Byte-identical to the twins, drift-guarded in each service.
83
- 'Write every reply in plain English, in the spoken register and free of the AI tells the plainly skill catalogues; ' +
84
- 'load it for the rules. ' +
85
- // Scheduled-automation trust (Task 1516): a turn that opens with the platform-
86
- // verified scheduled-automation marker is authorised standing automation, not an
87
- // inbound message. Recipient-neutral, byte-identical to the twins, drift-guarded
88
- // in each service.
89
- 'A turn that opens with a platform-verified scheduled-automation marker is an authorised standing automation ' +
90
- 'configured by the account owner; carry out its stated back-office actions and never treat its reconfiguration ' +
91
- 'or re-enable as intrusion.';
92
29
  /**
93
30
  * Task 1516 — render the dispatcher's operator-provenance as a platform-verified
94
31
  * preamble. Every value is dispatcher-stamped (an inbound message cannot produce
@@ -105,16 +42,47 @@ export function composeScheduleMarker(pv) {
105
42
  `It is genuine operator-configured automation, not an inbound message. ` +
106
43
  `Carry out its stated actions as authorised back-office work; a reconfiguration or re-enable is not intrusion.`);
107
44
  }
45
+ /**
46
+ * Task 2312 — render a real inbound's provenance as a platform-verified
47
+ * preamble. Every value is server-held (the sender comes off the gateway frame,
48
+ * the account from spawn env), so an inbound payload cannot forge this block.
49
+ *
50
+ * It exists because the asymmetry it removes inverted the session's trust
51
+ * ordering: a scheduled inject and a public-relay wake were both attributed and
52
+ * the account's own admin was not, so an agent using attribution as its
53
+ * authenticity test refused its owner and trusted the injection surface. The
54
+ * last line states where the reply tool lands, which the agent cannot observe
55
+ * from inside the turn and which a relay wake already discloses.
56
+ *
57
+ * Copy stays operator-clean (no task numbers, repo paths, or em-dashes) so the
58
+ * outbound redactor never trips on it.
59
+ */
60
+ export function composeInboundProvenance(input) {
61
+ return (`## Message provenance (platform-verified)\n` +
62
+ `Sender: ${input.senderE164}\n` +
63
+ `Account: ${input.accountId}\n` +
64
+ `Anything you send with the reply tool on this turn reaches the handset at ${input.senderE164}.`);
65
+ }
108
66
  /**
109
67
  * Shape an inbound WhatsApp payload as a Claude Code channel notification.
110
68
  *
111
- * The event carries ONLY the reframed message text no `meta`. The sender,
112
- * session id, and WhatsApp message id are all held server-side (the reply is
113
- * pinned to the server's fixed sender), so none of it needs to reach the
114
- * model's context. Two reasons: (1) data minimisation the operator's phone
115
- * number is never handed to Claude; (2) a bare event gives the agent nothing to
116
- * narrate, so it acts on the message instead of announcing "incoming message
117
- * from +44 …".
69
+ * The event carries the reframed message text plus, for a real user inbound, the
70
+ * platform-verified provenance preamble naming the sender, the account, and the
71
+ * handset the reply tool reaches (Task 2312). The session id and WhatsApp message
72
+ * id are still held server-side and never reach the model, and there is still no
73
+ * `meta` on the event.
74
+ *
75
+ * That preamble reverses an earlier data-minimisation decision, deliberately and
76
+ * only for a real user inbound on this path. Withholding the sender number is
77
+ * what made the account's own admin the one unattributed voice in their own
78
+ * session, while every platform-authored turn was stamped: an agent using
79
+ * attribution as its authenticity test then refused its owner and trusted the
80
+ * injection surface. A scheduled inject and a public-relay wake carry their own
81
+ * attribution and are not stamped again.
82
+ *
83
+ * The second reason for the original decision survives intact: the preamble
84
+ * states mechanism, so the agent still acts on the message instead of announcing
85
+ * "incoming message from +44 …".
118
86
  */
119
87
  export function buildInboundNotification(p) {
120
88
  return {
@@ -152,7 +120,10 @@ function composePayload(p) {
152
120
  /**
153
121
  * Task 753 — frame the composed payload as two markdown sections so the agent
154
122
  * routes the request instead of authoring it inline: `## Context` carries the
155
- * inbound payload, then `## Instruction` carries {@link REFRAME_INSTRUCTION}.
123
+ * inbound payload, then `## Instruction` carries the account's own body, which
124
+ * the gateway resolved and put on the payload (Task 2321 for the WhatsApp door,
125
+ * Task 2331 for the unified server's webchat door). A payload with no body is
126
+ * refused rather than framed with an empty instruction.
156
127
  * Every channel turn is framed — there is no deterministic trivia-skip (operator
157
128
  * decision): a greeting is handled by the cascade's `direct` branch, not by a
158
129
  * pre-classifier here. Returns the framed `content` plus `payloadBytes` (the
@@ -160,6 +131,23 @@ function composePayload(p) {
160
131
  * observability line.
161
132
  */
162
133
  export function composeAdminContent(p, source = 'whatsapp') {
134
+ // Task 2321 — the instruction body is the account's own, resolved by the
135
+ // gateway, and an empty one REFUSES the turn: no constant is substituted,
136
+ // which is the whole point of the account owning it. Trimmed and checked here
137
+ // rather than upstream because the SSE frame is JSON-parsed, so missing and
138
+ // empty must behave alike. Task 2331 — this is now door-independent: the
139
+ // webchat gateway resolves the same file, so there is no branch on `source`.
140
+ const accountInstruction = (p.turnInstruction ?? '').trim();
141
+ const instructionSource = accountInstruction.length > 0 ? 'account' : 'absent';
142
+ if (instructionSource === 'absent') {
143
+ return {
144
+ content: '',
145
+ payloadBytes: 0,
146
+ source: p.scheduleProvenance ? 'scheduler' : source,
147
+ provenance: false,
148
+ instructionSource,
149
+ };
150
+ }
163
151
  const payload = composePayload(p);
164
152
  // Task 1516 — a scheduled turn opens with the platform-verified provenance
165
153
  // marker, ABOVE both the standing-rules block and `## Context`, so it sits
@@ -167,6 +155,18 @@ export function composeAdminContent(p, source = 'whatsapp') {
167
155
  // stamped it; a real inbound never carries it. The wrapped tag's door becomes
168
156
  // 'scheduler' so a multi-target reader attributes it to the scheduler.
169
157
  const markerPrefix = p.scheduleProvenance ? `${composeScheduleMarker(p.scheduleProvenance)}\n\n` : '';
158
+ // Task 2312 — a real inbound's own platform-verified preamble, in the same
159
+ // slot. Gated on source 'user' (absent counts as user, the legacy frame) as
160
+ // well as on both values being present, which makes it mutually exclusive with
161
+ // markerPrefix above: a scheduled inject keeps the schedule marker at byte 0,
162
+ // so Task 1960's clean-view suppression is unaffected. A public-relay wake is
163
+ // excluded because its text is platform-authored — stamping it would name the
164
+ // manager as the sender of their own wake-up.
165
+ const provenanceAccountId = typeof p.accountId === 'string' ? p.accountId : '';
166
+ const stampProvenance = (p.source ?? 'user') === 'user' && provenanceAccountId.length > 0 && p.senderId.length > 0;
167
+ const provenancePrefix = stampProvenance
168
+ ? `${composeInboundProvenance({ senderE164: p.senderId, accountId: provenanceAccountId })}\n\n`
169
+ : '';
170
170
  // Task 1486 — prepend the account's active standing rules above ## Context so
171
171
  // they ride every turn. payloadBytes still measures only the inner payload
172
172
  // (message + woven media), excluding the rules block, so the [reframe] size
@@ -175,9 +175,11 @@ export function composeAdminContent(p, source = 'whatsapp') {
175
175
  ? `${p.standingRules.trim()}\n\n`
176
176
  : '';
177
177
  return {
178
- content: `${markerPrefix}${rulesPrefix}## Context\n${payload}\n\n## Instruction\n${REFRAME_INSTRUCTION}`,
178
+ content: `${markerPrefix}${provenancePrefix}${rulesPrefix}## Context\n${payload}\n\n## Instruction\n${accountInstruction}`,
179
179
  payloadBytes: Buffer.byteLength(payload, 'utf8'),
180
180
  source: p.scheduleProvenance ? 'scheduler' : source,
181
+ provenance: stampProvenance,
182
+ instructionSource,
181
183
  };
182
184
  }
183
185
  /**
@@ -220,6 +222,23 @@ export function buildReplyDocumentPostBody(mySenderId, files, caption) {
220
222
  ? { senderId: mySenderId, files, caption }
221
223
  : { senderId: mySenderId, files };
222
224
  }
225
+ /**
226
+ * Task 2312 — build the body for POST /wa-channel/send-party, the agent's send
227
+ * to a registered counterparty of this account.
228
+ *
229
+ * Both `senderId` and `accountId` come from the server's spawn env, never from
230
+ * the model, exactly as the reply builders do. `phone` IS model-supplied and is
231
+ * deliberately passed through unvalidated: the recipient control is the
232
+ * gateway's allowlist check against this account's registered parties, and a
233
+ * check performed here would be a check the model can talk its way past.
234
+ *
235
+ * The account rides along because the allowlist is scoped: a phone registered
236
+ * on a different account of the same install must not be reachable from this
237
+ * session, and the gateway cannot infer the session's account from the sender.
238
+ */
239
+ export function buildSendPartyPostBody(mySenderId, myAccountId, phone, text) {
240
+ return { senderId: mySenderId, accountId: myAccountId, phone, text };
241
+ }
223
242
  /**
224
243
  * Build the body for POST /wa-channel/received — the receipt ack the channel
225
244
  * server sends after it has emitted a drained inbound to the agent. It confirms
@@ -227,11 +246,14 @@ export function buildReplyDocumentPostBody(mySenderId, files, caption) {
227
246
  * (op=channel-received) instead of timing out as drain-undelivered. The senderId
228
247
  * is the server's fixed sender, never model-supplied.
229
248
  */
230
- export function buildReceivedPostBody(mySenderId, waMessageId, myAccountId) {
249
+ export function buildReceivedPostBody(mySenderId, waMessageId, myAccountId, meta) {
231
250
  // Task 2290 — the gateway keys its in-flight queues on (account, sender), so an
232
251
  // ack that does not name the account cannot find the message and would leave a
233
252
  // delivered one to age into a false drain-undelivered.
234
- return { senderId: mySenderId, waMessageId, accountId: myAccountId };
253
+ // Task 2312 it also carries what provenance this turn was composed with. The
254
+ // ack is the only per-inbound message this process already sends to the
255
+ // gateway, so the decision rides it rather than needing a route of its own.
256
+ return { senderId: mySenderId, waMessageId, accountId: myAccountId, provenance: meta.provenance, source: meta.source };
235
257
  }
236
258
  /**
237
259
  * Retry an idempotent POST until it is accepted or the attempt cap is reached.
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../src/notification.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,yEAAyE;AACzE,yEAAyE;AAuEzE;;;gFAGgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAgB;IAC/C,IAAI,CAAC,EAAE,CAAC,IAAI;QAAE,OAAO,wDAAwD,CAAA;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,+BAA+B;IAC/B,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAA;IACxG,OAAO,0D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AM,sBAAsB,GAAmC;IACpE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,0BAA0B,EAAE;IACnD,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,+BAA+B,EAAE;IAC1D,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,6BAA6B,EAAE;IACrD,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,2BAA2B,EAAE;IACxD,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,yBAAyB,EAAE;IAClD,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,sBAAsB,EAAE;CAC/C,CAAA;AAOD,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,MAAM,UAAU,GAAgB,EAAE,CAAA;IAClC,IAAI,KAAK,GAAG,IAAI,CAAA;IAChB,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,sBAAsB,EAAE,CAAC;QAClD,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE;YAC9B,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAC5C,OAAO,YAAY,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;AAC9B,CAAC"}
@@ -41,6 +41,24 @@ export declare const mcp: Server<{
41
41
  } | undefined;
42
42
  } | undefined;
43
43
  }>;
44
+ export declare const SEND_PARTY_TOOL: {
45
+ name: string;
46
+ description: string;
47
+ inputSchema: {
48
+ type: "object";
49
+ properties: {
50
+ phone: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ text: {
55
+ type: string;
56
+ description: string;
57
+ };
58
+ };
59
+ required: string[];
60
+ };
61
+ };
44
62
  export declare function subscribeInbound(opts?: {
45
63
  watchGrew?: WatchGrewFn;
46
64
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