@rubytech/create-maxy-code 0.1.280 → 0.1.281

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 (201) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +31 -43
  3. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts.map +1 -1
  4. package/payload/platform/lib/mcp-spawn-tee/dist/index.js +112 -85
  5. package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -1
  6. package/payload/platform/lib/mcp-spawn-tee/src/__tests__/spawn-tee.test.ts +111 -0
  7. package/payload/platform/lib/mcp-spawn-tee/src/index.ts +113 -84
  8. package/payload/platform/lib/mcp-spawn-tee/tsconfig.json +2 -1
  9. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -1
  10. package/payload/platform/plugins/docs/references/platform.md +2 -0
  11. package/payload/platform/plugins/email/PLUGIN.md +1 -1
  12. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.d.ts +2 -0
  13. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.d.ts.map +1 -0
  14. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.js +68 -0
  15. package/payload/platform/plugins/email/mcp/dist/__tests__/attachment-resolve.test.js.map +1 -0
  16. package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.d.ts +2 -0
  17. package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.d.ts.map +1 -0
  18. package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.js +55 -0
  19. package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.js.map +1 -0
  20. package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.d.ts +2 -0
  21. package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.d.ts.map +1 -0
  22. package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.js +110 -0
  23. package/payload/platform/plugins/email/mcp/dist/__tests__/providers.test.js.map +1 -0
  24. package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.d.ts +2 -0
  25. package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.d.ts.map +1 -0
  26. package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.js +57 -0
  27. package/payload/platform/plugins/email/mcp/dist/__tests__/recipient-filter.test.js.map +1 -0
  28. package/payload/platform/plugins/email/mcp/dist/index.js +8 -1
  29. package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
  30. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.d.ts +5 -0
  31. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.d.ts.map +1 -1
  32. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.js +35 -5
  33. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.js.map +1 -1
  34. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +13 -8
  35. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -1
  36. package/payload/platform/plugins/email/mcp/dist/lib/imap.js +26 -15
  37. package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -1
  38. package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.d.ts +8 -0
  39. package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.d.ts.map +1 -1
  40. package/payload/platform/plugins/email/mcp/dist/lib/ingest-batch.js.map +1 -1
  41. package/payload/platform/plugins/email/mcp/dist/lib/providers.d.ts +16 -5
  42. package/payload/platform/plugins/email/mcp/dist/lib/providers.d.ts.map +1 -1
  43. package/payload/platform/plugins/email/mcp/dist/lib/providers.js +120 -13
  44. package/payload/platform/plugins/email/mcp/dist/lib/providers.js.map +1 -1
  45. package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.js +3 -3
  46. package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.js.map +1 -1
  47. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.d.ts.map +1 -1
  48. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js +5 -3
  49. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js.map +1 -1
  50. package/payload/platform/plugins/email/mcp/dist/tools/email-send.d.ts.map +1 -1
  51. package/payload/platform/plugins/email/mcp/dist/tools/email-send.js +6 -3
  52. package/payload/platform/plugins/email/mcp/dist/tools/email-send.js.map +1 -1
  53. package/payload/platform/plugins/email/mcp/dist/tools/email-setup.d.ts.map +1 -1
  54. package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js +22 -4
  55. package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js.map +1 -1
  56. package/payload/platform/plugins/email/mcp/package.json +4 -2
  57. package/payload/platform/plugins/email/mcp/vitest.config.ts +9 -0
  58. package/payload/platform/plugins/email/references/email-reference.md +22 -5
  59. package/payload/platform/plugins/email/skills/email-composition/SKILL.md +1 -1
  60. package/payload/platform/plugins/graph/PLUGIN.md +2 -0
  61. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.d.ts +2 -0
  62. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.d.ts.map +1 -0
  63. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.js +31 -0
  64. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/kd-classify-account-dir.test.js.map +1 -0
  65. package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.d.ts +5 -0
  66. package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.d.ts.map +1 -1
  67. package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.js +21 -2
  68. package/payload/platform/plugins/memory/mcp/dist/tools/kd-classify.js.map +1 -1
  69. package/payload/platform/plugins/url-get/mcp/dist/tools/url-get.js +5 -5
  70. package/payload/platform/plugins/url-get/mcp/dist/tools/url-get.js.map +1 -1
  71. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  72. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +7 -1
  73. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  74. package/payload/server/public/assets/AdminShell-FO766lOW.js +1 -0
  75. package/payload/server/public/assets/{Checkbox-2reCESkb.js → Checkbox-syHoU9nY.js} +1 -1
  76. package/payload/server/public/assets/{admin-BpnsTEa3.js → admin-0_VxffD5.js} +1 -1
  77. package/payload/server/public/assets/{arc-BgelqC_3.js → arc-BW1WhwmV.js} +1 -1
  78. package/payload/server/public/assets/architecture-YZFGNWBL-xHbVjatf.js +1 -0
  79. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-BabnAZJm.js → architectureDiagram-Q4EWVU46-DsionCio.js} +1 -1
  80. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-BJzZqNsy.js → blockDiagram-DXYQGD6D-NOG5yVZk.js} +1 -1
  81. package/payload/server/public/assets/{browser-fgBRZ5gK.js → browser-Cxjkhtsk.js} +1 -1
  82. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-By-xuh9F.js → c4Diagram-AHTNJAMY-DwFV1k9I.js} +1 -1
  83. package/payload/server/public/assets/channel-D8Go_zJk.js +1 -0
  84. package/payload/server/public/assets/{chunk-2KRD3SAO-Gj2dSpBl.js → chunk-2KRD3SAO-CKn-bEkI.js} +1 -1
  85. package/payload/server/public/assets/{chunk-336JU56O-2PXVPCUA.js → chunk-336JU56O-iJ4ISPCi.js} +2 -2
  86. package/payload/server/public/assets/chunk-426QAEUC-sWe0Iexz.js +1 -0
  87. package/payload/server/public/assets/{chunk-4BX2VUAB-9XIBlnC2.js → chunk-4BX2VUAB-B2mSmC97.js} +1 -1
  88. package/payload/server/public/assets/{chunk-4TB4RGXK-Cr3mXPnI.js → chunk-4TB4RGXK-kKNYi2_i.js} +1 -1
  89. package/payload/server/public/assets/{chunk-55IACEB6-Ccg46J3A.js → chunk-55IACEB6-JLT9m7Hd.js} +1 -1
  90. package/payload/server/public/assets/{chunk-5FUZZQ4R-Cz9MvPKc.js → chunk-5FUZZQ4R-Car3r0he.js} +1 -1
  91. package/payload/server/public/assets/{chunk-5PVQY5BW-BleOdlgO.js → chunk-5PVQY5BW-DR9EfLvj.js} +1 -1
  92. package/payload/server/public/assets/{chunk-67CJDMHE-CyCYCQWy.js → chunk-67CJDMHE-CCdP3Pdx.js} +1 -1
  93. package/payload/server/public/assets/{chunk-7N4EOEYR-KpT3uHzH.js → chunk-7N4EOEYR-bXgVzdM9.js} +1 -1
  94. package/payload/server/public/assets/{chunk-AA7GKIK3-BfOzbuxq.js → chunk-AA7GKIK3-CYeDvY8B.js} +1 -1
  95. package/payload/server/public/assets/{chunk-BSJP7CBP-Bq0M3wlv.js → chunk-BSJP7CBP-U0Fi-Ers.js} +1 -1
  96. package/payload/server/public/assets/{chunk-CIAEETIT-CR-2dNaL.js → chunk-CIAEETIT-C8QrV6Gg.js} +1 -1
  97. package/payload/server/public/assets/{chunk-EDXVE4YY-egUGMTOS.js → chunk-EDXVE4YY-DLUWVRZV.js} +1 -1
  98. package/payload/server/public/assets/{chunk-ENJZ2VHE-CQohBEFw.js → chunk-ENJZ2VHE-B4bNJo6C.js} +1 -1
  99. package/payload/server/public/assets/{chunk-FMBD7UC4-DIxBUbLP.js → chunk-FMBD7UC4-DxAQS3UB.js} +1 -1
  100. package/payload/server/public/assets/{chunk-FOC6F5B3-C2694Zoq.js → chunk-FOC6F5B3-CyIK3zeY.js} +1 -1
  101. package/payload/server/public/assets/{chunk-ICPOFSXX-DpXZKHyn.js → chunk-ICPOFSXX-Qzl8Ki0l.js} +2 -2
  102. package/payload/server/public/assets/{chunk-K5T4RW27-CUicG0Rp.js → chunk-K5T4RW27-7GcDzjyJ.js} +1 -1
  103. package/payload/server/public/assets/{chunk-KGLVRYIC-B5mPJhOr.js → chunk-KGLVRYIC-B7pAr9hf.js} +1 -1
  104. package/payload/server/public/assets/{chunk-LIHQZDEY-q81QhuMs.js → chunk-LIHQZDEY-DEoU2jrz.js} +1 -1
  105. package/payload/server/public/assets/{chunk-ORNJ4GCN-DgurdFZs.js → chunk-ORNJ4GCN-BwMFuN24.js} +1 -1
  106. package/payload/server/public/assets/{chunk-OYMX7WX6-CxqMRu2d.js → chunk-OYMX7WX6-BenBO6O_.js} +1 -1
  107. package/payload/server/public/assets/chunk-QZHKN3VN-CHE_iZO7.js +1 -0
  108. package/payload/server/public/assets/{chunk-U2HBQHQK-BSLctJC9.js → chunk-U2HBQHQK-DewM8R0D.js} +1 -1
  109. package/payload/server/public/assets/{chunk-X2U36JSP--0AUeeFl.js → chunk-X2U36JSP-C22Q6Ea4.js} +1 -1
  110. package/payload/server/public/assets/{chunk-XPW4576I-D-hf9Bcn.js → chunk-XPW4576I-BA0a8Ygs.js} +1 -1
  111. package/payload/server/public/assets/{chunk-YZCP3GAM-PvOhSwI9.js → chunk-YZCP3GAM-DfUUNTnA.js} +1 -1
  112. package/payload/server/public/assets/{chunk-ZZ45TVLE-1zPUlNWz.js → chunk-ZZ45TVLE-CUT6zma2.js} +1 -1
  113. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BLb1mzrT.js +1 -0
  114. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-Ctj5qYTS.js +1 -0
  115. package/payload/server/public/assets/clone-DGZ2vydA.js +1 -0
  116. package/payload/server/public/assets/{cose-bilkent-S5V4N54A-Cvo-gkBd.js → cose-bilkent-S5V4N54A-Df_JmB8E.js} +1 -1
  117. package/payload/server/public/assets/{dagre-CMHsNfjP.js → dagre-CYXRIdv0.js} +1 -1
  118. package/payload/server/public/assets/{dagre-KV5264BT-CM1DSx4E.js → dagre-KV5264BT-D4EGb60h.js} +1 -1
  119. package/payload/server/public/assets/{data-Cuynp6Y6.js → data-BOgwOWnw.js} +1 -1
  120. package/payload/server/public/assets/{diagram-5BDNPKRD-VDHiHwEI.js → diagram-5BDNPKRD-BzieCEfT.js} +1 -1
  121. package/payload/server/public/assets/{diagram-G4DWMVQ6-OKdufoeW.js → diagram-G4DWMVQ6-DDbO71XD.js} +1 -1
  122. package/payload/server/public/assets/{diagram-MMDJMWI5-Yg6QdCA1.js → diagram-MMDJMWI5-DqQ_UXDA.js} +1 -1
  123. package/payload/server/public/assets/{diagram-TYMM5635-CpEMZQDu.js → diagram-TYMM5635-CFyxA1aZ.js} +1 -1
  124. package/payload/server/public/assets/{dist-811BIK0R.js → dist-BmvZ8OaX.js} +1 -1
  125. package/payload/server/public/assets/{erDiagram-SMLLAGMA-Dw5gAkFM.js → erDiagram-SMLLAGMA-BMaEBbOK.js} +1 -1
  126. package/payload/server/public/assets/{flatten-BsWEYbBB.js → flatten-Bo6YRmWl.js} +1 -1
  127. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-Cy_R1XHz.js → flowDiagram-DWJPFMVM-De5ChZQP.js} +1 -1
  128. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-BYARP_eH.js → ganttDiagram-T4ZO3ILL-CXEMPVaK.js} +1 -1
  129. package/payload/server/public/assets/gitGraph-7Q5UKJZL-CmHdoS27.js +1 -0
  130. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-BGOe0unY.js → gitGraphDiagram-UUTBAWPF-OZedr_6y.js} +1 -1
  131. package/payload/server/public/assets/{graph-Ddg24bjy.js → graph-BqD2GjQd.js} +2 -2
  132. package/payload/server/public/assets/{graph-labels-eOrWYy0R.js → graph-labels-DSDTSBfM.js} +1 -1
  133. package/payload/server/public/assets/{graphlib-DaefxCga.js → graphlib-CN4nhD2U.js} +1 -1
  134. package/payload/server/public/assets/info-OMHHGYJF-DTA9msO-.js +1 -0
  135. package/payload/server/public/assets/infoDiagram-42DDH7IO-CSqg4nRL.js +2 -0
  136. package/payload/server/public/assets/{isEmpty-BWl67LAZ.js → isEmpty-D6Kr-M1M.js} +1 -1
  137. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-YrGuzpiI.js → ishikawaDiagram-UXIWVN3A-ChlzrZyx.js} +1 -1
  138. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-EIykOcqg.js → journeyDiagram-VCZTEJTY-DsrK55ZO.js} +1 -1
  139. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-BR0TC6Je.js → kanban-definition-6JOO6SKY-DYF-_Rym.js} +1 -1
  140. package/payload/server/public/assets/{line-DPGcT5IM.js → line-3zmwI8XK.js} +1 -1
  141. package/payload/server/public/assets/{linear-CPN03uSh.js → linear-COm19-p7.js} +1 -1
  142. package/payload/server/public/assets/{mermaid-parser.core-D7Iu4c9M.js → mermaid-parser.core-BrcX8-cl.js} +2 -2
  143. package/payload/server/public/assets/{mermaid.core-krXRpXn9.js → mermaid.core-CBdz3b1N.js} +3 -3
  144. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-HwiCtPzN.js → mindmap-definition-QFDTVHPH-BqCqlYZb.js} +1 -1
  145. package/payload/server/public/assets/{ordinal-krseTxxN.js → ordinal-BDi6f4xk.js} +1 -1
  146. package/payload/server/public/assets/packet-4T2RLAQJ-6GjqIKgu.js +1 -0
  147. package/payload/server/public/assets/pie-ZZUOXDRM-T72DJ5JR.js +1 -0
  148. package/payload/server/public/assets/{pieDiagram-DEJITSTG-xodxyWLe.js → pieDiagram-DEJITSTG-D5LiILuM.js} +1 -1
  149. package/payload/server/public/assets/{public-xVaPcg6i.js → public-udi_Z7la.js} +3 -3
  150. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-DuYYY4ZZ.js → quadrantDiagram-34T5L4WZ-C3iuI5l_.js} +1 -1
  151. package/payload/server/public/assets/radar-PYXPWWZC-x-6xW1dE.js +1 -0
  152. package/payload/server/public/assets/{reduce-tk-xY6Fv.js → reduce-CGi9ik8i.js} +1 -1
  153. package/payload/server/public/assets/{requirementDiagram-MS252O5E-D0ta3kru.js → requirementDiagram-MS252O5E-CTPOw5qQ.js} +1 -1
  154. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-KdHdlzvT.js → sankeyDiagram-XADWPNL6-D_5aVlYp.js} +1 -1
  155. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-DoSFUTQZ.js → sequenceDiagram-FGHM5R23-D7h5vocM.js} +1 -1
  156. package/payload/server/public/assets/{src-Cpl1JzME.js → src-DLEIsjER.js} +1 -1
  157. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-BLW0KiSA.js → stateDiagram-FHFEXIEX-DyZjuwPj.js} +1 -1
  158. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BiW9pGXy.js +1 -0
  159. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-8QAzhYz1.js → timeline-definition-GMOUNBTQ-BqpVYJz_.js} +1 -1
  160. package/payload/server/public/assets/treeView-SZITEDCU-5-6wEryJ.js +1 -0
  161. package/payload/server/public/assets/treemap-W4RFUUIX-DF48Cc86.js +1 -0
  162. package/payload/server/public/assets/{useSelectionMode-DlJsX-_X.js → useSelectionMode-BPzPjKP_.js} +1 -1
  163. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-BKvfScOi.js → vennDiagram-DHZGUBPP-Czflml0e.js} +1 -1
  164. package/payload/server/public/assets/wardley-RL74JXVD-duKIa6Hq.js +1 -0
  165. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-DaMfDpJ3.js → wardleyDiagram-NUSXRM2D-Cqz3pSTK.js} +1 -1
  166. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-BIkNQlLa.js → xychartDiagram-5P7HB3ND-CS5dEuUO.js} +1 -1
  167. package/payload/server/public/browser.html +4 -4
  168. package/payload/server/public/data.html +5 -5
  169. package/payload/server/public/graph.html +6 -6
  170. package/payload/server/public/index.html +5 -5
  171. package/payload/server/public/public.html +4 -4
  172. package/payload/server/server.js +19 -39
  173. package/payload/server/public/assets/AdminShell-C6_5h1cC.js +0 -1
  174. package/payload/server/public/assets/architecture-YZFGNWBL-YM-TtgPY.js +0 -1
  175. package/payload/server/public/assets/channel-BRPH0atd.js +0 -1
  176. package/payload/server/public/assets/chunk-426QAEUC-QhauxjvK.js +0 -1
  177. package/payload/server/public/assets/chunk-QZHKN3VN-BDAQvtxz.js +0 -1
  178. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BJv89PB6.js +0 -1
  179. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DNUszH5M.js +0 -1
  180. package/payload/server/public/assets/clone-CREg9jLM.js +0 -1
  181. package/payload/server/public/assets/gitGraph-7Q5UKJZL-CtOPqykB.js +0 -1
  182. package/payload/server/public/assets/info-OMHHGYJF-Jba5enA8.js +0 -1
  183. package/payload/server/public/assets/infoDiagram-42DDH7IO-Df9BlkPA.js +0 -2
  184. package/payload/server/public/assets/packet-4T2RLAQJ-D_eWzeAP.js +0 -1
  185. package/payload/server/public/assets/pie-ZZUOXDRM-BDiy1Ob2.js +0 -1
  186. package/payload/server/public/assets/radar-PYXPWWZC-C5mlfmtg.js +0 -1
  187. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-C5zlCV4X.js +0 -1
  188. package/payload/server/public/assets/treeView-SZITEDCU-CM-9m-cS.js +0 -1
  189. package/payload/server/public/assets/treemap-W4RFUUIX-DDHPB-Xh.js +0 -1
  190. package/payload/server/public/assets/wardley-RL74JXVD-CUb3Br4q.js +0 -1
  191. package/payload/server/public/assets/whatsapp-BE79pNh8.js +0 -1
  192. package/payload/server/public/whatsapp.html +0 -18
  193. /package/payload/server/public/assets/{_baseFor-BHtDrjIo.js → _baseFor-Cam2PbSt.js} +0 -0
  194. /package/payload/server/public/assets/{array-DetWRiSa.js → array-DYRGGQae.js} +0 -0
  195. /package/payload/server/public/assets/{chunk-CWOGyPgy.js → chunk-CnGqDkHZ.js} +0 -0
  196. /package/payload/server/public/assets/{cytoscape.esm-C9yNhe1u.js → cytoscape.esm-nWsJMTNI.js} +0 -0
  197. /package/payload/server/public/assets/{defaultLocale-_WRwicXn.js → defaultLocale-Du1XY3Dp.js} +0 -0
  198. /package/payload/server/public/assets/{init-sTEcj9YX.js → init-B5BXBRcm.js} +0 -0
  199. /package/payload/server/public/assets/{katex-s61Rgv6l.js → katex-HOUACuRw.js} +0 -0
  200. /package/payload/server/public/assets/{path-B0Ik7Tu9.js → path-CNO468J-.js} +0 -0
  201. /package/payload/server/public/assets/{rough.esm-DKRO8IF-.js → rough.esm-DRO6hWPh.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy-code",
3
- "version": "0.1.280",
3
+ "version": "0.1.281",
4
4
  "description": "Install Maxy — AI for Productive People",
5
5
  "bin": {
6
6
  "create-maxy-code": "./dist/index.js"
@@ -1,53 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * MCP spawn-tee — parent-side stderr capture wrapper.
3
+ * MCP spawn-tee — parent-side stderr capture + lifecycle observability.
4
4
  *
5
- * Claude Code's `--mcp-config` accepts `{command, args, env}` descriptors and
6
- * spawns each MCP server itself; the platform never holds a ChildProcess
7
- * handle. The in-process `mcp-stderr-tee` patches `process.stderr.write` from
8
- * inside the MCP server, but its writes go through `createWriteStream`
9
- * async, buffered. A synchronous module-load throw (e.g. schema-loader's
10
- * line-168 width check on memory) calls `process.exit(1)` before the buffer
11
- * flushes, so the per-server log file is empty and the platform's
12
- * `[mcp-init-error] tail="(no stderr file)"` probe is operationally useless.
13
- * That class shipped as the chronic memory-MCP silent-fail loop fixed by
14
- * (and hit graph — solved there with per-plugin
15
- * `appendFileSync` discipline that this wrapper now generalises).
5
+ * Claude Code spawns each MCP server itself; the platform never holds a
6
+ * ChildProcess handle. This wrapper sits between Claude Code and the real
7
+ * MCP server: Claude Code runs `node <this> <real-entry>`, and the wrapper
8
+ * spawns the real entry with `stdio:['inherit','inherit','pipe']` so stdin
9
+ * and stdout (the JSON-RPC channel) pass through byte-identical. Only stderr
10
+ * is intercepted, and only for logging.
16
11
  *
17
- * The wrapper sits between Claude Code and the real MCP server: it spawns
18
- * the real entry with `stdio: ['inherit', 'inherit', 'pipe']`, then
19
- * synchronously appends every child stderr chunk to
20
- * `${LOG_DIR}/mcp-${name}-stderr-<date>.log`. Synchronous writes survive
21
- * `process.exit` because the kernel queues the syscall before the call
22
- * returns. The chunk is also written to the wrapper's own stderr so
23
- * Claude Code's existing stderr consumer is unchanged — the mechanism is
24
- * additive, not interceptive.
12
+ * Because the wrapper IS the helper's parent, it observes the helper's true
13
+ * exit code, signal, and lifetime for every death mode — including a SIGKILL
14
+ * or a transport-layer crash that an in-process handler would miss.
25
15
  *
26
- * Claude Code CLI
27
- * spawns
28
- *
29
- * wrapper (this file) — argv[2] = real entry, env.MCP_SPAWN_TEE_NAME = name
30
- * │ spawns child with stdio:['inherit','inherit','pipe']
31
- * ▼
32
- * child = node <real-entry>
33
- * │
34
- * ├──▶ stdin/stdout: inherited from wrapper (Claude Code pipe)
35
- * └──▶ stderr → wrapper.on('data', chunk =>)
36
- * ├──▶ appendFileSync(${LOG_DIR}/mcp-${name}-stderr-<date>.log)
37
- * └──▶ process.stderr.write(chunk) → Claude Code consumer
16
+ * Claude Code CLI → wrapper (this file) → child = node <real-entry>
17
+ * child stdin/stdout : inherited (Claude Code pipe, untouched)
18
+ * child stderr : piped → per-date log + per-session log + passthrough
38
19
  *
39
- * The wrapper catches:
40
- * - MODULE_NOT_FOUND on the entry script itself (success criterion #3:
41
- * `mv plugins/memory/mcp/dist plugins/memory/mcp/dist-broken && reboot`
42
- * leaves the cause on disk).
43
- * - Synchronous throws during module load before the in-process tee runs.
44
- * - Any stderr a normally-running plugin emits (steady-state telemetry
45
- * remains visible too — the in-process tee handles per-line stream-log
46
- * prefixing; this wrapper handles the raw per-server file).
20
+ * Destinations (Task 706):
21
+ * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` — per-date raw (back-compat;
22
+ * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
23
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
24
+ * lines; wrapper-only, so it never mixes the enumeration copy with the
25
+ * live copy. Authoritative sink. Absent when SESSION_ID is unset
26
+ * (enumeration spawn)then the per-date file is the fallback.
27
+ * - `server.log` via the loopback log-ingest route — best-effort mirror of
28
+ * the [mcp-helper] lifecycle lines. A dropped POST loses nothing because
29
+ * the per-session file already holds the line (written synchronously).
47
30
  *
48
- * SIGTERM/SIGINT propagation: forwarded to the child so a Claude Code
49
- * shutdown does not orphan the MCP server. Child exit code is propagated
50
- * verbatim so upstream (Claude Code) sees the real outcome.
31
+ * Lifecycle lines, correlation key `session=<id8> server=<name>`:
32
+ * [mcp-helper] op=spawn ... pid= entry=
33
+ * [mcp-helper] op=boot ... head=<first stderr bytes>
34
+ * [mcp-helper] op=exit ... code= signal= lifetimeMs= stderr-tail= (always)
35
+ *
36
+ * The wrapper never writes to fd 1 (stdout) — that is the JSON-RPC channel.
37
+ * SIGTERM/SIGINT are forwarded to the child so a Claude Code shutdown does
38
+ * not orphan it; the child exit code/signal is propagated verbatim.
51
39
  */
52
40
  export {};
53
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG"}
@@ -1,54 +1,42 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  /**
4
- * MCP spawn-tee — parent-side stderr capture wrapper.
4
+ * MCP spawn-tee — parent-side stderr capture + lifecycle observability.
5
5
  *
6
- * Claude Code's `--mcp-config` accepts `{command, args, env}` descriptors and
7
- * spawns each MCP server itself; the platform never holds a ChildProcess
8
- * handle. The in-process `mcp-stderr-tee` patches `process.stderr.write` from
9
- * inside the MCP server, but its writes go through `createWriteStream`
10
- * async, buffered. A synchronous module-load throw (e.g. schema-loader's
11
- * line-168 width check on memory) calls `process.exit(1)` before the buffer
12
- * flushes, so the per-server log file is empty and the platform's
13
- * `[mcp-init-error] tail="(no stderr file)"` probe is operationally useless.
14
- * That class shipped as the chronic memory-MCP silent-fail loop fixed by
15
- * (and hit graph — solved there with per-plugin
16
- * `appendFileSync` discipline that this wrapper now generalises).
6
+ * Claude Code spawns each MCP server itself; the platform never holds a
7
+ * ChildProcess handle. This wrapper sits between Claude Code and the real
8
+ * MCP server: Claude Code runs `node <this> <real-entry>`, and the wrapper
9
+ * spawns the real entry with `stdio:['inherit','inherit','pipe']` so stdin
10
+ * and stdout (the JSON-RPC channel) pass through byte-identical. Only stderr
11
+ * is intercepted, and only for logging.
17
12
  *
18
- * The wrapper sits between Claude Code and the real MCP server: it spawns
19
- * the real entry with `stdio: ['inherit', 'inherit', 'pipe']`, then
20
- * synchronously appends every child stderr chunk to
21
- * `${LOG_DIR}/mcp-${name}-stderr-<date>.log`. Synchronous writes survive
22
- * `process.exit` because the kernel queues the syscall before the call
23
- * returns. The chunk is also written to the wrapper's own stderr so
24
- * Claude Code's existing stderr consumer is unchanged — the mechanism is
25
- * additive, not interceptive.
13
+ * Because the wrapper IS the helper's parent, it observes the helper's true
14
+ * exit code, signal, and lifetime for every death mode — including a SIGKILL
15
+ * or a transport-layer crash that an in-process handler would miss.
26
16
  *
27
- * Claude Code CLI
28
- * spawns
29
- *
30
- * wrapper (this file) — argv[2] = real entry, env.MCP_SPAWN_TEE_NAME = name
31
- * │ spawns child with stdio:['inherit','inherit','pipe']
32
- * ▼
33
- * child = node <real-entry>
34
- * │
35
- * ├──▶ stdin/stdout: inherited from wrapper (Claude Code pipe)
36
- * └──▶ stderr → wrapper.on('data', chunk =>)
37
- * ├──▶ appendFileSync(${LOG_DIR}/mcp-${name}-stderr-<date>.log)
38
- * └──▶ process.stderr.write(chunk) → Claude Code consumer
17
+ * Claude Code CLI → wrapper (this file) → child = node <real-entry>
18
+ * child stdin/stdout : inherited (Claude Code pipe, untouched)
19
+ * child stderr : piped → per-date log + per-session log + passthrough
39
20
  *
40
- * The wrapper catches:
41
- * - MODULE_NOT_FOUND on the entry script itself (success criterion #3:
42
- * `mv plugins/memory/mcp/dist plugins/memory/mcp/dist-broken && reboot`
43
- * leaves the cause on disk).
44
- * - Synchronous throws during module load before the in-process tee runs.
45
- * - Any stderr a normally-running plugin emits (steady-state telemetry
46
- * remains visible too — the in-process tee handles per-line stream-log
47
- * prefixing; this wrapper handles the raw per-server file).
21
+ * Destinations (Task 706):
22
+ * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` — per-date raw (back-compat;
23
+ * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
24
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
25
+ * lines; wrapper-only, so it never mixes the enumeration copy with the
26
+ * live copy. Authoritative sink. Absent when SESSION_ID is unset
27
+ * (enumeration spawn)then the per-date file is the fallback.
28
+ * - `server.log` via the loopback log-ingest route — best-effort mirror of
29
+ * the [mcp-helper] lifecycle lines. A dropped POST loses nothing because
30
+ * the per-session file already holds the line (written synchronously).
48
31
  *
49
- * SIGTERM/SIGINT propagation: forwarded to the child so a Claude Code
50
- * shutdown does not orphan the MCP server. Child exit code is propagated
51
- * verbatim so upstream (Claude Code) sees the real outcome.
32
+ * Lifecycle lines, correlation key `session=<id8> server=<name>`:
33
+ * [mcp-helper] op=spawn ... pid= entry=
34
+ * [mcp-helper] op=boot ... head=<first stderr bytes>
35
+ * [mcp-helper] op=exit ... code= signal= lifetimeMs= stderr-tail= (always)
36
+ *
37
+ * The wrapper never writes to fd 1 (stdout) — that is the JSON-RPC channel.
38
+ * SIGTERM/SIGINT are forwarded to the child so a Claude Code shutdown does
39
+ * not orphan it; the child exit code/signal is propagated verbatim.
52
40
  */
53
41
  Object.defineProperty(exports, "__esModule", { value: true });
54
42
  const node_child_process_1 = require("node:child_process");
@@ -56,77 +44,116 @@ const node_fs_1 = require("node:fs");
56
44
  const node_path_1 = require("node:path");
57
45
  const SERVER_NAME = process.env.MCP_SPAWN_TEE_NAME ?? "unknown";
58
46
  const LOG_DIR = process.env.LOG_DIR;
47
+ const SESSION_ID = process.env.SESSION_ID;
48
+ const PLATFORM_PORT = process.env.PLATFORM_PORT;
59
49
  const ENTRY = process.argv[2];
60
- // Sync-emit: appendFileSync to per-server log + stderr passthrough. Used for
61
- // wrapper-internal diagnostics (attach line, errors) and for forwarding child
62
- // stderr chunks. Each destination wrapped independently an unwritable log
63
- // must not mask the primary output.
64
- function syncEmitLine(line) {
65
- if (LOG_DIR) {
66
- try {
67
- (0, node_fs_1.mkdirSync)(LOG_DIR, { recursive: true });
68
- const date = new Date().toISOString().slice(0, 10);
69
- (0, node_fs_1.appendFileSync)((0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${date}.log`), line);
70
- }
71
- catch {
72
- /* unwritable destination — preserve primary failure */
73
- }
50
+ const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
51
+ const spawnStamp = Date.now();
52
+ // Per-session raw + lifecycle log (Task 706). Wrapper-only. Empty SESSION_ID
53
+ // (enumeration spawn) undefined, and the per-date file is the fallback.
54
+ const perSessionPath = LOG_DIR && SESSION_ID
55
+ ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
56
+ : undefined;
57
+ const perDatePath = LOG_DIR
58
+ ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
59
+ : undefined;
60
+ // Rolling tail of child stderr for op=exit. Capped so a chatty child cannot
61
+ // grow the buffer without bound.
62
+ const TAIL_CAP = 2048;
63
+ let stderrTail = "";
64
+ let bootEmitted = false;
65
+ function appendSafe(path, data) {
66
+ if (!path || !LOG_DIR)
67
+ return;
68
+ try {
69
+ (0, node_fs_1.mkdirSync)(LOG_DIR, { recursive: true });
70
+ (0, node_fs_1.appendFileSync)(path, data);
71
+ }
72
+ catch {
73
+ /* unwritable destination — never mask primary output */
74
74
  }
75
+ }
76
+ // Best-effort mirror of a lifecycle line to server.log via the loopback
77
+ // log-ingest route. Fire-and-forget: the per-session file is authoritative,
78
+ // so a dropped POST (unreachable port, process exiting) loses nothing.
79
+ function postToServerLog(suffix, level) {
80
+ if (!PLATFORM_PORT)
81
+ return;
75
82
  try {
76
- process.stderr.write(line);
83
+ const ctrl = new AbortController();
84
+ const t = setTimeout(() => ctrl.abort(), 500);
85
+ t.unref?.(); // never let the abort timer keep the wrapper's event loop alive
86
+ void fetch(`http://127.0.0.1:${PLATFORM_PORT}/api/admin/log-ingest`, {
87
+ method: "POST",
88
+ headers: { "content-type": "application/json" },
89
+ body: JSON.stringify({ tag: "mcp-helper", level, line: suffix }),
90
+ signal: ctrl.signal,
91
+ }).then(() => clearTimeout(t)).catch(() => clearTimeout(t));
77
92
  }
78
93
  catch {
79
- /* stderr closednothing else to do */
94
+ /* fetch threw synchronously best-effort only */
95
+ }
96
+ }
97
+ // Emit one [mcp-helper] lifecycle line: authoritative per-session file (sync,
98
+ // survives process.exit), the wrapper's own stderr (journald / Claude Code
99
+ // visibility), and a best-effort server.log mirror. `suffix` is the line body
100
+ // after the tag and carries no newline (the log-ingest route rejects newlines).
101
+ function emitLifecycle(suffix, level) {
102
+ const line = `[mcp-helper] ${suffix}\n`;
103
+ appendSafe(perSessionPath, line);
104
+ try {
105
+ process.stderr.write(line);
80
106
  }
107
+ catch { /* stderr closed */ }
108
+ postToServerLog(suffix, level);
81
109
  }
82
110
  if (!ENTRY) {
83
- syncEmitLine(`[mcp-spawn-tee-error] server=${SERVER_NAME} reason="no entry given (argv[2] missing)"\n`);
111
+ emitLifecycle(`op=error session=${SESSION_ID8} server=${SERVER_NAME} reason="no entry given (argv[2] missing)"`, "error");
84
112
  process.exit(2);
85
113
  }
86
114
  const child = (0, node_child_process_1.spawn)(process.execPath, [ENTRY], {
87
115
  stdio: ["inherit", "inherit", "pipe"],
88
116
  env: process.env,
89
117
  });
90
- syncEmitLine(`[mcp-spawn-tee-attached] server=${SERVER_NAME} pid=${child.pid ?? -1} entry=${ENTRY}\n`);
118
+ emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${child.pid ?? -1} entry=${ENTRY}`, "info");
91
119
  child.on("error", (err) => {
92
120
  const msg = err instanceof Error ? err.message : String(err);
93
- syncEmitLine(`[mcp-spawn-tee-error] server=${SERVER_NAME} reason=${JSON.stringify(`spawn error: ${msg}`)}\n`);
121
+ emitLifecycle(`op=error session=${SESSION_ID8} server=${SERVER_NAME} reason=${JSON.stringify(`spawn error: ${msg}`)}`, "error");
94
122
  process.exit(127);
95
123
  });
96
124
  if (child.stderr) {
97
125
  child.stderr.on("data", (chunk) => {
98
- if (LOG_DIR) {
99
- try {
100
- const date = new Date().toISOString().slice(0, 10);
101
- (0, node_fs_1.appendFileSync)((0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${date}.log`), chunk);
102
- }
103
- catch {
104
- /* unwritable destination — preserve passthrough */
105
- }
106
- }
126
+ appendSafe(perDatePath, chunk); // per-date raw (back-compat)
127
+ appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
107
128
  try {
108
129
  process.stderr.write(chunk);
109
130
  }
