sanoma 0.11.24 → 0.11.26

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 (682) hide show
  1. package/README.md +27 -218
  2. package/app/README.md +19 -496
  3. package/app/dist/agent-router.d.ts +68 -0
  4. package/app/dist/agent-router.js +364 -0
  5. package/app/dist/agent-router.js.map +1 -0
  6. package/app/dist/api.d.ts +62 -21
  7. package/app/dist/api.js +19 -23
  8. package/app/dist/api.js.map +1 -1
  9. package/app/dist/app-bundle.d.ts +22 -2
  10. package/app/dist/app-bundle.js.map +1 -1
  11. package/app/dist/bundle-build.d.ts +3 -9
  12. package/app/dist/bundle-build.js +13 -21
  13. package/app/dist/bundle-build.js.map +1 -1
  14. package/app/dist/client/assets/ArrowDown.es-CcwNQSD9.js +1 -0
  15. package/app/dist/client/assets/DialogTitle-D9yBUT7d.js +1 -0
  16. package/app/dist/client/assets/Function.es-CiOYNbfh.js +1 -0
  17. package/app/dist/client/assets/{_id-DpXaqFb0.js → _id-COueWOzP.js} +1 -1
  18. package/app/dist/client/assets/_id-CgSZkWFR.js +1 -0
  19. package/app/dist/client/assets/{_id-B2CwocmD.js → _id-D3BoRB48.js} +1 -1
  20. package/app/dist/client/assets/{_id-Cd0g-T0m.js → _id-DDD_ITXx.js} +1 -1
  21. package/app/dist/client/assets/_id-Doju8qUR.js +1 -0
  22. package/app/dist/client/assets/_name-7EgMexzO.js +1 -0
  23. package/app/dist/client/assets/{_name-DNoZHFvr.js → _name-C3TWd0NA.js} +1 -1
  24. package/app/dist/client/assets/_name-CR3Qqon_.js +4 -0
  25. package/app/dist/client/assets/{_name-Cy9gSmms.js → _name-DbfrpSJT.js} +1 -1
  26. package/app/dist/client/assets/_vendor-B9Oh8xNB.js +1 -0
  27. package/app/dist/client/assets/{_vendor-CkX_MEw-.js → _vendor-bEmTq5QU.js} +1 -1
  28. package/app/dist/client/assets/app-chrome-CzcZez2G.js +5 -0
  29. package/app/dist/client/assets/{app-scope-DWi_J8Sd.js → app-scope-BV6uM0uK.js} +1 -1
  30. package/app/dist/client/assets/approval-CcJFVQB7.js +1 -0
  31. package/app/dist/client/assets/{apps-QmiHwEGA.js → apps-BwmXpIZ7.js} +1 -1
  32. package/app/dist/client/assets/{change-glance-BKxlAFtS.js → change-glance-BYVLeDLI.js} +1 -1
  33. package/app/dist/client/assets/{changes-DELoHd2O.js → changes-B3Z_0p4M.js} +1 -1
  34. package/app/dist/client/assets/changes-CihK9Huo.js +1 -0
  35. package/app/dist/client/assets/common-WJKVhtNw.js +3 -0
  36. package/app/dist/client/assets/{connect-Ctz5pmEW.js → connect-CC1Se3F9.js} +1 -1
  37. package/app/dist/client/assets/connect-agent-B1UifylG.js +14 -0
  38. package/app/dist/client/assets/connections-OO1NDgc1.js +5 -0
  39. package/app/dist/client/assets/connectors-mnoegKZk.js +1 -0
  40. package/app/dist/client/assets/credentials-C-kN42O9.js +1 -0
  41. package/app/dist/client/assets/data-Dlx7LdSP.js +1 -0
  42. package/app/dist/client/assets/decidable-Zmplty0k.js +1 -0
  43. package/app/dist/client/assets/{declaration-form-DyluX0R-.js → declaration-form-DHOktMul.js} +1 -1
  44. package/app/dist/client/assets/{dialog-DDAfDsGh.js → dialog-Dsef6lvQ.js} +1 -1
  45. package/app/dist/client/assets/{existing-DgMjm5Gb.js → existing-BJJGu3LZ.js} +1 -1
  46. package/app/dist/client/assets/{fence-B7mBhZq1.js → fence-Cjuv7UnK.js} +1 -1
  47. package/app/dist/client/assets/{graph-CI9HJ0Fq.js → graph-L74sHyvx.js} +2 -2
  48. package/app/dist/client/assets/grid-diff-pzwWoTh4.js +1 -0
  49. package/app/dist/client/assets/held-card-BnSjtbEo.js +1 -0
  50. package/app/dist/client/assets/{highlighted-body-JLMTFACH-CizP1ld1.js → highlighted-body-JLMTFACH-W_A7gIsD.js} +1 -1
  51. package/app/dist/client/assets/hosting-C1TopaP_.js +1 -0
  52. package/app/dist/client/assets/import-Bu6yGCcD.js +1 -0
  53. package/app/dist/client/assets/inbox-DXzDv0eC.js +1 -0
  54. package/app/dist/client/assets/inbox-Dto80Qqh.js +1 -0
  55. package/app/dist/client/assets/index-bWqaZ5SR.js +10 -0
  56. package/app/dist/client/assets/{item-CXBFegng.js → item-CNT-9uI-.js} +1 -1
  57. package/app/dist/client/assets/kit-BNTzGjDn.js +1 -0
  58. package/app/dist/client/assets/{lazyRouteComponent-A5qFQUwF.js → lazyRouteComponent-663wY27U.js} +1 -1
  59. package/app/dist/client/assets/{markdown-BBLvchh4.js → markdown-CBEdAnWH.js} +5 -5
  60. package/app/dist/client/assets/mermaid-WFAXDIZX-COpX35v0.js +1 -0
  61. package/app/dist/client/assets/operations._name-BsZkO0sP.js +1 -0
  62. package/app/dist/client/assets/operations._name-CKXoxg5Q.js +1 -0
  63. package/app/dist/client/assets/people-B8-WHpbD.js +1 -0
  64. package/app/dist/client/assets/permissions-Ajcu9fkv.js +2 -0
  65. package/app/dist/client/assets/permissions-grid-0-cx77oT.js +1 -0
  66. package/app/dist/client/assets/{queries-sOO2EuSp.js → queries-BTgXQRLH.js} +2 -2
  67. package/app/dist/client/assets/review-C5Wt_3Az.js +2 -0
  68. package/app/dist/client/assets/{route-rcZHTxxF.js → route-BTO8mZ6d.js} +1 -1
  69. package/app/dist/client/assets/{route-BQgUCUI-.js → route-D4TNDOXy.js} +1 -1
  70. package/app/dist/client/assets/{routes-uzcnBShG.js → routes-BcuQlVc8.js} +1 -1
  71. package/app/dist/client/assets/{runs-table-CfvJDLfm.js → runs-table-DjqR0vHc.js} +1 -1
  72. package/app/dist/client/assets/{scenario-W7uPU063.js → scenario-CYwAtzNF.js} +1 -1
  73. package/app/dist/client/assets/{scenario-graph-CjY0h_3M.js → scenario-graph-td6ZqT9V.js} +1 -1
  74. package/app/dist/client/assets/schema-sj9EVfUR.js +1 -0
  75. package/app/dist/client/assets/{sheet-BTH95vFG.js → sheet-DMcSK8Z6.js} +1 -1
  76. package/app/dist/client/assets/{sites.index-3TQpsLus.js → sites.index-DnbsC9iZ.js} +1 -1
  77. package/app/dist/client/assets/start-form-B4lodl8U.js +1 -0
  78. package/app/dist/client/assets/store-KLA3q213.js +1 -0
  79. package/app/dist/client/assets/style-C2XpsyK6.css +2 -0
  80. package/app/dist/client/assets/{useLoaderData-BEdUbEde.js → useLoaderData-BfAUM6vV.js} +1 -1
  81. package/app/dist/client/assets/useOpenInteractionType-BKwnMlfm.js +1 -0
  82. package/app/dist/client/assets/{useRegisterFieldControl-CT8iqvDE.js → useRegisterFieldControl-YchGsH0P.js} +1 -1
  83. package/app/dist/client/assets/{who-are-you-D8N5yjZE.js → who-are-you-ByL2bQ_I.js} +1 -1
  84. package/app/dist/client/assets/workflow-C4e2RPVy.js +1 -0
  85. package/app/dist/client/assets/workflow-view-_uuHOg0C.js +1 -0
  86. package/app/dist/client/assets/{workflows-CF1eg5bA.js → workflows-Dll7wi8z.js} +1 -1
  87. package/app/dist/components/grid/plan.d.ts +41 -23
  88. package/app/dist/components/grid/plan.js +116 -63
  89. package/app/dist/components/grid/plan.js.map +1 -1
  90. package/app/dist/context.d.ts +7 -2
  91. package/app/dist/demo-build.d.ts +14 -7
  92. package/app/dist/demo-build.js +45 -15
  93. package/app/dist/demo-build.js.map +1 -1
  94. package/app/dist/handler.d.ts +15 -2
  95. package/app/dist/handler.js +35 -6
  96. package/app/dist/handler.js.map +1 -1
  97. package/app/dist/index.d.ts +11 -1
  98. package/app/dist/index.js +3 -1
  99. package/app/dist/index.js.map +1 -1
  100. package/app/dist/lib/chat.d.ts +84 -11
  101. package/app/dist/lib/chat.js +54 -9
  102. package/app/dist/lib/chat.js.map +1 -1
  103. package/app/dist/lib/company-state.d.ts +49 -0
  104. package/app/dist/lib/company-state.js +56 -0
  105. package/app/dist/lib/company-state.js.map +1 -0
  106. package/app/dist/lib/operations.d.ts +188 -0
  107. package/app/dist/lib/operations.js +73 -0
  108. package/app/dist/lib/operations.js.map +1 -0
  109. package/app/dist/login/admission.js +5 -2
  110. package/app/dist/login/admission.js.map +1 -1
  111. package/app/dist/login/page.js +11 -4
  112. package/app/dist/login/page.js.map +1 -1
  113. package/app/dist/login/public.js +1 -2
  114. package/app/dist/login/public.js.map +1 -1
  115. package/app/dist/login/staff.d.ts +14 -7
  116. package/app/dist/login/staff.js +236 -55
  117. package/app/dist/login/staff.js.map +1 -1
  118. package/app/dist/server/assets/{_id-ChjpKAh9.js → _id-B9aCLkow.js} +1 -1
  119. package/app/dist/server/assets/{_id-_meozwGS.js → _id-BWH3uVGy.js} +13 -11
  120. package/app/dist/server/assets/{_id-DLn-MJis.js → _id-Co12FiVj.js} +1 -1
  121. package/app/dist/server/assets/{_id-COm1il39.js → _id-Lo8RtD8f.js} +1 -1
  122. package/app/dist/server/assets/{_id-S6cZBKRd.js → _id-SV_go0FE.js} +6 -6
  123. package/app/dist/server/assets/{_name-CIfg_fie.js → _name-48nnwErV.js} +9 -9
  124. package/app/dist/server/assets/{_name-C7E4pvya.js → _name-BSxshpQ5.js} +1 -1
  125. package/app/dist/server/assets/{_name-Bli8LVNv.js → _name-C1YpYrTx.js} +4 -3
  126. package/app/dist/server/assets/{_name-B-uy64Pg.js → _name-CDSGDekt.js} +190 -50
  127. package/app/dist/server/assets/{_tanstack-start-manifest_v-Ngrl1Rzd.js → _tanstack-start-manifest_v-Cgg94-dq.js} +92 -81
  128. package/app/dist/server/assets/{_vendor-CcjWwCkS.js → _vendor-B15N7FgV.js} +1 -1
  129. package/app/dist/server/assets/{_vendor-R5UJa3bN.js → _vendor-CJlB6wAc.js} +15 -13
  130. package/app/dist/server/assets/{actor-BsKC225p.js → actor-DQihWwZW.js} +1 -1
  131. package/app/dist/server/assets/{app-chrome-VJfQ5Mof.js → app-chrome-CRK9r62z.js} +51 -161
  132. package/app/dist/server/assets/{app-scope-DQmTl_K1.js → app-scope-DdMA2kMx.js} +1 -1
  133. package/app/dist/server/assets/{apply-plan-WEi9x_3r.js → apply-plan-Cu_DNSH2.js} +4 -4
  134. package/app/dist/server/assets/{approval-B0b2wxUM.js → approval-B9AIzyOA.js} +7 -7
  135. package/app/dist/server/assets/{apps-C8jD3qwc.js → apps-CNa4ZEAu.js} +3 -3
  136. package/app/dist/server/assets/{change-glance-DFnHAMy8.js → change-glance-4k_lD-qK.js} +3 -3
  137. package/app/dist/server/assets/{changes-_1nrzrkD.js → changes-BjBLZsCp.js} +6 -6
  138. package/app/dist/server/assets/{changes-BHaboSg4.js → changes-DSMSX6E0.js} +7 -2
  139. package/app/dist/server/assets/{chat-CjIUcz1X.js → chat-8lq598Ua.js} +420 -136
  140. package/app/dist/server/assets/{common-CMaicuwY.js → common-i7HtEvKg.js} +84 -50
  141. package/app/dist/server/assets/{connect-D7hUXnmu.js → connect-DkdRG_rZ.js} +6 -6
  142. package/app/dist/server/assets/connect-agent-DTE0sr-8.js +162 -0
  143. package/app/dist/server/assets/{connections-DggOUl36.js → connections-D65Uxsry.js} +4 -4
  144. package/app/dist/server/assets/{connectors-Cy9QQORA.js → connectors-aP9CdAh4.js} +68 -8
  145. package/app/dist/server/assets/{credentials-D9I2wC5H.js → credentials-kANsFu3l.js} +3 -3
  146. package/app/dist/server/assets/{data-COpRD5on.js → data-D-aNBh4S.js} +13 -15
  147. package/app/dist/server/assets/{declaration-form-bQ62tjfF.js → declaration-form-BJRZYx1j.js} +4 -4
  148. package/app/dist/server/assets/{dropdown-menu-RGvPORm4.js → dropdown-menu-e46ESJbQ.js} +31 -2
  149. package/app/dist/server/assets/{existing-hVK7PMG2.js → existing-4eqondKg.js} +3 -3
  150. package/app/dist/server/assets/{fence-Bj_9g3rg.js → fence-DaS6DvOb.js} +1 -1
  151. package/app/dist/server/assets/{functions-BoUQY2oK.js → functions-wN6c8Twd.js} +63 -34
  152. package/app/dist/server/assets/{graph-BTPVQSHz.js → graph-BldnW8Fd.js} +116 -51
  153. package/app/dist/server/assets/{grid-diff-D5bQDKl2.js → grid-diff-WdeH1_K-.js} +10 -10
  154. package/app/dist/server/assets/{held-card-azTQ59Ej.js → held-card-DrqeQzPd.js} +5 -5
  155. package/app/dist/server/assets/{hosting-Bm9w58P_.js → hosting-CkeOmCpy.js} +15 -13
  156. package/app/dist/server/assets/{import-Du4ZsTfq.js → import-DA8iyU2_.js} +7 -7
  157. package/app/dist/server/assets/{inbox-3RrayHBo.js → inbox-BAX5dF4C.js} +2 -2
  158. package/app/dist/server/assets/{inbox-BVMK6y2v.js → inbox-Utyss_FI.js} +6 -6
  159. package/app/dist/server/assets/{markdown-Bi6HvGoy.js → markdown-DiIT1Tr8.js} +2 -2
  160. package/app/dist/server/assets/{middleware-CBVxoq2y.js → middleware-B4oxMQlf.js} +233 -117
  161. package/app/dist/server/assets/operations._name-C4hDrT32.js +134 -0
  162. package/app/dist/server/assets/operations._name-Dctg1NZR.js +23 -0
  163. package/app/dist/server/assets/{people-B_ViX4ba.js → people-DFg8O6sq.js} +100 -39
  164. package/app/dist/server/assets/{permissions-B3oXK0Mo.js → permissions-DdsEx9aC.js} +15 -8
  165. package/app/dist/server/assets/{permissions-grid-CwWWdcQA.js → permissions-grid-DrFoMfIP.js} +51 -20
  166. package/app/dist/server/assets/{queries-Fn3kOI_N.js → queries-DjW1OUQc.js} +35 -45
  167. package/app/dist/server/assets/{review-BeYrtk4_.js → review-BULIv_qZ.js} +99 -53
  168. package/app/dist/server/assets/{route-BB2eQcP8.js → route-C2OOhovr.js} +1 -1
  169. package/app/dist/server/assets/{route-MqkQm62a.js → route-DH8uaU9_.js} +1 -1
  170. package/app/dist/server/assets/{router-DYacwjCf.js → router-DhV2uomr.js} +247 -305
  171. package/app/dist/server/assets/{routes-CukD54S2.js → routes-fIOUAduJ.js} +6 -6
  172. package/app/dist/server/assets/{runs-table-Bh8OZnyu.js → runs-table-fRClw7Xe.js} +3 -3
  173. package/app/dist/server/assets/{scenario-Cy6zT6QN.js → scenario-CVNgn38R.js} +2 -2
  174. package/app/dist/server/assets/{scenario-graph-BErXIRgF.js → scenario-graph-oA6oJqcX.js} +9 -3
  175. package/app/dist/server/assets/{schema-DBT8KJsP.js → schema-B6m6-Nxb.js} +24 -2
  176. package/app/dist/server/assets/{sites.index-G_BM9Vwq.js → sites.index-zoUIZorz.js} +2 -2
  177. package/app/dist/server/assets/{start-Dt_p0wFY.js → start-Dcpk_AKJ.js} +2 -2
  178. package/app/dist/server/assets/{start-form-mCkPkdmv.js → start-form-Brm9_4kF.js} +9 -6
  179. package/app/dist/server/assets/{who-are-you-BmmCoQYi.js → who-are-you-Cqe3JRrW.js} +4 -4
  180. package/app/dist/server/assets/{workflow-CzqmkCer.js → workflow-CQcXZcbl.js} +15 -7
  181. package/app/dist/server/assets/{workflow-view-CUCXZugt.js → workflow-view-LGHJTmBs.js} +137 -49
  182. package/app/dist/server/assets/{workflows-AwuLR9Kl.js → workflows-_5EHAk5E.js} +8 -8
  183. package/app/dist/server/catalog.d.ts +83 -0
  184. package/app/dist/server/catalog.js +206 -0
  185. package/app/dist/server/catalog.js.map +1 -0
  186. package/app/dist/server/chat.d.ts +15 -5
  187. package/app/dist/server/chat.js +67 -28
  188. package/app/dist/server/chat.js.map +1 -1
  189. package/app/dist/server/core.d.ts +33 -14
  190. package/app/dist/server/core.js +66 -46
  191. package/app/dist/server/core.js.map +1 -1
  192. package/app/dist/server/go-live.js +2 -2
  193. package/app/dist/server/go-live.js.map +1 -1
  194. package/app/dist/server/sanoma-sign-in.d.ts +0 -5
  195. package/app/dist/server/sanoma-sign-in.js +9 -12
  196. package/app/dist/server/sanoma-sign-in.js.map +1 -1
  197. package/app/dist/server/server.js +60 -56
  198. package/app/dist/snapshot-build.js +17 -7
  199. package/app/dist/snapshot-build.js.map +1 -1
  200. package/app/dist/snapshot.d.ts +10 -6
  201. package/app/dist/snapshot.js +12 -8
  202. package/app/dist/snapshot.js.map +1 -1
  203. package/app/dist/steps/agent/acp.js +38 -54
  204. package/app/dist/steps/agent/acp.js.map +1 -1
  205. package/app/dist/steps/agent/box-session.d.ts +30 -10
  206. package/app/dist/steps/agent/box-session.js +63 -17
  207. package/app/dist/steps/agent/box-session.js.map +1 -1
  208. package/app/dist/steps/agent/carrier.d.ts +23 -5
  209. package/app/dist/steps/agent/carrier.js +110 -14
  210. package/app/dist/steps/agent/carrier.js.map +1 -1
  211. package/app/dist/steps/agent/checkout.d.ts +15 -23
  212. package/app/dist/steps/agent/checkout.js +28 -44
  213. package/app/dist/steps/agent/checkout.js.map +1 -1
  214. package/app/dist/steps/agent/harness.js +31 -51
  215. package/app/dist/steps/agent/harness.js.map +1 -1
  216. package/app/dist/steps/agent/loop.js +13 -3
  217. package/app/dist/steps/agent/loop.js.map +1 -1
  218. package/app/dist/steps/agent/prompt.d.ts +7 -3
  219. package/app/dist/steps/agent/prompt.js +54 -21
  220. package/app/dist/steps/agent/prompt.js.map +1 -1
  221. package/app/dist/steps/agent/tools.d.ts +1903 -53
  222. package/app/dist/steps/agent/tools.js +133 -20
  223. package/app/dist/steps/agent/tools.js.map +1 -1
  224. package/app/dist/steps/agent/transcript.d.ts +6 -3
  225. package/app/dist/steps/agent/transcript.js +14 -6
  226. package/app/dist/steps/agent/transcript.js.map +1 -1
  227. package/app/dist/steps/agent/turn.d.ts +5 -2
  228. package/app/dist/steps/agent/turn.js +8 -4
  229. package/app/dist/steps/agent/turn.js.map +1 -1
  230. package/app/dist/steps/go-live-cloud.d.ts +3 -3
  231. package/app/dist/steps/go-live-cloud.js +10 -16
  232. package/app/dist/steps/go-live-cloud.js.map +1 -1
  233. package/app/dist/steps/index.js +2 -0
  234. package/app/dist/steps/index.js.map +1 -1
  235. package/app/dist/steps/writes.d.ts +2 -1
  236. package/app/dist/steps/writes.js +12 -5
  237. package/app/dist/steps/writes.js.map +1 -1
  238. package/app/dist/stylesheet.json +1 -1
  239. package/app/src/agent-router.ts +449 -0
  240. package/app/src/api.ts +22 -23
  241. package/app/src/app-bundle.ts +22 -2
  242. package/app/src/bundle-build.ts +22 -25
  243. package/app/src/components/approval.tsx +2 -1
  244. package/app/src/components/common.tsx +68 -20
  245. package/app/src/components/data-grid.tsx +43 -10
  246. package/app/src/components/go-live-cloud.tsx +5 -4
  247. package/app/src/components/graph.tsx +95 -30
  248. package/app/src/components/grid/columns.tsx +124 -40
  249. package/app/src/components/grid/grid.tsx +62 -4
  250. package/app/src/components/grid/plan.ts +133 -61
  251. package/app/src/components/grid/review.tsx +117 -33
  252. package/app/src/components/import/sheet.ts +2 -1
  253. package/app/src/components/inspector.tsx +38 -20
  254. package/app/src/components/ledger.tsx +10 -4
  255. package/app/src/components/permissions-grid.tsx +55 -19
  256. package/app/src/components/record-form.tsx +3 -6
  257. package/app/src/components/shell/chat-parts.tsx +37 -7
  258. package/app/src/components/shell/chat.tsx +22 -9
  259. package/app/src/components/shell/connect-agent.tsx +15 -4
  260. package/app/src/components/shell/held-card.tsx +1 -1
  261. package/app/src/components/shell/nav-user.tsx +6 -1
  262. package/app/src/components/workflow-view.tsx +7 -4
  263. package/app/src/components/workflow.tsx +12 -12
  264. package/app/src/context.ts +7 -2
  265. package/app/src/demo-build.ts +58 -22
  266. package/app/src/form/schema.ts +20 -4
  267. package/app/src/form/start-form.tsx +5 -7
  268. package/app/src/form/will-ask.tsx +2 -1
  269. package/app/src/functions.ts +8 -0
  270. package/app/src/graph/layout.ts +8 -3
  271. package/app/src/graph/outline-graph.ts +38 -7
  272. package/app/src/graph/run-graph.ts +42 -9
  273. package/app/src/graph/scenario-graph.ts +6 -3
  274. package/app/src/graph/types.ts +18 -3
  275. package/app/src/handler.ts +45 -6
  276. package/app/src/index.ts +10 -2
  277. package/app/src/lib/changes.ts +2 -1
  278. package/app/src/lib/chat.ts +99 -13
  279. package/app/src/lib/company-state.ts +18 -1
  280. package/app/src/lib/grid-diff.ts +14 -9
  281. package/app/src/lib/operations.ts +97 -0
  282. package/app/src/lib/preview.ts +8 -7
  283. package/app/src/login/admission.ts +10 -3
  284. package/app/src/login/page.ts +12 -4
  285. package/app/src/login/public.ts +1 -2
  286. package/app/src/login/staff.ts +279 -57
  287. package/app/src/queries.ts +39 -51
  288. package/app/src/router.tsx +5 -2
  289. package/app/src/routes/api/call.ts +21 -5
  290. package/app/src/routes/apps/$name.tsx +2 -1
  291. package/app/src/routes/changes/$id.tsx +18 -4
  292. package/app/src/routes/connectors/$vendor.tsx +6 -4
  293. package/app/src/routes/connectors/index.tsx +56 -4
  294. package/app/src/routes/connectors/operations.$name.tsx +168 -0
  295. package/app/src/routes/data/$name/index.tsx +16 -9
  296. package/app/src/routes/data/index.tsx +10 -12
  297. package/app/src/routes/hosting/index.tsx +4 -10
  298. package/app/src/routes/inbox.tsx +1 -1
  299. package/app/src/routes/people.tsx +48 -3
  300. package/app/src/routes/permissions.tsx +13 -4
  301. package/app/src/routes/workflows/$name/index.tsx +2 -1
  302. package/app/src/routes/workflows/$name/runs/$id.tsx +2 -1
  303. package/app/src/routes/workflows/index.tsx +1 -1
  304. package/app/src/server/catalog.ts +257 -0
  305. package/app/src/server/chat.ts +81 -25
  306. package/app/src/server/columns.ts +50 -22
  307. package/app/src/server/company-state.ts +4 -5
  308. package/app/src/server/core.ts +86 -53
  309. package/app/src/server/go-live.ts +2 -2
  310. package/app/src/server/host-derived.ts +1 -0
  311. package/app/src/server/mcp.ts +28 -199
  312. package/app/src/server/sanoma-sign-in.ts +9 -14
  313. package/app/src/snapshot-build.ts +18 -6
  314. package/app/src/snapshot.ts +20 -12
  315. package/app/src/steps/agent/acp.ts +45 -55
  316. package/app/src/steps/agent/box-session.ts +84 -17
  317. package/app/src/steps/agent/carrier.ts +114 -14
  318. package/app/src/steps/agent/checkout.ts +27 -51
  319. package/app/src/steps/agent/harness.ts +31 -80
  320. package/app/src/steps/agent/loop.ts +12 -3
  321. package/app/src/steps/agent/prompt.ts +70 -21
  322. package/app/src/steps/agent/tools.ts +171 -29
  323. package/app/src/steps/agent/transcript.ts +15 -4
  324. package/app/src/steps/agent/turn.ts +14 -4
  325. package/app/src/steps/go-live-cloud.ts +9 -17
  326. package/app/src/steps/index.ts +2 -0
  327. package/app/src/steps/writes.ts +16 -11
  328. package/app/src/ui.ts +1 -0
  329. package/app/src/worker/app.ts +63 -7
  330. package/better-auth/README.md +37 -1
  331. package/better-auth/dist/db/staff.d.ts +2317 -6
  332. package/better-auth/dist/db/staff.js +3 -1
  333. package/better-auth/dist/db/staff.js.map +1 -1
  334. package/better-auth/dist/db/tables.d.ts +2338 -11
  335. package/better-auth/dist/db/tables.js +206 -12
  336. package/better-auth/dist/db/tables.js.map +1 -1
  337. package/better-auth/dist/db/visitors.d.ts +6 -6
  338. package/better-auth/dist/index.d.ts +4 -2
  339. package/better-auth/dist/index.js +3 -1
  340. package/better-auth/dist/index.js.map +1 -1
  341. package/better-auth/dist/instance.d.ts +10 -1
  342. package/better-auth/dist/instance.js +7 -3
  343. package/better-auth/dist/instance.js.map +1 -1
  344. package/better-auth/dist/oauth.d.ts +2879 -0
  345. package/better-auth/dist/oauth.js +268 -0
  346. package/better-auth/dist/oauth.js.map +1 -0
  347. package/better-auth/dist/staff.d.ts +32 -2
  348. package/better-auth/dist/staff.js +417 -11
  349. package/better-auth/dist/staff.js.map +1 -1
  350. package/better-auth/drizzle/staff/0001_row_level_security.sql +5 -0
  351. package/better-auth/drizzle/staff/0002_public_tag.sql +169 -0
  352. package/better-auth/drizzle/staff/meta/0001_snapshot.json +431 -0
  353. package/better-auth/drizzle/staff/meta/0002_snapshot.json +1609 -0
  354. package/better-auth/drizzle/staff/meta/_journal.json +14 -0
  355. package/better-auth/drizzle/visitors/0001_row_level_security.sql +5 -0
  356. package/better-auth/drizzle/visitors/meta/0001_snapshot.json +431 -0
  357. package/better-auth/drizzle/visitors/meta/_journal.json +7 -0
  358. package/dist/app-file.d.ts +41 -0
  359. package/dist/app-file.js +102 -0
  360. package/dist/app-file.js.map +1 -0
  361. package/dist/call.d.ts +21 -0
  362. package/dist/call.js +328 -0
  363. package/dist/call.js.map +1 -0
  364. package/dist/check.d.ts +8 -5
  365. package/dist/check.js +23 -15
  366. package/dist/check.js.map +1 -1
  367. package/dist/cli.js +68 -19
  368. package/dist/cli.js.map +1 -1
  369. package/dist/config.d.ts +10 -0
  370. package/dist/config.js +20 -5
  371. package/dist/config.js.map +1 -1
  372. package/dist/env.js +13 -0
  373. package/dist/env.js.map +1 -1
  374. package/dist/index.d.ts +1 -1
  375. package/dist/index.js +1 -1
  376. package/dist/index.js.map +1 -1
  377. package/dist/init.d.ts +3 -16
  378. package/dist/init.js +9 -37
  379. package/dist/init.js.map +1 -1
  380. package/dist/postgres.js +5 -20
  381. package/dist/postgres.js.map +1 -1
  382. package/dist/serve.d.ts +13 -4
  383. package/dist/serve.js +47 -12
  384. package/dist/serve.js.map +1 -1
  385. package/dist/site-lint.js +7 -11
  386. package/dist/site-lint.js.map +1 -1
  387. package/dist/source.d.ts +2 -5
  388. package/dist/source.js +4 -90
  389. package/dist/source.js.map +1 -1
  390. package/dist/template-files.d.ts +16 -0
  391. package/dist/template-files.js +36 -0
  392. package/dist/template-files.js.map +1 -0
  393. package/dist/worker-port.js +3 -5
  394. package/dist/worker-port.js.map +1 -1
  395. package/oxlint.json +30 -2
  396. package/package.json +10 -2
  397. package/template/.env.example +13 -0
  398. package/template/AGENTS.md +5 -3
  399. package/template/policies/policy.cedar +3 -1
  400. package/template/resources/sanoma/infra.ts +2 -2
  401. package/template/tsconfig.json +2 -0
  402. package/testing/README.md +12 -222
  403. package/testing/dist/host.d.ts +5 -3
  404. package/testing/dist/host.js +9 -4
  405. package/testing/dist/host.js.map +1 -1
  406. package/testing/dist/sandbox.d.ts +8 -3
  407. package/testing/dist/sandbox.js +15 -6
  408. package/testing/dist/sandbox.js.map +1 -1
  409. package/testing/dist/wakeup.d.ts +1 -0
  410. package/workflows/README.md +52 -879
  411. package/workflows/dist/app-steps.d.ts +19 -2
  412. package/workflows/dist/app-steps.js +37 -8
  413. package/workflows/dist/app-steps.js.map +1 -1
  414. package/workflows/dist/app-workflows.d.ts +21 -6
  415. package/workflows/dist/app-workflows.js +1 -0
  416. package/workflows/dist/app-workflows.js.map +1 -1
  417. package/workflows/dist/apply-steps.d.ts +10 -1
  418. package/workflows/dist/apply-steps.js +12 -7
  419. package/workflows/dist/apply-steps.js.map +1 -1
  420. package/workflows/dist/apply.d.ts +18 -6
  421. package/workflows/dist/apply.js +274 -132
  422. package/workflows/dist/apply.js.map +1 -1
  423. package/workflows/dist/apps.js +3 -9
  424. package/workflows/dist/apps.js.map +1 -1
  425. package/workflows/dist/call-workflow.d.ts +2 -2
  426. package/workflows/dist/call-workflow.js +5 -3
  427. package/workflows/dist/call-workflow.js.map +1 -1
  428. package/workflows/dist/call.d.ts +11 -11
  429. package/workflows/dist/call.js +155 -63
  430. package/workflows/dist/call.js.map +1 -1
  431. package/workflows/dist/cedar.d.ts +8 -7
  432. package/workflows/dist/cedar.js +41 -19
  433. package/workflows/dist/cedar.js.map +1 -1
  434. package/workflows/dist/change-steps.d.ts +14 -12
  435. package/workflows/dist/change-steps.js +77 -39
  436. package/workflows/dist/change-steps.js.map +1 -1
  437. package/workflows/dist/change-workflow.d.ts +28 -3
  438. package/workflows/dist/change-workflow.js +30 -3
  439. package/workflows/dist/change-workflow.js.map +1 -1
  440. package/workflows/dist/change.d.ts +24 -9
  441. package/workflows/dist/change.js +9 -7
  442. package/workflows/dist/change.js.map +1 -1
  443. package/workflows/dist/chat-workflow.js +1 -0
  444. package/workflows/dist/chat-workflow.js.map +1 -1
  445. package/workflows/dist/client.d.ts +111 -28
  446. package/workflows/dist/client.js +280 -141
  447. package/workflows/dist/client.js.map +1 -1
  448. package/workflows/dist/cloud-run.d.ts +22 -0
  449. package/workflows/dist/cloud-run.js +86 -0
  450. package/workflows/dist/cloud-run.js.map +1 -0
  451. package/workflows/dist/collection-driver.d.ts +10 -4
  452. package/workflows/dist/collection-driver.js +101 -38
  453. package/workflows/dist/collection-driver.js.map +1 -1
  454. package/workflows/dist/collection.d.ts +59 -10
  455. package/workflows/dist/collection.js +137 -25
  456. package/workflows/dist/collection.js.map +1 -1
  457. package/workflows/dist/company-file.d.ts +18 -6
  458. package/workflows/dist/company-file.js +50 -24
  459. package/workflows/dist/company-file.js.map +1 -1
  460. package/workflows/dist/config.d.ts +92 -8
  461. package/workflows/dist/config.js +159 -29
  462. package/workflows/dist/config.js.map +1 -1
  463. package/workflows/dist/connect-workflow.js +1 -0
  464. package/workflows/dist/connect-workflow.js.map +1 -1
  465. package/workflows/dist/constructors.d.ts +1 -0
  466. package/workflows/dist/ctx.d.ts +11 -7
  467. package/workflows/dist/ctx.js +11 -9
  468. package/workflows/dist/ctx.js.map +1 -1
  469. package/workflows/dist/db/company.d.ts +38 -38
  470. package/workflows/dist/db/company.js +24 -19
  471. package/workflows/dist/db/company.js.map +1 -1
  472. package/workflows/dist/db/wakeup.d.ts +4 -4
  473. package/workflows/dist/db/wakeup.js +4 -3
  474. package/workflows/dist/db/wakeup.js.map +1 -1
  475. package/workflows/dist/define.d.ts +45 -6
  476. package/workflows/dist/define.js +48 -3
  477. package/workflows/dist/define.js.map +1 -1
  478. package/workflows/dist/deployment-key.d.ts +6 -0
  479. package/workflows/dist/deployment-key.js +7 -1
  480. package/workflows/dist/deployment-key.js.map +1 -1
  481. package/workflows/dist/describe.d.ts +12 -2
  482. package/workflows/dist/describe.js +102 -40
  483. package/workflows/dist/describe.js.map +1 -1
  484. package/workflows/dist/description.d.ts +100 -16
  485. package/workflows/dist/description.js +79 -20
  486. package/workflows/dist/description.js.map +1 -1
  487. package/workflows/dist/direct.d.ts +23 -5
  488. package/workflows/dist/direct.js +35 -7
  489. package/workflows/dist/direct.js.map +1 -1
  490. package/workflows/dist/follow-workflow.js +1 -0
  491. package/workflows/dist/follow-workflow.js.map +1 -1
  492. package/workflows/dist/grid.d.ts +9 -3
  493. package/workflows/dist/grid.js +20 -6
  494. package/workflows/dist/grid.js.map +1 -1
  495. package/workflows/dist/host-derive.d.ts +16 -1
  496. package/workflows/dist/host-derive.js +52 -3
  497. package/workflows/dist/host-derive.js.map +1 -1
  498. package/workflows/dist/host.d.ts +35 -4
  499. package/workflows/dist/host.js +28 -0
  500. package/workflows/dist/host.js.map +1 -1
  501. package/workflows/dist/import-workflow.js +7 -4
  502. package/workflows/dist/import-workflow.js.map +1 -1
  503. package/workflows/dist/import.d.ts +6 -3
  504. package/workflows/dist/import.js +11 -2
  505. package/workflows/dist/import.js.map +1 -1
  506. package/workflows/dist/index.d.ts +8 -7
  507. package/workflows/dist/index.js +8 -7
  508. package/workflows/dist/index.js.map +1 -1
  509. package/workflows/dist/ledger.d.ts +10 -0
  510. package/workflows/dist/ledger.js.map +1 -1
  511. package/workflows/dist/lint.d.ts +9 -5
  512. package/workflows/dist/lint.js +28 -16
  513. package/workflows/dist/lint.js.map +1 -1
  514. package/workflows/dist/local-sandbox.d.ts +3 -2
  515. package/workflows/dist/local-sandbox.js +3 -2
  516. package/workflows/dist/local-sandbox.js.map +1 -1
  517. package/workflows/dist/login-code.js +1 -0
  518. package/workflows/dist/login-code.js.map +1 -1
  519. package/workflows/dist/op.d.ts +293 -4
  520. package/workflows/dist/op.js +332 -0
  521. package/workflows/dist/op.js.map +1 -1
  522. package/workflows/dist/outline.d.ts +19 -5
  523. package/workflows/dist/outline.js +41 -19
  524. package/workflows/dist/outline.js.map +1 -1
  525. package/workflows/dist/page-run.d.ts +10 -3
  526. package/workflows/dist/page-run.js +49 -29
  527. package/workflows/dist/page-run.js.map +1 -1
  528. package/workflows/dist/paths.d.ts +10 -3
  529. package/workflows/dist/paths.js +30 -11
  530. package/workflows/dist/paths.js.map +1 -1
  531. package/workflows/dist/person.d.ts +5 -1
  532. package/workflows/dist/person.js +13 -2
  533. package/workflows/dist/person.js.map +1 -1
  534. package/workflows/dist/policy.d.ts +5 -1
  535. package/workflows/dist/policy.js.map +1 -1
  536. package/workflows/dist/resource.js +5 -2
  537. package/workflows/dist/resource.js.map +1 -1
  538. package/workflows/dist/resources.d.ts +55 -6
  539. package/workflows/dist/resources.js +191 -22
  540. package/workflows/dist/resources.js.map +1 -1
  541. package/workflows/dist/run.d.ts +3 -1
  542. package/workflows/dist/run.js.map +1 -1
  543. package/workflows/dist/runner-box.d.ts +13 -10
  544. package/workflows/dist/runner-box.js +41 -24
  545. package/workflows/dist/runner-box.js.map +1 -1
  546. package/workflows/dist/sandbox-contract.d.ts +18 -8
  547. package/workflows/dist/sandbox-contract.js +10 -3
  548. package/workflows/dist/sandbox-contract.js.map +1 -1
  549. package/workflows/dist/sandbox-runner.cjs +4 -4
  550. package/workflows/dist/sandbox.js +6 -2
  551. package/workflows/dist/sandbox.js.map +1 -1
  552. package/workflows/dist/scenario.js +23 -2
  553. package/workflows/dist/scenario.js.map +1 -1
  554. package/workflows/dist/scenarios.js +6 -5
  555. package/workflows/dist/scenarios.js.map +1 -1
  556. package/workflows/dist/sdk.d.ts +2 -1
  557. package/workflows/dist/sdk.js +12 -3
  558. package/workflows/dist/sdk.js.map +1 -1
  559. package/workflows/dist/shared.d.ts +305 -42
  560. package/workflows/dist/shared.js +405 -77
  561. package/workflows/dist/shared.js.map +1 -1
  562. package/workflows/dist/sites.d.ts +5 -4
  563. package/workflows/dist/sites.js +124 -45
  564. package/workflows/dist/sites.js.map +1 -1
  565. package/workflows/dist/source.d.ts +0 -6
  566. package/workflows/dist/source.js.map +1 -1
  567. package/workflows/dist/steps.d.ts +9 -0
  568. package/workflows/dist/steps.js.map +1 -1
  569. package/workflows/dist/version.d.ts +9 -6
  570. package/workflows/dist/version.js +11 -7
  571. package/workflows/dist/version.js.map +1 -1
  572. package/workflows/dist/wakeup-service.d.ts +2 -9
  573. package/workflows/dist/wakeup-service.js +2 -14
  574. package/workflows/dist/wakeup-service.js.map +1 -1
  575. package/workflows/dist/worker.d.ts +8 -1
  576. package/workflows/dist/worker.js +64 -20
  577. package/workflows/dist/worker.js.map +1 -1
  578. package/workflows/drizzle/company/0008_row_level_security.sql +19 -0
  579. package/workflows/drizzle/company/meta/0008_snapshot.json +1281 -0
  580. package/workflows/drizzle/company/meta/_journal.json +7 -0
  581. package/workflows/drizzle/wakeup/0001_row_level_security.sql +2 -0
  582. package/workflows/drizzle/wakeup/meta/0001_snapshot.json +200 -0
  583. package/workflows/drizzle/wakeup/meta/_journal.json +7 -0
  584. package/workflows/oxlint.json +2 -2
  585. package/workflows/src/app-steps.ts +47 -12
  586. package/workflows/src/app-workflows.ts +12 -3
  587. package/workflows/src/apply-steps.ts +24 -12
  588. package/workflows/src/apply.ts +308 -160
  589. package/workflows/src/apps.ts +3 -10
  590. package/workflows/src/call-workflow.ts +5 -4
  591. package/workflows/src/call.ts +200 -68
  592. package/workflows/src/cedar.ts +52 -21
  593. package/workflows/src/change-steps.ts +96 -48
  594. package/workflows/src/change-workflow.ts +52 -5
  595. package/workflows/src/change.ts +11 -6
  596. package/workflows/src/chat-workflow.ts +1 -0
  597. package/workflows/src/client.ts +370 -186
  598. package/workflows/src/cloud-run.ts +106 -0
  599. package/workflows/src/collection-driver.ts +114 -43
  600. package/workflows/src/collection.ts +187 -34
  601. package/workflows/src/company-file.ts +52 -23
  602. package/workflows/src/config.ts +271 -32
  603. package/workflows/src/connect-workflow.ts +1 -0
  604. package/workflows/src/ctx.ts +27 -17
  605. package/workflows/src/db/company.ts +24 -19
  606. package/workflows/src/db/wakeup.ts +4 -3
  607. package/workflows/src/define.ts +99 -7
  608. package/workflows/src/deployment-key.ts +9 -1
  609. package/workflows/src/describe.ts +119 -35
  610. package/workflows/src/description.ts +81 -20
  611. package/workflows/src/direct.ts +39 -7
  612. package/workflows/src/follow-workflow.ts +1 -0
  613. package/workflows/src/grid.ts +27 -7
  614. package/workflows/src/host-derive.ts +65 -3
  615. package/workflows/src/host.ts +57 -4
  616. package/workflows/src/import-workflow.ts +16 -4
  617. package/workflows/src/import.ts +12 -4
  618. package/workflows/src/index.ts +54 -2
  619. package/workflows/src/ledger.ts +10 -0
  620. package/workflows/src/lint.ts +37 -22
  621. package/workflows/src/local-sandbox.ts +3 -2
  622. package/workflows/src/login-code.ts +1 -0
  623. package/workflows/src/op.ts +461 -4
  624. package/workflows/src/outline.ts +58 -24
  625. package/workflows/src/page-run.ts +84 -37
  626. package/workflows/src/paths.ts +32 -12
  627. package/workflows/src/person.ts +13 -2
  628. package/workflows/src/policy.ts +5 -1
  629. package/workflows/src/resource.ts +7 -2
  630. package/workflows/src/resources.ts +222 -21
  631. package/workflows/src/run.ts +3 -1
  632. package/workflows/src/runner-box.ts +74 -55
  633. package/workflows/src/sandbox-contract.ts +23 -10
  634. package/workflows/src/sandbox-runner.ts +1 -1
  635. package/workflows/src/sandbox.ts +8 -4
  636. package/workflows/src/scenario.ts +22 -1
  637. package/workflows/src/scenarios.ts +7 -5
  638. package/workflows/src/sdk.ts +15 -5
  639. package/workflows/src/shared.ts +510 -81
  640. package/workflows/src/sites.ts +143 -48
  641. package/workflows/src/source.ts +0 -6
  642. package/workflows/src/steps.ts +6 -1
  643. package/workflows/src/version.ts +15 -9
  644. package/workflows/src/wakeup-service.ts +3 -13
  645. package/workflows/src/worker.ts +76 -36
  646. package/app/dist/client/assets/ArrowDown.es-CmCelew7.js +0 -1
  647. package/app/dist/client/assets/DialogTitle-5oboyLiq.js +0 -1
  648. package/app/dist/client/assets/_id-Dk4x2N-W.js +0 -1
  649. package/app/dist/client/assets/_id-XHvGLPkN.js +0 -1
  650. package/app/dist/client/assets/_name-DKYZ1YgQ.js +0 -1
  651. package/app/dist/client/assets/_name-Dsy5uNfc.js +0 -4
  652. package/app/dist/client/assets/_vendor-CtXzCWko.js +0 -1
  653. package/app/dist/client/assets/app-chrome-BLIfokh_.js +0 -5
  654. package/app/dist/client/assets/approval-DoWiFprg.js +0 -1
  655. package/app/dist/client/assets/changes-BU0TNuVs.js +0 -1
  656. package/app/dist/client/assets/chat-W570LGFb.js +0 -14
  657. package/app/dist/client/assets/common-BNfPX6nt.js +0 -3
  658. package/app/dist/client/assets/connections-B8222Op7.js +0 -5
  659. package/app/dist/client/assets/connectors-BE70xFaC.js +0 -1
  660. package/app/dist/client/assets/credentials-CY2BCDKD.js +0 -1
  661. package/app/dist/client/assets/data-l9hYG2QZ.js +0 -1
  662. package/app/dist/client/assets/decidable-BN9ROOeu.js +0 -1
  663. package/app/dist/client/assets/grid-diff-ClRtSBw1.js +0 -1
  664. package/app/dist/client/assets/held-card-Ith_e2pU.js +0 -1
  665. package/app/dist/client/assets/hosting-CoXqPSGw.js +0 -1
  666. package/app/dist/client/assets/import-DwI_C7L0.js +0 -1
  667. package/app/dist/client/assets/inbox-BVmVojZD.js +0 -1
  668. package/app/dist/client/assets/inbox-CHDaX9y5.js +0 -1
  669. package/app/dist/client/assets/index-Cp944Jof.js +0 -10
  670. package/app/dist/client/assets/kit-DxZIYy5q.js +0 -1
  671. package/app/dist/client/assets/mermaid-WFAXDIZX-C18E3sbR.js +0 -1
  672. package/app/dist/client/assets/people-aMFiCP4h.js +0 -1
  673. package/app/dist/client/assets/permissions-BYNciznY.js +0 -2
  674. package/app/dist/client/assets/permissions-grid-B_lA_2ty.js +0 -1
  675. package/app/dist/client/assets/review-CNimdqC2.js +0 -1
  676. package/app/dist/client/assets/schema-BpqanhX0.js +0 -1
  677. package/app/dist/client/assets/start-form-DlZ3zoCU.js +0 -1
  678. package/app/dist/client/assets/store-BT988jIX.js +0 -1
  679. package/app/dist/client/assets/style-DaqPHcI1.css +0 -2
  680. package/app/dist/client/assets/useOpenInteractionType-UhakpAXY.js +0 -1
  681. package/app/dist/client/assets/workflow-Bt1NbErS.js +0 -1
  682. package/app/dist/client/assets/workflow-view-CBRoDqLQ.js +0 -1