110
- catch {
111
- /* stderr closed nothing else to do */
131
+ catch { /* stderr closed */ } // passthrough
132
+ stderrTail = (stderrTail + chunk.toString("utf8")).slice(-TAIL_CAP);
133
+ if (!bootEmitted) {
134
+ bootEmitted = true;
135
+ const head = chunk.toString("utf8").split("\n")[0].slice(0, 200);
136
+ emitLifecycle(`op=boot session=${SESSION_ID8} server=${SERVER_NAME} head=${JSON.stringify(head)}`, "info");
112
137
  }
113
138
  });
114
139
  }
115
- // Forward SIGTERM/SIGINT so Claude Code shutdown doesn't orphan the child.
116
- const forward = (signal) => {
117
- if (!child.killed)
118
- child.kill(signal);
119
- };
140
+ const forward = (signal) => { if (!child.killed)
141
+ child.kill(signal); };
120
142
  process.on("SIGTERM", () => forward("SIGTERM"));
121
143
  process.on("SIGINT", () => forward("SIGINT"));
144
+ // Signal → number, so a signal-killed child propagates as 128+signum (the
145
+ // shell convention). `code` is null on a signal exit, so `128 + (code ?? 0)`
146
+ // would collapse every signal to 128 and lose the signal identity in the
147
+ // wrapper's own exit status.
148
+ const SIGNUM = { SIGHUP: 1, SIGINT: 2, SIGQUIT: 3, SIGKILL: 9, SIGTERM: 15 };
122
149
  child.on("exit", (code, signal) => {
123
- if (signal) {
124
- syncEmitLine(`[mcp-spawn-tee-exit] server=${SERVER_NAME} pid=${child.pid ?? -1} signal=${signal}\n`);
125
- process.exit(128 + (code ?? 0));
126
- }
127
- if (code !== 0) {
128
- syncEmitLine(`[mcp-spawn-tee-exit] server=${SERVER_NAME} pid=${child.pid ?? -1} code=${code}\n`);
129
- }
150
+ const lifetimeMs = Date.now() - spawnStamp;
151
+ const tail = stderrTail.slice(-200);
152
+ const level = signal || (code ?? 0) !== 0 ? "error" : "info";
153
+ emitLifecycle(`op=exit session=${SESSION_ID8} server=${SERVER_NAME} pid=${child.pid ?? -1} ` +
154
+ `code=${code ?? "—"} signal=${signal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
155
+ if (signal)
156
+ process.exit(128 + (SIGNUM[signal] ?? 0));
130
157
  process.exit(code ?? 0);
131
158
  });
132
159
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;AAEH,2DAA2C;AAC3C,qCAAoD;AACpD,yCAAoC;AAEpC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAAC;AAChE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AACpC,MAAM,KAAK,GAAG,OAAO,CAAC,I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AW,QAAQ,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG;QAC9E,QAAQ,IAAI,IAAI,GAAG,WAAW,MAAM,IAAI,GAAG,eAAe,UAAU,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAC1G,KAAK,CACN,CAAC;IACF,IAAI,MAAM;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,111 @@
1
+ import { afterEach, beforeAll, describe, expect, it } from 'vitest'
2
+ import { execFileSync, spawn, spawnSync } from 'node:child_process'
3
+ import {
4
+ existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync,
5
+ } from 'node:fs'
6
+ import { tmpdir } from 'node:os'
7
+ import { dirname, join, resolve } from 'node:path'
8
+ import { fileURLToPath } from 'node:url'
9
+
10
+ const here = dirname(fileURLToPath(import.meta.url))
11
+ const libRoot = resolve(here, '..', '..') // platform/lib/mcp-spawn-tee
12
+ const wrapper = join(libRoot, 'dist', 'index.js')
13
+ const tsc = resolve(libRoot, '..', '..', 'node_modules', '.bin', 'tsc')
14
+
15
+ // Build the real artifact once; tests then exercise the shipped wrapper, not a
16
+ // re-implementation — that is what catches stdio-wiring regressions.
17
+ beforeAll(() => {
18
+ execFileSync(tsc, ['-p', 'tsconfig.json'], { cwd: libRoot, stdio: 'inherit' })
19
+ expect(existsSync(wrapper)).toBe(true)
20
+ })
21
+
22
+ let tmp = ''
23
+ afterEach(() => { if (tmp) { rmSync(tmp, { recursive: true, force: true }); tmp = '' } })
24
+
25
+ function makeStub(body: string): { stub: string; logDir: string } {
26
+ tmp = mkdtempSync(join(tmpdir(), 'spawn-tee-'))
27
+ const stub = join(tmp, 'stub-child.js')
28
+ writeFileSync(stub, body, 'utf8')
29
+ return { stub, logDir: join(tmp, 'logs') }
30
+ }
31
+
32
+ function runSync(stub: string, env: Record<string, string>) {
33
+ return spawnSync(process.execPath, [wrapper, stub], {
34
+ env: { ...process.env, SESSION_ID: '', PLATFORM_PORT: '', ...env },
35
+ encoding: 'utf8',
36
+ })
37
+ }
38
+
39
+ function sessionLog(logDir: string, server: string, sessionId: string): string {
40
+ return readFileSync(join(logDir, `mcp-${server}-${sessionId}.log`), 'utf8')
41
+ }
42
+
43
+ describe('mcp-spawn-tee wrapper', () => {
44
+ it('captures child stderr to a per-session file and emits one op=exit on clean exit', () => {
45
+ const { stub, logDir } = makeStub('process.stderr.write("hello-from-child\\n"); process.exit(0)')
46
+ runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'abcd1234-session', MCP_SPAWN_TEE_NAME: 'stub' })
47
+ const log = sessionLog(logDir, 'stub', 'abcd1234-session')
48
+ expect(log).toContain('hello-from-child')
49
+ const exits = log.split('\n').filter((l) => l.includes('op=exit'))
50
+ expect(exits).toHaveLength(1)
51
+ expect(exits[0]).toContain('code=0')
52
+ expect(exits[0]).toMatch(/lifetimeMs=\d+/)
53
+ expect(exits[0]).toContain('stderr-tail=')
54
+ expect(exits[0]).toContain('hello-from-child')
55
+ })
56
+
57
+ it('emits op=spawn at start and op=boot on first child stderr', () => {
58
+ const { stub, logDir } = makeStub('process.stderr.write("[stub] boot line\\n"); process.exit(0)')
59
+ runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'sess-0001', MCP_SPAWN_TEE_NAME: 'stub' })
60
+ const log = sessionLog(logDir, 'stub', 'sess-0001')
61
+ expect(log).toMatch(/op=spawn .*server=stub pid=\d+ entry=/)
62
+ expect(log).toContain('op=boot')
63
+ expect(log).toContain('head="[stub] boot line"')
64
+ })
65
+
66
+ it('op=exit carries a non-zero exit code', () => {
67
+ const { stub, logDir } = makeStub('process.stderr.write("dying\\n"); process.exit(3)')
68
+ const r = runSync(stub, { LOG_DIR: logDir, SESSION_ID: 's3', MCP_SPAWN_TEE_NAME: 'stub' })
69
+ expect(r.status).toBe(3)
70
+ const exit = sessionLog(logDir, 'stub', 's3').split('\n').find((l) => l.includes('op=exit'))!
71
+ expect(exit).toContain('code=3')
72
+ expect(exit).toContain('signal=—')
73
+ })
74
+
75
+ it('op=exit carries the signal name when the child is killed', async () => {
76
+ const { stub, logDir } = makeStub('process.stderr.write("alive\\n"); setInterval(() => {}, 1000)')
77
+ const cp = spawn(process.execPath, [wrapper, stub], {
78
+ env: { ...process.env, SESSION_ID: 'sig1', PLATFORM_PORT: '', LOG_DIR: logDir, MCP_SPAWN_TEE_NAME: 'stub' },
79
+ })
80
+ await new Promise((res) => setTimeout(res, 500))
81
+ cp.kill('SIGTERM')
82
+ const exitCode = await new Promise<number | null>((res) => cp.on('exit', (code) => res(code)))
83
+ const exit = sessionLog(logDir, 'stub', 'sig1').split('\n').find((l) => l.includes('op=exit'))!
84
+ expect(exit).toContain('signal=SIGTERM')
85
+ // The wrapper propagates a signal kill as 128+signum (SIGTERM=15 → 143),
86
+ // not a flat 128 — otherwise the signal identity is lost in the exit status.
87
+ expect(exitCode).toBe(143)
88
+ })
89
+
90
+ it('passes child stdout through untouched (MCP transport intact)', () => {
91
+ const { stub, logDir } = makeStub('process.stdout.write("JSONRPC-PAYLOAD"); process.exit(0)')
92
+ const r = runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'out1', MCP_SPAWN_TEE_NAME: 'stub' })
93
+ expect(r.stdout).toBe('JSONRPC-PAYLOAD')
94
+ })
95
+
96
+ it('falls back to the per-date file when SESSION_ID is absent', () => {
97
+ const { stub, logDir } = makeStub('process.stderr.write("enum-boot\\n"); process.exit(0)')
98
+ runSync(stub, { LOG_DIR: logDir, MCP_SPAWN_TEE_NAME: 'stub' }) // SESSION_ID forced empty by runSync
99
+ const files = readdirSync(logDir)
100
+ expect(files.some((f) => /^mcp-stub-stderr-\d{4}-\d{2}-\d{2}\.log$/.test(f))).toBe(true)
101
+ const perDate = readFileSync(join(logDir, files.find((f) => f.includes('stderr-'))!), 'utf8')
102
+ expect(perDate).toContain('enum-boot')
103
+ })
104
+
105
+ it('does not crash when PLATFORM_PORT is unreachable', () => {
106
+ const { stub, logDir } = makeStub('process.stderr.write("x\\n"); process.exit(0)')
107
+ const r = runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'p1', MCP_SPAWN_TEE_NAME: 'stub', PLATFORM_PORT: '59999' })
108
+ expect(r.status).toBe(0)
109
+ expect(sessionLog(logDir, 'stub', 'p1')).toContain('op=exit')
110
+ })
111
+ })