package/README.md CHANGED
@@ -4,287 +4,96 @@ One command over a company repo: `sanoma` runs its workflows and the app, `sanom
4
4
 
5
5
  ## Start a company
6
6
 
7
- ```sh
8
- mkdir maple-street && cd maple-street
9
- npx sanoma init --name "Maple Street Studio" --you "Dana Reyes" --email dana@maplestreet.studio
10
- ```
11
-
12
- In an empty directory (dotfiles aside), `sanoma init` starts a company there, then runs it, as `sanoma` does there without its options: it copies the template this package ships (`template/`: `sanoma.config.ts` with the Anthropic connector, the model the app's chat answers on, Resend, which sends sign-in codes (`login.sender`), GitHub, Sanoma Cloud, and the connectors of the chat's coding agents (OpenAI for Codex, OpenCode, Pi; Claude Code and Copilot come with Anthropic's and GitHub's), `secrets.ts` (the bootstrap keys' bindings, and `SANOMA_CLOUD_TOKEN` read from the environment only where it is set, as a host gives it), a `record-lead` workflow with its scenario, `resources/data.ts` (the Outbound board it records to), `resources/sanoma/infra.ts` (the database and host on Sanoma Cloud the company goes live on, named by its slug: `--name` without its accents, made lower case, each run of other characters a dash, else the directory's name the same way when that leaves nothing (a name in another script), at `<slug>.sanoma.work`; nothing is made until it goes live, and until then a merge deploys nothing), `policies/policy.cedar` (sending or publishing waits for `admin`) and `policies/changes.cedar` (every change waits for `admin`), `resources/people.ts` with you as its one person, in `admin` (named `--you`, else git's `user.name`, with `--email`, else git's `user.email`, as the email a host's sign-in sends codes to; your id is your GitHub login as `gh` is signed in, else this machine's user name), an empty `resources/` tree, `AGENTS.md`, `.env.example`), names the package after the directory, writes `--name` as the config's `name` (the company's name as the app shows it; without it, the package's name stands), writes `.env` with independent new `SANOMA_SIGNING_KEY` and `SANOMA_SECRETS_KEY` values (keeping what a `.env` there already sets; no database URL, so the company runs on [its own Postgres](#postgres)), commits what it wrote (never a dotfile that was already there) as the first commit of a git repository on `main`, "Start a Sanoma company", as your git user, then installs with the package manager that ran it (`npm_config_user_agent`; pnpm when it names none), with `sanoma` at its own exact version and each connector the template names at the exact version released with it, and adds the lockfile to that commit. The `sanoma` it installed then serves the company; the chat asks for the Anthropic key, pasted on its connector page, before its first turn. Without git or a git user it stops before writing anything; a failed install leaves the commit, to install and run `sanoma` again in. A directory holding anything else and no `sanoma.config.ts` is refused, as for every command (`sanoma init` exits 2 there). An `--email` that is no address is refused (exit 2) before anything is written. [Sanoma-AI/company-template](https://github.com/Sanoma-AI/company-template), which Sanoma Cloud's sign-up makes a company from, is this template as each release pushes it there (`release.yml`), at that release's versions with a lockfile.
7
+ Moved to the docs: [Start a company](https://docs.sanoma.work/start/start-a-company/).
13
8
 
14
9
  ## Install
15
10
 
16
- ```sh
17
- npm install sanoma @sanoma-ai/connector-ghost
18
- ```
19
-
20
- `sanoma` brings `sanoma/workflows`, `sanoma/app`, `zod`, `typescript`, `@types/node` and `oxlint` with it: a repo installs nothing else but its connectors. Node's types reach the repo's `tsc` through `sanoma` itself (its declarations reference them, resolved from where it is installed), under pnpm, npm or a link alike, so a repo lists no `@types/node`. A repo that lists its own of another major gets two sets of Node's declarations, which conflict: keep one, by matching sanoma's or letting the installer dedupe them. A tsconfig project that imports nothing from `sanoma` (a scripts directory with a tsconfig of its own, say) gets none this way: it sets `"types": ["node"]` and lists `@types/node` itself. Node 26 or later. Nothing else: the [Postgres](#postgres) it starts comes with it, as `@sanoma-ai/postgres-<platform>`, an optional dependency.
21
-
22
- A repo holds `sanoma.config.ts` at its root, with `workflows/`, optional `policies/` (Cedar files), `resources/` (data files, the people among them) and `scenarios/` (feature files) beside it, optional `apps/` (see [Apps](#apps)), and a `tsconfig.json` that extends the one this package ships:
23
-
24
- ```json
25
- {
26
- "extends": "sanoma/tsconfig.json",
27
- "include": ["sanoma.config.ts", "workflows", "resources", "apps/*/app.ts", "apps/*/workflows", "apps/*/resources"]
28
- }
29
- ```
30
-
31
- ```ts
32
- // sanoma.config.ts
33
- import { ghost } from "@sanoma-ai/connector-ghost";
34
- import { defineConfig } from "sanoma";
35
-
36
- export default defineConfig({ connectors: [ghost] });
37
- ```
38
-
39
- Each connector carries its driver and its fake, so the config names neither, and every command that loads the config finds the workflows: each `.ts` file under `workflows/` and each app's `apps/<app>/workflows/` (but `*.test.ts`, `*.spec.ts` and `*.d.ts`) is imported, and its default export, which must be a workflow (`defineWorkflow`), is added to the config's `workflows`; a file without one is a helper the workflows import. A config may still list workflows (`workflows: [publish]`): one it lists is kept, once. The rest is the repo's layout: the company's name as people read it is the config's `name` (`name: "Maple Street Studio"`), else the app's name, `package.json`'s `name`, which scopes its runs, the scenarios are `scenarios/`, the data files `resources/` and the policies `policies/**/*.cedar`, beside `sanoma.config.ts` (see [People and policies](#people-and-policies)). The ledger is Postgres's, on the config's database; `ledger: jsonlLedger(dir)` keeps it in files instead.
40
-
41
- ```ts
42
- // workflows/publish.ts
43
- import { ghost } from "@sanoma-ai/connector-ghost";
44
- import { defineWorkflow, z } from "sanoma";
45
-
46
- export default defineWorkflow({
47
- name: "publish",
48
- trigger: "manual",
49
- input: z.object({ id: z.string() }),
50
- uses: [ghost.post.publish],
51
- run: (ctx, { id }) => ctx.ghost.post.publish({ id }),
52
- });
53
- ```
54
-
55
- A workflow imports from `sanoma` what the lint lets it (`defineWorkflow`, `mayDecide`, `errorCode`, `z`, `sanoma`, the runtime's own operations, and types); `zod` itself and `sanoma/workflows` are accepted too. The config file imports `defineConfig` (and a ledger store, `jsonlLedger`, `memoryLedger` or `postgresLedger`, when it names one) from `sanoma`, and its connectors from their packages. A site, `sites/<name>/` (pages the app serves under `/sites/<name>/`; `defineSite({ public: true, login })` in its `site.ts` marks one for visitors, served at the root of its own host too, and `locales` its languages), imports `defineSite`, the app's route APIs (`Link`, `Outlet`, `useNavigate`, …) and `api`, which calls the company's operations and workflows as the person on the page ([calling operations and workflows](https://github.com/Sanoma-AI/sanoma/blob/main/packages/sanoma/app/README.md#calling-operations-and-workflows)), from `sanoma/site` with the rest of what talks to the app (`RunForm`, a workflow's start form, and `useActor`, who is signed in), how its pages look (the app's components, presentational only) from `sanoma/ui`, Sanoma's claims about connectors, apps and solutions (`claims`, `appTier`, …) from `sanoma/claims`, and `createFileRoute` from `@tanstack/react-router`; the [app's README](https://github.com/Sanoma-AI/sanoma/blob/main/packages/sanoma/app/README.md#a-sites-imports) has the whole list. A data file under `resources/` imports `secret` and `sanoma` (the people types) from `sanoma/resources`, and `resources/data.ts`, the company's [collections](workflows/README.md#collections), imports `collection` from `sanoma/data` and nothing else:
56
-
57
- ```ts
58
- // resources/data.ts
59
- import { collection } from "sanoma/data";
60
-
61
- export const outbound = collection({
62
- name: "outbound",
63
- key: "company",
64
- fields: { company: "text", stage: { enum: ["researched", "contacted", "won", "lost"] }, owner: "person" },
65
- });
66
- ```
67
-
68
- Every command that loads the config imports `resources/data.ts` too, and each app's, when there is one, and adds its collections to the config's `collections` (each of its exports must be one), so `sanoma.config.ts` does not list them. A workflow that calls `ctx.data.outbound.get` imports `outbound` from `../resources/data.ts` to name it in `uses`: the one file outside `workflows/` the lint lets it import.
11
+ Moved to the docs: [Install in a repository](https://docs.sanoma.work/start/install/).
69
12
 
70
13
  ## Apps
71
14
 
72
- An app is a folder of `apps/`, holding what the root does (`workflows/`, `resources/`, `policies/`, `scenarios/`, `sites/`) and an `app.ts` naming the repository it was merged from:
73
-
74
- ```ts
75
- // apps/crm/app.ts
76
- import { defineApp } from "sanoma";
77
-
78
- export default defineApp({ source: "https://github.com/acme/crm" });
79
- ```
80
-
81
- What an app declares is named with its folder, so two apps may both declare `customers`: `apps/crm/resources/data.ts`'s is `crm.customers` (`ctx.data.crm.customers.get(…)`, `api.data.crm.customers.list()`, the Cedar action `data.crm.customers.save`), `apps/crm/workflows/follow-up.ts`'s `follow-up` is `crm.follow-up` (`api.crmFollowUp`, `When crm.follow-up runs`), and `apps/crm/sites/pipeline/` is served at `/sites/crm/pipeline`. An app is taken and updated by the chat's agent as a git merge into its draft (`take_app`, `update_app`; see [the app's screens](app/README.md#screens)); an update reads the source `main`'s `app.ts` names, so an app taken in a draft is updated once that take is published. The company's own workflows, at the root, may import any app's `resources/data.ts` to join them; `sanoma check` warns of an import from one app's files into another's. See [Apps](workflows/README.md#apps).
15
+ Moved to the docs: [Apps](https://docs.sanoma.work/start/apps/).
82
16
 
83
17
  ## People and policies
84
18
 
85
- `resources/people.ts` declares who uses the company's app, the agents that act in it and the groups ([people](https://github.com/Sanoma-AI/sanoma/blob/main/packages/sanoma/workflows/README.md#people)), and `policies/*.cedar` who may do what ([policies](https://github.com/Sanoma-AI/sanoma/blob/main/packages/sanoma/workflows/README.md#policies)):
86
-
87
- ```ts
88
- // resources/people.ts
89
- import { sanoma } from "sanoma/resources";
90
-
91
- export const ada = sanoma.person({ id: "ada", name: "Ada Ortiz", email: "ada@acme.test", github: "ada-ortiz" });
92
- export const bo = sanoma.person({ id: "bo" });
93
- export const editor = sanoma.group({ name: "editor", members: [ada] });
94
- ```
95
-
96
- ```cedar
97
- // policies/policy.cedar
98
- @hold("editor")
99
- @title("Review before it goes out")
100
- forbid (principal, action in [Sanoma::Action::"effect:publish", Sanoma::Action::"effect:send"], resource)
101
- unless { principal in Sanoma::Group::"editor" || principal == Sanoma::Principal::"login" };
102
- ```
103
-
104
- The `login` in its `unless` is the runtime's agent that sends sign-in codes (the built-in `login-code` workflow, when the config names `login: { sender, from }`): a policy that held its send would keep everyone from signing in by code, and `sanoma check` says so.
105
-
106
- Only a declared person signs in to the app (on this machine by picking their name; on a host by an email code to their `email`, an invite link, or GitHub by their verified email, then their `github` login), starts a run, calls an operation or decides an approval, and nobody decides an approval on a run they started while someone else in the group could (a founder alone in a group decides their own, and the ledger says so). Everything is allowed unless a `forbid` refuses it: one with `@hold` waits for that group's or person's approval, one without is denied with its `@reason`. A visitor of a public site, in the group `visitors` (or `anonymous`, when nobody is signed in), is the exception: it may start a run or call an operation directly only where a `permit` names it, the one `permit` a policy file may hold (`permit (principal in Sanoma::Group::"visitors", action == Sanoma::Action::"workflow:signup", resource);`), and inside a run it started its calls are allowed as anyone's, the forbids still holding. Write them against `.sanoma/schema.cedarschema`, which `sanoma check` and `sanoma` write from the config: each operation's id as an action in its effect's group, `workflow:<name>` for a run's start, the groups the people file declares, and each operation's input as `context.input`. `sanoma check` reports a policy problem at its place and runs no scenario until there are none; `sanoma` refuses to start on one. A scenario runs as the agent `scenarios` unless it says who is acting (`Given bo is acting`, `Given a visitor is acting`, `Given a visitor "hopper@example.com" with GitHub "hopper" is acting`, `Given anonymous is acting`), and checks the policy with `Then ghost.post.publish was held for group "editor"` and `Then <op> was denied with "<reason>"`. The app's Permissions page shows what the policies answer for each group.
19
+ Moved to the docs: [People and policies](https://docs.sanoma.work/policies/people-and-policies/).
107
20
 
108
21
  ## Commands
109
22
 
110
- Run them from the directory that holds `sanoma.config.ts`. Each loads `.env` there first, when there is one (a variable already set wins), then the config.
23
+ Moved to the docs: [Commands](https://docs.sanoma.work/reference/commands/).
111
24
 
112
- | Command | What it does |
113
- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
114
- | `sanoma` | Makes missing local signing and storage-encryption keys (only signing for an external store), respecting environment and mounted-file inputs and appending generated values to ignored `.env`; makes sure Postgres answers, starting the company's own when no URL is named (see [Postgres](#postgres)), then starts the worker (promoted, so a local worker takes every queued run) and the app in one process, and prints `<name> running <workflows>` and `<name> at http://127.0.0.1:3000; ctrl-c to stop` (the company's [`name`](workflows/README.md#usage)); the worker says `sanoma: 2 of 5 connectors not configured yet: ghost, resend; …` first when some vendors' variables are missing or invalid (a call to one fails, naming them, until they are set; nothing when all are set). When the repo has [sites](#sites), it serves the app and the sites from a dev server that shows each edit as it is saved (see [Developing a site](#developing-a-site)). In [dev mode](#dev-mode) it runs them in a child it restarts. In an empty directory it first [starts a company](#start-a-company). The worker and the app are given the repo's git checkout as their `source`, which commits to the current branch, and opens drafts: a git worktree each, at `.sanoma/drafts/<id>` on the branch `draft/<id>` from the checked-out commit, with the repo's `node_modules` linked in (a link, which `node_modules/` in `.gitignore` does not match, so `.git/info/exclude` names it), where a writer that must not touch the live checkout commits instead, and whose `sanoma check` the app runs as a child holding only `PATH`, `HOME` and the database URL. A draft is open while `git worktree list` lists it; merging its branch is by hand. |
115
- | `sanoma init [--name] [--you] [--email]` | In an empty directory, [starts a company](#start-a-company) named and declared as the options say, then runs it as `sanoma` does. |
116
- | `sanoma worker`, `sanoma app` | One of the two alone, for a deployment that runs them apart (`app` builds the app with the [sites](#sites); `worker`, with `PORT` set, answers on [its port](#the-workers-port)). Neither starts or probes Postgres: a URL named is the runtime's to reach; with none they use the company's own only while another `sanoma` runs it, and exit 2 otherwise. The worker makes the database's tables (the runtime's and the sign-ins'), the app only checks for them: start the worker first, or with the app, which waits up to a minute for them. |
117
- | `sanoma wakeup` | The [wakeup service](#the-wakeup-service) alone, on the config's database (found as `worker` and `app` find it, never started), at `SANOMA_APP_HOST` and `SANOMA_APP_PORT` (default 3100), with `/healthz`. |
118
- | `sanoma check` | Writes [`.sanoma/api.ts`](#sites) and `.sanoma/schema.cedarschema` first, each when it changed; then `tsc -p tsconfig.json`; oxlint over `workflows/`, `resources/`, `sites/` and `apps/` (those that exist) with the repo's `.oxlintrc.json`, written when missing (see [the lint](#the-lint)); every problem `describeConfig` finds (an import a workflow may not make, what its graph cannot draw, what the worker would refuse; a data file that does not load, or a resource it makes but does not export; a site's call to a workflow, collection or operation the config does not have, or a public site's start or direct call no `permit` lets a visitor make; a domain a host gives a site that is not public, or gives two sites); every problem in the [policies](#people-and-policies), at its `file:line:col` with the policy's id; with [sites](#sites), the app built with them, `tsc -p sites/tsconfig.json` and what is wrong under `content/`; then, unless the policies have a problem, every scenario against the fakes, on a database of its own (`<database>_check`, on the company's own Postgres when no URL is named, stopped after when `check` started it), each step that did not hold a problem. Prints each problem on a line, `file:line:col: message` or `scenario › step: message`, and exits 1 when there is one; before them each warning, `file:line:col: warning: message` (a public site's page the sitemap cannot list the entries of, an import from one app into another), which never fails it. No vitest. |
119
- | `sanoma demo --out <dir>` | The [sites](#sites) as static files that run in any page, their workflows in the browser on the connectors' fakes, seeded from `scenarios/world.feature` (see [Demos](#demos)): `mount.js`, its `chunks/`, `demo.css`, the files it names under `files/`, and `index.html`, into `<dir>`, emptied first. |
120
- | `sanoma env [--check]` | Writes `.env.example`: the variables `sanoma` reads, then every variable the connectors' drivers declare, by vendor, with its description; optional ones commented out. `--check` writes nothing and exits 1 with "`.env.example` is out of date: run `sanoma env`" when the file differs, for CI. |
121
- | `sanoma ledger export <runId> [--out <file>]` | A run's ledger records from the config's store (the Postgres ledger on its database when it names none, the company's own started for the read when no URL is named), as JSON lines (the shape `jsonlLedger` keeps), to stdout or `--out`. |
122
- | `sanoma --help` | The usage. |
25
+ ### From a terminal or an agent
123
26
 
124
- Exit codes: 2 for a mistake in the call or the repo (no `sanoma.config.ts`, an unknown command or option, a bad argument), printed with the usage where it helps; 1 for failed checks and failures while running; 0 otherwise. `SANOMA_APP_PORT` is the app's port (default 3000; 0 for any free port, which the printed address reports). `SANOMA_APP_HOST` is its address (default 127.0.0.1); `SANOMA_DOMAINS` gives a [public site](app/README.md#public-sites) its domain, `<site>=<hostname>[,<site>=<hostname>…]` (`www=sanoma.example`, which a host resource's `domains` sets), and a malformed one exits 2; any other address signs people in with the [staff sign-in](app/README.md#staff-sign-in-on-a-host) (an email code through the config's `login.sender`, invite links, and GitHub once `SANOMA_GITHUB_CLIENT_ID` and `SANOMA_GITHUB_CLIENT_SECRET` are both set, in the environment or stored by the app's Connect page (under Hosting) when it created the GitHub App; the public sites' logins then offer visitors GitHub too, for which the App's callback URLs need `https://<site host>/auth/better-auth/callback/github`), which needs `SANOMA_SIGNING_KEY`; a missing key, or one of the GitHub pair without the other, exits 2 before anything starts, as does a problem in the policies. On SIGINT or SIGTERM the app, then the worker, then the Postgres it started, stop, and the process exits 0.
27
+ Moved to the docs: [Commands](https://docs.sanoma.work/reference/commands/#from-a-terminal-or-an-agent).
125
28
 
126
29
  ### For a parent process
127
30
 
128
- A parent process, such as a desktop shell, runs `sanoma` with `SANOMA_EVENTS=1` and reads its stdout line by line: beside the lines a person reads, each event is one JSON object on a line of its own, `{"sanoma":1,"event":…}`; logs stay on stderr.
129
-
130
- - `{"sanoma":1,"event":"ready","url":"http://127.0.0.1:3000","sites":{"www":"http://www.localhost:3000"}}`: the app listens, right after the `at <url>; ctrl-c to stop` line, each time it starts (in [dev mode](#dev-mode), after each restart); `url` is where the app listens, on the port `SANOMA_APP_PORT` names (the free one it took, for 0), and `sites` is `{}` without public sites. `sanoma worker` has no address and prints none.
131
- - `{"sanoma":1,"event":"error","message":"…"}`: the launcher cannot start or stop, with the message it printed on stderr, then exits 2 for a mistake in the call or the config, 1 for a failure. In dev mode a child that fails prints it too, and the launcher waits for the next build to start it again.
132
- - `{"sanoma":1,"event":"checked","ok":false,"problems":["…"],"warnings":[]}`: `sanoma check`'s result, the lines it printed as two lists, before it exits; a check that cannot read the config ends with `error` instead. Read it rather than the printed lines: DBOS logs on stdout too.
133
- - `{"sanoma":1,"event":"stage","stage":"template","status":"start"}`, then `"status":"done"`: a stage of starting a company (`sanoma init`, or `sanoma` in an empty directory), in this order: `template` (the files copied, named and keyed), `people` (you declared), `git` (the repository and its first commit), `install` (the package manager's install), then `database` (the company's own Postgres answering, from the `sanoma` the install brought, which then starts the worker and the app). A stage that fails has no `done`; an `error` follows. `database` comes on every run, not only the first, around the `database` event; none when a URL is named.
134
- - `{"sanoma":1,"event":"database","how":"started","url":"postgresql://postgres:…@127.0.0.1:54012/sanoma","place":"this-computer"}`: the company's own [Postgres](#postgres) answers, once, before the worker starts (in dev mode, from the parent, not each child): `how` is `created` (made first), `started`, or `answered` (another `sanoma` runs it), and `url` holds its password, so a parent never logs it. None when a URL is named.
135
-
136
- With the variable, the end of stdin (the parent closing it, or exiting), or an error reading it, stops `sanoma` as SIGTERM does, so the parent keeps stdin open while it runs. `sanoma` never prompts and, without the variable, never reads stdin; it opens no browser. SIGTERM stops everything it started (the app, then the worker; in dev mode its child and the watch builds), then the company's own [Postgres](#postgres) when it started it and no other client is connected, and it exits 0.
31
+ Moved to the docs: [Commands](https://docs.sanoma.work/reference/commands/#for-a-parent-process).
137
32
 
138
33
  ## Postgres
139
34
 
140
- The worker and the app run on the config's `databaseUrl`, else `SANOMA_DATABASE_URL` (from the environment or `.env`; an empty value is none). A URL named is used as it is: `sanoma` (through `sanoma serve`), `sanoma check` and `sanoma ledger export` probe it first (`SELECT 1` on its server's `postgres` database, as its user), and stop with a message when nothing answers there or the server refuses the user. For `postgresql://postgres:dbos@localhost:5433/sanoma`, which earlier versions wrote into `.env` and started in Docker, the message says to start that container to keep its records, or to remove the line to move to the company's own.
141
-
142
- With none named, a company runs on its own PostgreSQL 18, from the `@sanoma-ai/postgres-<platform>` package installed with `sanoma` (macOS and Linux on arm64 and x64; Windows untested), extracted once into the OS's cache (`~/Library/Caches/sanoma/postgres/<version>-<platform>-<sha>` on macOS, under `$XDG_CACHE_HOME` or `~/.cache` on Linux, `%LOCALAPPDATA%` on Windows), or from `SANOMA_POSTGRES_DIR`, a directory holding its `bin/`. Its cluster is `.sanoma/postgres` in the company's directory of the main checkout (beside git's common directory, so a worktree of the repo uses the same one): `data/`, `server.log`, `password` (random, readable by its owner alone) and a `.gitignore` of its own. It listens on 127.0.0.1 alone, at a port picked when it was made (another when that one is taken), at `postgresql://postgres:<password>@127.0.0.1:<port>/sanoma`, which `sanoma` sets as its own `SANOMA_DATABASE_URL` for the runtime and every child it starts, never in `.env`. `sanoma` creates it on the first run (`initdb`, saying once where the records live), starts it on the next, and uses it as it is while another `sanoma` on the repo runs it; `check` runs its scenarios on `sanoma_check` beside the company's `sanoma`. It runs in a process group of its own, so a terminal's ctrl-c reaches `sanoma` alone, which stops it after the app and the worker when it started it and no other client is connected (another `sanoma`'s worker), and leaves it up otherwise. `sanoma worker` and `sanoma app` never start it: they exit 2 when it does not run. Deleting `.sanoma/postgres` deletes the company's records. PostgreSQL refuses to run as root: there, set `SANOMA_DATABASE_URL`. A synced folder (iCloud Drive, Dropbox) may copy the files of a running database half-written: keep the repo out of one (`sanoma` warns in iCloud Drive).
35
+ Moved to the docs: [Postgres](https://docs.sanoma.work/hosting/postgres/).
143
36
 
144
37
  ## `.env.example`
145
38
 
146
- `sanoma env` keeps `.env.example` the manual of the variables: `SANOMA_DATABASE_URL`, `SANOMA_APP_PORT`, `SANOMA_APP_HOST` and the GitHub sign-in variables first, with their defaults, then a block per vendor in the connectors' order, each variable its driver's `env` declares with its `.describe()` text. A required variable is `NAME=`; an optional one is commented out, `# NAME=`, with `Optional.` before its description. The same config gives the same text, which `--check` compares byte for byte. Copy bootstrap inputs to `.env` (ignored by git). Store-backed credential reads use `secrets.bindings` to select an environment variable explicitly; there is no environment-first fallback. Connector pages write to the selected store. Drivers still using their own `env` declarations remain a separate path until migrated to named authentication.
39
+ Moved to the docs: [Files sanoma writes](https://docs.sanoma.work/reference/files/).
147
40
 
148
41
  ## Secret storage and bootstrap
149
42
 
150
- Configure `secrets`, `connections` and `connectionRules` in `sanoma.config.ts`; workflow code names a connection and resource data files contain secret references. See the runtime's [configuration and connection examples](workflows/README.md#credentials) for the exported types and ownership rules. The default is encrypted rows in the company's Postgres. A configured `SecretStore` or runtime-bound store factory replaces that storage; the [Supabase Vault adapter](../../connectors/supabase/README.md#supabase-vault-as-the-secret-store) supports BYOC. The app's [connection forms](app/README.md#connection-management) verify and save accounts through this selected store. Going live uses explicitly declared default connections for vendors with named authentication.
151
-
152
- For managed Cloud configuration, `import { managedKmsStore } from "sanoma/secrets"` supplies the [KMS-backed Postgres store](workflows/KMS-SECRETS.md#runtime-boundary) from a fixed company/key reference and broker `{ endpoint, credential }`. The runtime uses its existing database pool and opens and closes the KMS client itself. Keep the credential reader in trusted deployment config; workflow code uses logical secret references. This helper does not provision infrastructure or establish deployed Cloud readiness.
153
-
154
- `SANOMA_SIGNING_KEY` signs app sessions and authorization state. `SANOMA_SECRETS_KEY` protects the built-in encrypted rows. Both are independent random 32-byte values encoded as base64. Supply a key directly or use `SANOMA_SIGNING_KEY_FILE` / `SANOMA_SECRETS_KEY_FILE` for a mounted file, never both sources for one key. First local start generates missing keys in ignored `.env`, creating the file with owner-only permissions. Direct and mounted inputs are validated before startup; conflicting sources, unreadable files and malformed values fail without printing their contents. External-store configurations need the signing key and the provider's bootstrap identity, but no Sanoma row-encryption key.
155
-
156
- The template declares explicit `{ bootstrap: "SANOMA_SIGNING_KEY" }` and `{ bootstrap: "SANOMA_SECRETS_KEY" }` bindings so a host resource can deliver these values without putting them in code or the database. Keep matching encryption material with a separate recovery backup of database ciphertext and metadata. Preserve signing material across ordinary restarts; replacing it invalidates signed sessions. Encryption-key rotation requires re-encrypting retained rows, while vendor-token rotation replaces the value in the store. See [bootstrap keys](workflows/README.md#bootstrap-keys).
43
+ Moved to the docs: [Secrets](https://docs.sanoma.work/hosting/secrets/).
157
44
 
158
45
  ## The lint
159
46
 
160
- `sanoma check` lints `workflows/`, `resources/`, `sites/` and `apps/`, those that exist, with oxlint, run in the repo's root on the repo's own `.oxlintrc.json`, so an editor's oxlint reads the same file and the rules' `workflows/**` globs match against the root. `sanoma check` writes that file when there is none:
161
-
162
- ```json
163
- {
164
- "extends": ["./node_modules/sanoma/oxlint.json"]
165
- }
166
- ```
167
-
168
- `sanoma/oxlint.json` is self-contained (it extends nothing): `sanoma/workflows`'s rules (the clock, randomness, the network, the environment, the imports a workflow may make, with its plugin inside `sanoma`; data files are held to no lint, since Sanoma loads them and reports what does not load), a site's (client code only: no server function, `*.server.*` file or route `server` handlers, no import of the runtime, a connector, Postgres, DBOS, Node's modules or TanStack Start, the app only through `sanoma/site` and `sanoma/ui`, no relative import out of `sites/`, no `virtual:` module (content comes through `content`), no `process` or `require`; types may be imported from anywhere; `sites/__virtual.ts`, the build's listing, aside) and the rules this repo holds its own code to. Add your own rules beside the `extends`; `sanoma check` leaves an existing file alone.
47
+ Moved to the docs: [Files sanoma writes](https://docs.sanoma.work/reference/files/#the-lint).
169
48
 
170
49
  ## Sites
171
50
 
172
- A folder under `sites/` with a `routes/` directory is a site: TanStack Router file routes the app serves under `/sites/<name>`, in its shell (see [`sanoma/app`'s Sites](app/README.md#sites)). A route file imports `createFileRoute` from `@tanstack/react-router`; the repo installs nothing for it but `sanoma`.
173
-
174
- - `sanoma app` (and `sanoma` when `SANOMA_APP_HOST` is another machine's) builds the app with the repo's sites before anything starts (`building the app with 1 site (hello)`), into `.sanoma/app/build/<key>`, and serve that build. The key covers the app's version and every file under `sites/` and `content/`, so a start with nothing changed reuses the build (`app build up to date`). With no site, they serve the build the app ships and write nothing under `.sanoma/` but `api.ts`. A build that fails stops the command before the worker starts.
175
- - `.sanoma/api.ts` is the generated SDK: `sanoma check` (first, before tsc), and `sanoma`, `sanoma serve` and `sanoma app` at start, write it from the config when its text changed, with sites or without; while `sanoma` serves the sites from its dev server, it writes it again (`wrote .sanoma/api.ts`) when `sanoma.config.ts` or any TypeScript file in the repo outside `sites/`, `.sanoma/` and `node_modules/` changes. It types `api` from `sanoma/site`: `api.<workflow>` (the workflow's name in camelCase, `WorkflowFn` of its input), `api.<vendor>.<resource>.<op>` for each operation a person may call directly (a vendor's read, `OpFn` of its input) and `api.data.<collection>` (`CollectionApi` of the collection's record), each with its title and descriptions as JSDoc, so whoever writes a site sees what each call is and `tsc -p sites/tsconfig.json` refuses a call that does not fit. The sites' tsconfig is the only one that reads it: the repo's root `tsconfig.json` (Node, no DOM) must not include it. A workflow whose api name another workflow, a vendor or `data` has is left out of it, and `sanoma check` reports it. Never edit it.
176
- - `sanoma check`, when there is a site, writes the sites' generated files, then, beside tsc, oxlint and the config, builds the app with the sites (reused when nothing changed) and runs `tsc -p sites/tsconfig.json`, which types every `Link` against every page of the app and the sites. Each of these is a problem: a type error at its `file:line:col`; two pages claiming one path (`More than one page claims /sites/hello/: …`); a site importing server code (`sites/hello/routes/index.tsx:4:28: Import denied in client environment: "sanoma/workflows"`); a folder whose name is not one URL segment (`sites/<name>: a site's folder name is a URL segment (lowercase letters, digits and dashes)`), which the app does not mount; and under `content/`, front matter that is not a YAML mapping, at its line (`content/posts/bad.md:2:1: front matter: Tabs are not allowed as indentation`), or a folder or file whose name is not a URL segment, which the sites do not see.
177
- - On a public site, `sanoma check` reports each start (`api.signup(…)`, `.start(…)`, a `RunForm`) and each direct call (`api.data.<collection>.<op>`, `api.<vendor>.<resource>.<op>`) that no `permit` in `policies/` could let a visitor make, whatever its `when` and `unless` (one for `anonymous`; on a site with a `login`, for `anonymous` or `visitors`), at its `file:line:col` with the line to add: `sites/www/routes/index.tsx:8:9: a visitor's call to workflow "signup" is refused: no permit in policies/ names anonymous for workflow:signup. Add: permit (principal == Sanoma::Principal::"anonymous", action == Sanoma::Action::"workflow:signup", resource);`. Nothing is held to the policies while they have a problem. Whatever they say, a public site's call of a built-in workflow, or read of a workflow's runs but `.result`, is reported too: the app refuses it to every visitor.
178
- - A site's `public/` folder holds files served as they are, such as a prebuilt script a page loads by its URL: `sites/<name>/public/<path>` is at `/sites/<name>/<path>` on the app (an app's site's at `/sites/<app>/<name>/<path>`), and at `/<path>` on a public site's own host, `<name>.localhost` and its domain. The build copies them into its files without bundling or renaming them, `sanoma` serves them from disk as they are saved, and neither the lint, tsc nor Tailwind reads them. A file is as reachable as the site's pages: on the app's host to the people its login lets in, and on a public site's host to every visitor, signed in or not, since a site's login decides what a visitor's calls may read, not who loads its pages. The build refuses a file whose name has no extension, one at a page's path, one at a path a site's own host keeps for the app (`robots.txt`, `sitemap.xml`, `assets/`, `auth/`, `sites/`, `_serverFn/`, `__sanoma/`), and one over 25 MiB, the most Cloudflare serves as one of a Worker's assets; it leaves out a dotfile or a dot-folder (`.DS_Store`, `.well-known/`) and a link. A file is answered before a page whose path has a parameter, such as `docs/$slug`.
179
- - `content/` holds the Markdown a site reads through `content` from `sanoma/site` ([`sanoma/app`'s Content](app/README.md#content)): `content/<kind>/<slug>.md`, front matter and a body, found by convention as `sites/` is. `.sanoma/content.ts` types it from the files' front matter, written with the sites' generated files and, on the dev server, again when a file under `content/` changes. A file with `draft: true` shows on the dev server and never in a build.
51
+ Moved to the docs: [Sites](https://docs.sanoma.work/sites/overview/).
180
52
 
181
53
  ### Demos
182
54
 
183
- `sanoma demo --out <dir>` builds the repo's sites as a demo: static files that render them into an element of any page, running each workflow a site calls in the browser, every vendor on its connector's fake, every collection in memory, from the world `scenarios/world.feature` seeds (one Scenario of Givens), so a visitor tries the real pages with no server and no request leaving the page. Put it in a site's `public/` folder (`sites/www/public/demos/invoicing/`, every URL in it relative) and mount it from a page:
184
-
185
- ```tsx
186
- // sites/www/routes/invoicing.tsx: the demo, in a page of the public site.
187
- import { useEffect, useRef } from "react";
188
-
189
- function Demo() {
190
- const element = useRef<HTMLDivElement>(null);
191
- useEffect(() => {
192
- const url = "/demos/invoicing/mount.js";
193
- const mounting = import(/* @vite-ignore */ url).then(({ mount }) =>
194
- mount(element.current, { path: "/sites/invoicing/invoicing", exit: () => location.assign("/start") }),
195
- );
196
- return () => void mounting.then((unmount: () => void) => unmount());
197
- }, []);
198
- return (
199
- <>
200
- <link rel="stylesheet" href="/demos/invoicing/demo.css" />
201
- <div ref={element} />
202
- </>
203
- );
204
- }
205
- ```
206
-
207
- - `mount(element, { path, exit })` resolves to the unmount. `path` is the page shown first, as the app has it (`/sites/<site>/…`, an app's site's `/sites/<app>/<site>/…`; the first site's home unless given), on a history of the demo's own: the host's URL and history never move. `exit` is called with the path a link leads to outside the sites (an app page's) instead of going there. Each mount starts from the world again. A `mount` called on an element while an earlier one there still seeds wins: the earlier renders nothing. A page may mount several demos, but `api` is one: the runtime of the last `mount` seeded and still mounted answers it. Mount at most one demo whose pages call `api`.
208
- - `demo.css` holds Tailwind's theme and utilities, the kit's look and the sites' own stylesheets (a route's `import css from "../style.css?url"` too), never preflight, every rule scoped to the element (`[data-sanoma-demo]`, which `mount` sets on it). The element is the demo's document: it has the light theme's background, type and colour, and the kit's dark styles stay off, whatever the host's theme. A site's `toast` shows at the window's corner, as in the app (at a transformed element's, when one is around the demo), with the stylesheet Sonner adds to the page's head. Its rules are in Tailwind's layers, which a host's unlayered rules for `h1`, `a` or `button` win over: keep those in layers.
209
- - Every approval a run asks for is approved at once, by its approver. A `ctx.sleep` waits as it does in the app: a run that waits a week stays at its sleep, running, and what follows the sleep happens only once the week has passed with the page still open. The unmount drops the demo's runs and their timers. Who calls is `anonymous`. The page carries the description of the workflows it runs, their operations and the repo's collections and apps, never its policies, secrets, connections, resources or login.
210
- - The build refuses, each at its file: a workflow a site calls that is defined in `sanoma.config.ts` rather than its own file under `workflows/`; a call to the app's own operations (`sanoma.*`); a collection a site reads that no data file under `resources/` exports; a vendor whose connector has no fake, or names no package (`info.package`) for the page to import it from; a world the fakes cannot take (with the world's own message); a folder holding files no demo writes; and a page that would load what only a server has (Node's modules, DBOS, `pg`, Drizzle). `sanoma/invoices/pdf` (and `@react-pdf/renderer`, when the repo installs it) is bundled for the browser, loaded when a page imports it.
55
+ Moved to the docs: [Demos](https://docs.sanoma.work/sites/demos/).
211
56
 
212
57
  ### Developing a site
213
58
 
214
- `sanoma` serves the app and the sites from Vite's dev server instead of a build (`serving the app with 1 site (hello) from Vite's dev server: edits show as they are saved`), behind the same login, and writes no build:
59
+ Moved to the docs: [Developing a site](https://docs.sanoma.work/sites/developing/).
215
60
 
216
- - An edit to a site's file shows in the open page as it is saved, without a reload, the page's state kept (hot module replacement); the server's render of the page follows on the next request.
217
- - A file saved under `content/` shows on the next render of a page that reads it, drafts included, with no restart, and `.sanoma/content.ts` is written again.
218
- - A new page, or a new site folder, is live once its first route file is written: the route tree is regenerated and open pages reload, with no restart. A Tailwind class in a new file is styled too, by the app's stylesheet and by a site's own ([`sanoma/app`'s A site's own stylesheet](app/README.md#a-sites-own-stylesheet)).
219
- - A change to `sites/__virtual.ts` itself needs a restart: the route generator loads that file once. `sanoma` writes it; never edit it.
220
- - `sanoma check` beside it builds the app with the same route options, so it leaves the dev server's route tree alone.
221
- - The dev server listens on this machine only: with `SANOMA_APP_HOST` naming another, `sanoma` builds the sites and serves the build, as `sanoma app` does.
222
- - A public site (`defineSite({ public: true })`) answers at the root of `<name>.localhost` on the app's port, with hot updates too, as its visitors see it ([public sites](app/README.md#public-sites)); `sanoma`, `sanoma serve` and `sanoma app` print each one's address after they start (`www: http://www.localhost:3000`). Browsers send `*.localhost` to this machine with no setup.
61
+ ## Template files
62
+
63
+ Moved to the docs: [Files sanoma writes](https://docs.sanoma.work/reference/files/#template-files).
223
64
 
224
65
  ## Invoices
225
66
 
226
- `sanoma/invoices` is an invoice's shape and exact arithmetic (zod only), and `sanoma/invoices/pdf` its PDF (`renderInvoice`, in Node and in a browser). Both are plain functions a workflow or a site's page imports: no connector, nothing stored. Rendering needs `@react-pdf/renderer` installed beside `sanoma`; a company that never renders needs nothing more. See [`sanoma/invoices`](invoices/README.md).
67
+ Moved to the docs: [Invoices](https://docs.sanoma.work/reference/invoices/).
227
68
 
228
69
  ## Generated files
229
70
 
230
- | File | Written by | Commit it |
231
- | ----------------------------------------------------- | ----------------------------------------- | ----------------------------------------- |
232
- | `.env.example` | `sanoma env` | yes |
233
- | `.oxlintrc.json` | `sanoma check`, when missing | yes |
234
- | `sites/__virtual.ts` | `sanoma` and `sanoma check`, with sites | yes |
235
- | `sites/tsconfig.json` | `sanoma` and `sanoma check`, when missing | yes |
236
- | `.sanoma/api.ts` (the sites' typed `api`) | `sanoma` and `sanoma check` | no (`.sanoma/`) |
237
- | `.sanoma/content.ts` (the sites' typed `content`) | `sanoma` and `sanoma check`, with sites | no (`.sanoma/`) |
238
- | `.sanoma/app/` (the route tree, its tsconfig, builds) | `sanoma` and `sanoma check`, with sites | no (`.sanoma/`, and its own `.gitignore`) |
71
+ Moved to the docs: [Files sanoma writes](https://docs.sanoma.work/reference/files/#generated-files).
239
72
 
240
73
  ## Dev mode
241
74
 
242
- When the repo's `node_modules/sanoma` or any `node_modules/@sanoma-ai/*` is a link into a sanoma checkout (`pnpm link`), or `SANOMA_DEV_REPO` names one, `sanoma` runs `sanoma serve --dev` in a child process (serving the [sites](#developing-a-site) as `sanoma` does) and, in the directory of every linked package, its `pnpm run watch` (each package's own watch build: for `sanoma`, `tsc -b --watch` of its parts and `vite build --watch` of the app). A change under any `dist/` a linked package ships (`sanoma`'s own, `workflows/dist`, `app/dist` and the rest, but `testing/dist` and `dev/dist`, which a running company never loads) restarts the child, after three quarters of a second of quiet (with sites, except the app's own pages in `app/dist/client` and `app/dist/server`: the dev server serves the app's source from the checkout and hot-updates it), one restart at a time; a child that exits on its own is reported and started again on the next change. The child and each watch run in a process group of their own, so a terminal's ctrl-c reaches `sanoma` alone, which then ends each group (SIGTERM, SIGKILL after 5 seconds) and exits. It does the same, saying `dev mode: the repo no longer links <checkout>; stopping`, once none of the repo's links into the checkout is left (`sanoma dev unlink`, an install; `node_modules` is looked at every second, and a link gone on two looks in a row is gone), so the checkout's server writes nothing more into the repo's `.sanoma/app` beside the installed sanoma.
243
-
244
- [`sanoma dev link`](dev/README.md) links `sanoma` and every declared `@sanoma-ai/*` package the checkout has.
75
+ Moved to the docs: [Dev mode](https://docs.sanoma.work/reference/dev-mode/).
245
76
 
246
77
  ## The wakeup service
247
78
 
248
- An instance whose worker stops when nothing can run (a host that scales to zero) still has what is due at a time: a schedule's next run, a sleep until a date. The wakeup service keeps that time for it while it is stopped, and calls the instance's `GET {url}/wake` then; any answer but a 2xx is tried again (after 1 s, 2 s, 4 s and so on, at most 5 minutes apart) until one is, so a wake is late at worst, never lost. `sanoma wakeup` runs it on its own; a config with `wakeup: true` runs it inside `sanoma serve` instead, its routes in the app (as sanoma-ops does for its customers). It keeps its two tables, `sanoma_wakeup_accounts` and `sanoma_wakeup_instances`, in that database, and only the sha256 of each token.
249
-
250
- Whoever runs it mints an account with `sanoma wakeup account <label>`, which prints `{"id","token"}` on stdout (or `mintAccount(label)` on [`startWakeupService`](workflows/README.md#the-wakeup-service)); its token (`swa_…`) registers instances: `POST /wakeup/instances { url, token }` takes the instance's own token (`swi_` and 43 or more base64url characters), which the company minted (`/setup` does, as `SANOMA_WAKEUP_TOKEN`), and answers `201 { id }`; posted again by the same account, the token names the same instance, now at the URL given, and answers `200 { id }` (its registered wake kept only when the URL is unchanged), and another account's is a 409; `GET` and `DELETE /wakeup/instances/{id}` with the account's token show and remove one. Before it stops, the instance sends `PUT /wakeup/wake { at }` with its own token, which names it: a 204, which replaces what it registered. A wake is resume if stopped, so one that a retry or a replaced registration sends early or twice starts at most a worker with nothing to do. Every response is JSON and `no-store`; a missing or unknown token is a 401, another account's instance a 403, a bad body a 400.
251
-
252
- A company uses one through the runtime's own wakeup, `sanoma.wakeup({ host })` (`import { sanoma } from "sanoma/resources"`), which every config with a host type has, no connector installed: `/setup` asks for the service's URL and an account's token (`SANOMA_WAKEUP_URL`, `SANOMA_WAKEUP_ACCOUNT_TOKEN`), and going live declares it when the host's own vendor has no wakeup of its own, the host given `SANOMA_WAKEUP_URL` and `SANOMA_WAKEUP_TOKEN`.
79
+ Moved to the docs: [The wakeup service](https://docs.sanoma.work/hosting/wakeup/).
253
80
 
254
81
  ## Hosting it yourself
255
82
 
256
- `sanoma worker` and `sanoma app` are the deployment's two processes. A host that composes its own process keeps `startWorker` from `sanoma/workflows` and `startApp` from `sanoma/app`, which the bin runs.
257
-
258
- [`runtime/`](runtime/Dockerfile) is the image a container host runs: Node 26, git, an SSH client, pnpm (pinned: a company's `packageManager` never makes it download another) and `provider-bridge`, and a global virtual pnpm store filled from a template project of its release (`sanoma` and every public `@sanoma-ai` package at that release's versions, from npm), and no company code. At start it checks out `SANOMA_SOURCE` at `SANOMA_REVISION`, one commit deep (`sanoma-checkout`, with `SANOMA_SOURCE_KEY` or `SANOMA_SOURCE_TOKEN` when set, [below](#cloning-a-private-repository)), runs `pnpm install --frozen-lockfile --prefer-offline`, whose `node_modules` is symlinks into the store (what the store lacks, such as a company's own extra package, is fetched), and runs `sanoma worker` on `0.0.0.0` and `PORT` (default 3000), building nothing: the config and its files load from their TypeScript source. The host passes `SANOMA_DATABASE_URL`, the encryption key when using built-in storage, and `SANOMA_WAKEUP_TOKEN`. Its health check is the worker's `/healthz`. Measured locally at half a CPU and 4 GiB, 2026-11-04, the pull not included (the slower figure is each first run on a fresh image, its files not yet in the page cache): the checkout under a second; the install 7–10 s when the company's lockfile matches the store, 14–30 s for one a `pnpm update --latest` behind on its transitive dependencies (a package whose dependencies differ below it gets a store directory of its own, copied out of the image's layers), and minutes for a company several `sanoma` releases behind the image, whose missing packages are fetched (a host runs the image of the company's own `sanoma` version); the worker answering `/healthz` 6–16 s after that: 16–38 s in all. The image is 1.3 GB.
259
-
260
- `sanoma-runtime serve` (the container's command; `docker.container` passes it) runs `sanoma serve` instead, the app beside the worker in one box: on `0.0.0.0` the app signs people in, so the host passes `SANOMA_SIGNING_KEY` and the `SANOMA_GITHUB_*` sign-in variables too, and a repo with [sites](#sites) is built at start into `.sanoma/app/` in the clone, the app listening once the build is done. `sanoma serve` also answers a [wakeup](workflows/README.md#hosts)'s `GET /wake` before any login: 204, never cached, whatever the query. The app answers the company's GitHub App's webhook at `POST /webhooks/github` too ([the app's webhooks](app/README.md#login)): a push to `main` applies the declared hosts the lockfile binds, so a merge made on GitHub deploys, and a push to a draft's branch is fetched into the draft (`follow` on its worktree) and plans its change again. On a laptop, which GitHub cannot reach, none arrives. Its worker runs under a supervisor (`superviseWorker`): with a wakeup declared and the app beyond loopback (on this machine alone, the wakeup would wake the deployed instance) it stops itself when nothing can run soon, and a fresh one starts on a wake (resume if stopped), or on a write from the app (a run's start, apply, an approval's decision), never on a page read.
261
-
262
- The image pins provider-bridge v0.2.0, verifies its release archive against committed checksums, and checks isolated-session protocol support and two concurrent sessions during the build. `--build-arg BRIDGE_FROM=source` builds the matching pinned source commit instead. Updating npm packages alone does not replace the image’s bridge binary. `--build-arg PACKAGES="$(node scripts/runtime-packages.ts)"` names the template's packages (default: `sanoma`, its latest); CI builds the image from what npm has now (`--public`) without pushing it, and runs no company in it. A release pushes it to GitHub's registry as `ghcr.io/sanoma-ai/runtime:<sanoma version>` once the same release has published the packages ([Release](../../README.md#release) has the hand command).
83
+ Moved to the docs: [Hosting it yourself](https://docs.sanoma.work/hosting/self-hosting/).
263
84
 
264
85
  ### The worker's port
265
86
 
266
- With `PORT` set, as a container host sets it, `sanoma worker` runs its worker under a supervisor (beyond loopback, it stops itself when nothing can run soon, and a wake starts it again) and, once the worker runs, answers on `SANOMA_APP_HOST` (default 127.0.0.1) and `PORT`:
267
-
268
- - `GET /healthz`: 200.
269
- - `GET /wake`: a [wakeup](workflows/README.md#hosts)'s wake, handed to the supervisor (resume if stopped); 204, never cached.
270
- - `GET /__sanoma/app-bundle?revision=<commit>` with `Authorization: Bearer <SANOMA_WAKEUP_TOKEN>`: the app bundle the Cloudflare host's Worker script runs at that commit (`AppBundle`, from `buildAppBundle` in `sanoma/app/bundle`, each public site's domain from `SANOMA_DOMAINS`), built on the first ask, one revision at a time, in a checkout of its own beside the worker's, made and installed as the start makes its own (`SANOMA_CHECKOUT`, the image's `sanoma-checkout`), and built by that checkout's own `sanoma`, the checkout removed after. 202 while it builds, then 200 with the bundle as JSON, kept in a file beside the checkout for the process's lifetime; a failed build 500 with why, once, the next ask building again. Every answer is JSON, `no-store`, marked `x-sanoma-app-bundle`; another token is a 401, a revision that is not a commit id a 400.
271
-
272
- On a host that starts the process again on a wake, whose wake route its environment names (`SANOMA_HOST_URL` and `SANOMA_WAKEUP_TOKEN`, as the Cloudflare host gives them), being done means ending: once its worker stopped itself and no app bundle is building, the port closes and the process exits 0, as on SIGTERM, and the container ends with it. A wake before that wins, and a fresh worker starts; one after it finds the port closed, and the host starts a fresh process. A build that ends while the worker is stopped starts a fresh one, which ends the process on its own check. Elsewhere (loopback, no wake route, `sanoma serve`) the process stays up.
273
-
274
- Without `PORT`, it listens on nothing and its worker never stops itself: nothing in its process would start it again.
87
+ Moved to the docs: [Hosting it yourself](https://docs.sanoma.work/hosting/self-hosting/#the-workers-port).
275
88
 
276
89
  ### Cloning a private repository
277
90
 
278
- The repository going live makes is private, so a host is given a credential to clone it with at every start (the container clones at each start, and a GitHub App's token lasts an hour). Going live makes it: a new read-only deploy key for the repository, an RSA key whose private half (PKCS#1 PEM, which OpenSSH reads as it is) is stored as `SANOMA_SOURCE_KEY` and given to the host among its `secrets`, never in a data file, and whose public half `resources/sanoma/infra.ts` declares as `github.repository_deploy_key({ repository: repo, title: "Sanoma host", key, read_only: true })`, made by the apply that makes the repository; the host's apply waits until it is bound. With `SANOMA_SOURCE_KEY` set, the entrypoint writes it to a file only its user reads, removed once the checkout is done or the start fails, trusts only GitHub's host keys (the `ssh_keys` of `https://api.github.com/meta`, read over HTTPS at start, else `runtime/github_known_hosts`, the copy committed beside the image, for when the API does not answer, as a rate limit on a shared address may; `node github-known-hosts.mjs > github_known_hosts` refreshes it) and fetches over SSH on the HTTPS port, which egress allows where port 22 may not be (`ssh://git@ssh.github.com:443/<owner>/<name>.git` for an `https://github.com/<owner>/<name>.git` source, through git's `insteadOf` for the fetch alone); `SANOMA_SOURCE` must be such a URL. `SANOMA_SOURCE_TOKEN`, for a self-hoster with a token instead, goes in an HTTP header. Either is given to the fetch alone, never written to `.git/config` (`origin` stays `SANOMA_SOURCE`); both stay in the company's environment, where a deploy from the instance itself reads the host's secrets and the worker's port checks out a revision it builds. Without either, the fetch is anonymous, as a public repository needs.
279
-
280
- To try the SSH path by hand, without registering a key: `docker run --rm -e SANOMA_SOURCE=https://github.com/<owner>/<private repo>.git -e SANOMA_REVISION=<sha> -e SANOMA_SOURCE_KEY="$(cat <a PEM GitHub does not know>)" sanoma-runtime` ends at `Permission denied (publickey)`, past `Host key verification failed`: the host key was pinned and the key offered. With the private half of a deploy key of the repository, it clones and installs.
91
+ Moved to the docs: [Hosting it yourself](https://docs.sanoma.work/hosting/self-hosting/#cloning-a-private-repository).
281
92
 
282
93
  ### Standalone identity service
283
94
 
284
- `sanoma identity` runs the trusted runtime or provisioning broker from explicit host configuration, without loading company files or starting a workflow worker. It creates no database or schema. See [Cloud identity deployment](workflows/CLOUD-IDENTITY.md#standalone-identity-service) for required variables, separate reader/audit roles, HTTPS ingress and readiness checks. The runtime image runs it with the command `identity` and no checkout; see [Deploying the issuers](workflows/CLOUD-IDENTITY.md#deploying-the-issuers).
95
+ Moved to the docs: [Hosting it yourself](https://docs.sanoma.work/hosting/self-hosting/#standalone-identity-service).
285
96
 
286
97
  ### The box image
287
98
 
288
- [`box/`](box/Dockerfile) is the image a person's coding agents work in on Agent37, which [its connector](../../connectors/agent37/README.md#the-box-image) makes a new box from by default: Node 26, git, pnpm (pinned as the runtime image's), and every connector's own coding agent ([`box/agents.json`](box/agents.json), held by `test/box.test.ts` to what the connectors declare) installed under `/opt/sanoma/agents/<agent>` as the app installs one in a box's home, by `pnpm add --ignore-scripts`, the vendor's `setup`, and `installed.json` the packages; they belong to root, which `node` can read and run but not change. The app runs an agent from there when its `installed.json` is the packages it wants, and installs it in the box's home otherwise. Its user is `node` and its command `sleep infinity`, since Agent37 keeps an instance up while its main process runs and starts Sanoma's runner in it by exec. Nothing of it is under `/home/node`, where Agent37 mounts the box's disk. `docker build --platform linux/amd64 -t sanoma-box packages/sanoma/box` builds it with no install of this workspace; the release pushes it as `ghcr.io/sanoma-ai/box:<version>`.
289
-
290
- Status: early (0.x). License: FSL-1.1-ALv2.
99
+ Moved to the docs: [Hosting it yourself](https://docs.sanoma.work/hosting/self-hosting/#the-box-image).