sanoma 0.11.22 → 0.11.24

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 (591) hide show
  1. package/README.md +57 -14
  2. package/app/README.md +45 -9
  3. package/app/dist/api.d.ts +203 -6
  4. package/app/dist/api.js +143 -5
  5. package/app/dist/api.js.map +1 -1
  6. package/app/dist/build.d.ts +28 -3
  7. package/app/dist/build.js +154 -15
  8. package/app/dist/build.js.map +1 -1
  9. package/app/dist/bundle-build.d.ts +32 -0
  10. package/app/dist/bundle-build.js +127 -67
  11. package/app/dist/bundle-build.js.map +1 -1
  12. package/app/dist/client/assets/ArrowDown.es-CmCelew7.js +1 -0
  13. package/app/dist/client/assets/Check.es-b7BdqO2s.js +1 -0
  14. package/app/dist/client/assets/CheckCircle.es-DKXiWmAT.js +1 -0
  15. package/app/dist/client/assets/{DialogTitle-Dz3loDe5.js → DialogTitle-5oboyLiq.js} +1 -1
  16. package/app/dist/client/assets/{_id-DRetx-BJ.js → _id-B2CwocmD.js} +1 -1
  17. package/app/dist/client/assets/{_id-C4bMZ73g.js → _id-Cd0g-T0m.js} +1 -1
  18. package/app/dist/client/assets/_id-Dk4x2N-W.js +1 -0
  19. package/app/dist/client/assets/{_id-tN6nFEpD.js → _id-DpXaqFb0.js} +1 -1
  20. package/app/dist/client/assets/_id-XHvGLPkN.js +1 -0
  21. package/app/dist/client/assets/{_name-CrsiaFT6.js → _name-Cy9gSmms.js} +1 -1
  22. package/app/dist/client/assets/_name-DKYZ1YgQ.js +1 -0
  23. package/app/dist/client/assets/_name-DNoZHFvr.js +1 -0
  24. package/app/dist/client/assets/_name-Dsy5uNfc.js +4 -0
  25. package/app/dist/client/assets/{_vendor-sHwAlFSF.js → _vendor-CkX_MEw-.js} +1 -1
  26. package/app/dist/client/assets/{_vendor-C3TGvx4w.js → _vendor-CtXzCWko.js} +1 -1
  27. package/app/dist/client/assets/app-chrome-BLIfokh_.js +5 -0
  28. package/app/dist/client/assets/{app-scope-Bht7PIkQ.js → app-scope-DWi_J8Sd.js} +1 -1
  29. package/app/dist/client/assets/approval-DoWiFprg.js +1 -0
  30. package/app/dist/client/assets/{apps-CpdXjc1j.js → apps-QmiHwEGA.js} +1 -1
  31. package/app/dist/client/assets/{change-glance-CdkbSGxZ.js → change-glance-BKxlAFtS.js} +1 -1
  32. package/app/dist/client/assets/{changes-DFcdyDL_.js → changes-BU0TNuVs.js} +1 -1
  33. package/app/dist/client/assets/changes-DELoHd2O.js +1 -0
  34. package/app/dist/client/assets/{chat-Djbdaxw8.js → chat-W570LGFb.js} +2 -2
  35. package/app/dist/client/assets/common-BNfPX6nt.js +3 -0
  36. package/app/dist/client/assets/composite-CoGyvQjv.js +1 -0
  37. package/app/dist/client/assets/connect-Ctz5pmEW.js +1 -0
  38. package/app/dist/client/assets/connections-B8222Op7.js +5 -0
  39. package/app/dist/client/assets/{connectors-CuS1paNm.js → connectors-BE70xFaC.js} +1 -1
  40. package/app/dist/client/assets/credentials-CY2BCDKD.js +1 -0
  41. package/app/dist/client/assets/data-l9hYG2QZ.js +1 -0
  42. package/app/dist/client/assets/decidable-BN9ROOeu.js +1 -0
  43. package/app/dist/client/assets/{declaration-form-D2ZMEVC6.js → declaration-form-DyluX0R-.js} +1 -1
  44. package/app/dist/client/assets/{dialog-B5pmfCdJ.js → dialog-DDAfDsGh.js} +1 -1
  45. package/app/dist/client/assets/{existing-BaPrTDs8.js → existing-DgMjm5Gb.js} +1 -1
  46. package/app/dist/client/assets/{fence-CMhOJv7H.js → fence-B7mBhZq1.js} +1 -1
  47. package/app/dist/client/assets/{graph-B5TYhcqD.js → graph-CI9HJ0Fq.js} +2 -2
  48. package/app/dist/client/assets/{grid-diff-wo26YSgM.js → grid-diff-ClRtSBw1.js} +1 -1
  49. package/app/dist/client/assets/held-card-Ith_e2pU.js +1 -0
  50. package/app/dist/client/assets/{highlighted-body-JLMTFACH-CjeaSnZq.js → highlighted-body-JLMTFACH-CizP1ld1.js} +1 -1
  51. package/app/dist/client/assets/hosting-CoXqPSGw.js +1 -0
  52. package/app/dist/client/assets/import-DwI_C7L0.js +1 -0
  53. package/app/dist/client/assets/inbox-BVmVojZD.js +1 -0
  54. package/app/dist/client/assets/inbox-CHDaX9y5.js +1 -0
  55. package/app/dist/client/assets/index-Cp944Jof.js +10 -0
  56. package/app/dist/client/assets/{item-B4QRpXse.js → item-CXBFegng.js} +1 -1
  57. package/app/dist/client/assets/kit-DxZIYy5q.js +1 -0
  58. package/app/dist/client/assets/lazyRouteComponent-A5qFQUwF.js +1 -0
  59. package/app/dist/client/assets/{markdown-DS_nKu0s.js → markdown-BBLvchh4.js} +5 -5
  60. package/app/dist/client/assets/mermaid-WFAXDIZX-C18E3sbR.js +1 -0
  61. package/app/dist/client/assets/people-aMFiCP4h.js +1 -0
  62. package/app/dist/client/assets/{permissions-BmKxEfBi.js → permissions-BYNciznY.js} +2 -2
  63. package/app/dist/client/assets/{permissions-grid-B755bq5J.js → permissions-grid-B_lA_2ty.js} +1 -1
  64. package/app/dist/client/assets/{queries-DGlVu9wp.js → queries-sOO2EuSp.js} +1 -1
  65. package/app/dist/client/assets/review-CNimdqC2.js +1 -0
  66. package/app/dist/client/assets/{route-Ds87ixtB.js → route-BQgUCUI-.js} +1 -1
  67. package/app/dist/client/assets/{route-BSe5L2p4.js → route-rcZHTxxF.js} +1 -1
  68. package/app/dist/client/assets/routes-uzcnBShG.js +1 -0
  69. package/app/dist/client/assets/runs-table-CfvJDLfm.js +1 -0
  70. package/app/dist/client/assets/{scenario-DrgmfuFx.js → scenario-W7uPU063.js} +1 -1
  71. package/app/dist/client/assets/{scenario-graph-Blv2e1PV.js → scenario-graph-CjY0h_3M.js} +1 -1
  72. package/app/dist/client/assets/{sheet-BKUFUA1l.js → sheet-BTH95vFG.js} +1 -1
  73. package/app/dist/client/assets/sites.index-3TQpsLus.js +1 -0
  74. package/app/dist/client/assets/start-form-DlZ3zoCU.js +1 -0
  75. package/app/dist/client/assets/style-DaqPHcI1.css +2 -0
  76. package/app/dist/client/assets/useLoaderData-BEdUbEde.js +1 -0
  77. package/app/dist/client/assets/{useRegisterFieldControl-DIkKUJkh.js → useRegisterFieldControl-CT8iqvDE.js} +1 -1
  78. package/app/dist/client/assets/who-are-you-D8N5yjZE.js +1 -0
  79. package/app/dist/client/assets/workflow-Bt1NbErS.js +1 -0
  80. package/app/dist/client/assets/workflow-view-CBRoDqLQ.js +1 -0
  81. package/app/dist/client/assets/{workflows-DFB7lzzN.js → workflows-CF1eg5bA.js} +1 -1
  82. package/app/dist/components/grid/plan.d.ts +46 -262
  83. package/app/dist/components/grid/plan.js +134 -138
  84. package/app/dist/components/grid/plan.js.map +1 -1
  85. package/app/dist/demo-build.d.ts +58 -0
  86. package/app/dist/demo-build.js +440 -0
  87. package/app/dist/demo-build.js.map +1 -0
  88. package/app/dist/handler.d.ts +9 -7
  89. package/app/dist/handler.js +10 -10
  90. package/app/dist/handler.js.map +1 -1
  91. package/app/dist/index.js +52 -35
  92. package/app/dist/index.js.map +1 -1
  93. package/app/dist/lib/chat.d.ts +3 -1
  94. package/app/dist/lib/chat.js.map +1 -1
  95. package/app/dist/lib/names.d.ts +7 -0
  96. package/app/dist/lib/names.js +6 -2
  97. package/app/dist/lib/names.js.map +1 -1
  98. package/app/dist/login/page.d.ts +1 -10
  99. package/app/dist/login/page.js +0 -14
  100. package/app/dist/login/page.js.map +1 -1
  101. package/app/dist/login/staff.js +3 -3
  102. package/app/dist/login/staff.js.map +1 -1
  103. package/app/dist/loopback.d.ts +3 -1
  104. package/app/dist/loopback.js +8 -4
  105. package/app/dist/loopback.js.map +1 -1
  106. package/app/dist/server/assets/{_id--MWJXj9R.js → _id-COm1il39.js} +2 -2
  107. package/app/dist/server/assets/{_id-BEGe86NW.js → _id-ChjpKAh9.js} +2 -2
  108. package/app/dist/server/assets/{_id-DwdpIYKk.js → _id-DLn-MJis.js} +3 -3
  109. package/app/dist/server/assets/{_id-fK_nPFHK.js → _id-S6cZBKRd.js} +12 -7
  110. package/app/dist/server/assets/{_id-CbO7Ok0w.js → _id-_meozwGS.js} +12 -329
  111. package/app/dist/server/assets/{_name-BzD9TxVC.js → _name-B-uy64Pg.js} +201 -54
  112. package/app/dist/server/assets/{_name-DdFVsjcj.js → _name-Bli8LVNv.js} +4 -4
  113. package/app/dist/server/assets/{_name-ClgMsl5m.js → _name-C7E4pvya.js} +2 -2
  114. package/app/dist/server/assets/{_name-Dyh4G9Oy.js → _name-CIfg_fie.js} +10 -9
  115. package/app/dist/server/assets/{_tanstack-start-manifest_v-DUtnBg7y.js → _tanstack-start-manifest_v-Ngrl1Rzd.js} +92 -73
  116. package/app/dist/server/assets/{_vendor-W3KKSusM.js → _vendor-CcjWwCkS.js} +2 -2
  117. package/app/dist/server/assets/{_vendor-DyeUY8kH.js → _vendor-R5UJa3bN.js} +7 -7
  118. package/app/dist/server/assets/{actor-BlaOwG6A.js → actor-BsKC225p.js} +1 -1
  119. package/app/dist/server/assets/{app-chrome-BJlxsc9y.js → app-chrome-VJfQ5Mof.js} +253 -71
  120. package/app/dist/server/assets/{app-scope-ASuhE3xI.js → app-scope-DQmTl_K1.js} +1 -1
  121. package/app/dist/server/assets/{apply-plan-Djw1tNPD.js → apply-plan-WEi9x_3r.js} +4 -4
  122. package/app/dist/server/assets/{approval-BjTnfr1U.js → approval-B0b2wxUM.js} +10 -9
  123. package/app/dist/server/assets/{apps-C28F9Y5C.js → apps-C8jD3qwc.js} +4 -4
  124. package/app/dist/server/assets/{change-glance-Bc4htVPy.js → change-glance-DFnHAMy8.js} +2 -2
  125. package/app/dist/server/assets/{changes-B5P8BJSf.js → changes-BHaboSg4.js} +1 -1
  126. package/app/dist/server/assets/{changes-tbeMKxjY.js → changes-_1nrzrkD.js} +7 -7
  127. package/app/dist/server/assets/{chat-BNMeLc9V.js → chat-CjIUcz1X.js} +271 -7
  128. package/app/dist/server/assets/{common-DpZcJvCy.js → common-CMaicuwY.js} +12 -66
  129. package/app/dist/server/assets/{connect-Cljunav2.js → connect-D7hUXnmu.js} +7 -7
  130. package/app/dist/server/assets/{connections-Cfz5LMy5.js → connections-DggOUl36.js} +6 -6
  131. package/app/dist/server/assets/{connectors-tt9BF9L1.js → connectors-Cy9QQORA.js} +5 -5
  132. package/app/dist/server/assets/{credentials-CYUFAVU8.js → credentials-D9I2wC5H.js} +4 -4
  133. package/app/dist/server/assets/{data-D91ZZ5St.js → data-COpRD5on.js} +6 -6
  134. package/app/dist/server/assets/{declaration-form-BzISD6gw.js → declaration-form-bQ62tjfF.js} +4 -4
  135. package/app/dist/server/assets/{existing-BZym0xE2.js → existing-hVK7PMG2.js} +4 -4
  136. package/app/dist/server/assets/{fence-Br7MPP41.js → fence-Bj_9g3rg.js} +1 -1
  137. package/app/dist/server/assets/{functions-sf07C1qn.js → functions-BoUQY2oK.js} +329 -47
  138. package/app/dist/server/assets/{graph-C1Cl7owl.js → graph-BTPVQSHz.js} +3 -3
  139. package/app/dist/server/assets/{held-card-CDewk4rs.js → held-card-azTQ59Ej.js} +5 -5
  140. package/app/dist/server/assets/{hosting-O-l2L0ec.js → hosting-Bm9w58P_.js} +494 -36
  141. package/app/dist/server/assets/{import-qvpEIYFx.js → import-Du4ZsTfq.js} +9 -7
  142. package/app/dist/server/assets/{inbox-BvpSeC3M.js → inbox-3RrayHBo.js} +2 -2
  143. package/app/dist/server/assets/{inbox-BcJxCIPm.js → inbox-BVMK6y2v.js} +10 -9
  144. package/app/dist/server/assets/{kit-DlT_THim.js → kit-D5moAfcg.js} +55 -2
  145. package/app/dist/server/assets/{markdown-BExKjghi.js → markdown-Bi6HvGoy.js} +2 -2
  146. package/app/dist/server/assets/{middleware-B6RPW0fH.js → middleware-CBVxoq2y.js} +414 -289
  147. package/app/dist/server/assets/native-select-etaMvR-i.js +30 -0
  148. package/app/dist/server/assets/{people-C8VXQrKg.js → people-B_ViX4ba.js} +19 -12
  149. package/app/dist/server/assets/{permissions-COAiOoCB.js → permissions-B3oXK0Mo.js} +6 -6
  150. package/app/dist/server/assets/{permissions-grid-CcYUiqhD.js → permissions-grid-CwWWdcQA.js} +1 -1
  151. package/app/dist/server/assets/{queries-DJcZ4mzA.js → queries-Fn3kOI_N.js} +170 -17
  152. package/app/dist/server/assets/review-BeYrtk4_.js +355 -0
  153. package/app/dist/server/assets/{route-DOqitvxL.js → route-BB2eQcP8.js} +2 -2
  154. package/app/dist/server/assets/{route-aa9MThMA.js → route-MqkQm62a.js} +2 -2
  155. package/app/dist/server/assets/{router-Co6gRNI1.js → router-DYacwjCf.js} +539 -274
  156. package/app/dist/server/assets/routes-CukD54S2.js +227 -0
  157. package/app/dist/server/assets/{runs-table-BtGm2KOO.js → runs-table-Bh8OZnyu.js} +4 -4
  158. package/app/dist/server/assets/{scenario-DidUafqw.js → scenario-Cy6zT6QN.js} +3 -3
  159. package/app/dist/server/assets/sites.index-G_BM9Vwq.js +165 -0
  160. package/app/dist/server/assets/{start-VfVsXenI.js → start-Dt_p0wFY.js} +2 -2
  161. package/app/dist/server/assets/{start-form-CUeEdeP7.js → start-form-mCkPkdmv.js} +4 -4
  162. package/app/dist/server/assets/{who-are-you-DW5qmIzp.js → who-are-you-BmmCoQYi.js} +12 -7
  163. package/app/dist/server/assets/{workflow-BRu7ljgU.js → workflow-CzqmkCer.js} +3 -3
  164. package/app/dist/server/assets/{workflow-view-yF48p1lu.js → workflow-view-CUCXZugt.js} +12 -12
  165. package/app/dist/server/assets/{workflows-DL-TJFLt.js → workflows-AwuLR9Kl.js} +10 -9
  166. package/app/dist/server/core.d.ts +79 -11
  167. package/app/dist/server/core.js +138 -123
  168. package/app/dist/server/core.js.map +1 -1
  169. package/app/dist/server/go-live.d.ts +28 -2
  170. package/app/dist/server/go-live.js +87 -32
  171. package/app/dist/server/go-live.js.map +1 -1
  172. package/app/dist/server/sanoma-sign-in.d.ts +37 -0
  173. package/app/dist/server/sanoma-sign-in.js +191 -0
  174. package/app/dist/server/sanoma-sign-in.js.map +1 -0
  175. package/app/dist/server/server.js +80 -48
  176. package/app/dist/server/setup.d.ts +2 -1
  177. package/app/dist/server/setup.js +10 -2
  178. package/app/dist/server/setup.js.map +1 -1
  179. package/app/dist/server/token-redeem.d.ts +8 -0
  180. package/app/dist/server/token-redeem.js +45 -0
  181. package/app/dist/server/token-redeem.js.map +1 -0
  182. package/app/dist/site-path.d.ts +15 -0
  183. package/app/dist/site-path.js +26 -0
  184. package/app/dist/site-path.js.map +1 -1
  185. package/app/dist/snapshot-build.js +1 -0
  186. package/app/dist/snapshot-build.js.map +1 -1
  187. package/app/dist/steps/agent/acp.d.ts +13 -10
  188. package/app/dist/steps/agent/acp.js +34 -24
  189. package/app/dist/steps/agent/acp.js.map +1 -1
  190. package/app/dist/steps/agent/prompt.js +4 -4
  191. package/app/dist/steps/agent/prompt.js.map +1 -1
  192. package/app/dist/steps/connect.d.ts +2 -0
  193. package/app/dist/steps/connect.js +1 -1
  194. package/app/dist/steps/connect.js.map +1 -1
  195. package/app/dist/steps/go-live-cloud.d.ts +23 -0
  196. package/app/dist/steps/go-live-cloud.js +100 -0
  197. package/app/dist/steps/go-live-cloud.js.map +1 -0
  198. package/app/dist/steps/go-live.d.ts +5 -2
  199. package/app/dist/steps/go-live.js +31 -18
  200. package/app/dist/steps/go-live.js.map +1 -1
  201. package/app/dist/steps/index.js +13 -2
  202. package/app/dist/steps/index.js.map +1 -1
  203. package/app/dist/steps/writes.d.ts +27 -7
  204. package/app/dist/steps/writes.js +101 -24
  205. package/app/dist/steps/writes.js.map +1 -1
  206. package/app/dist/stylesheet.json +1 -1
  207. package/app/src/api.ts +233 -6
  208. package/app/src/build.ts +177 -14
  209. package/app/src/bundle-build.ts +132 -63
  210. package/app/src/components/approval.tsx +1 -1
  211. package/app/src/components/common.tsx +17 -64
  212. package/app/src/components/data-grid.tsx +2 -1
  213. package/app/src/components/go-live-cloud.tsx +186 -0
  214. package/app/src/components/go-live.tsx +67 -18
  215. package/app/src/components/grid/columns.tsx +175 -53
  216. package/app/src/components/grid/grid.tsx +4 -2
  217. package/app/src/components/grid/plan.ts +153 -164
  218. package/app/src/components/grid/review.tsx +108 -118
  219. package/app/src/components/home.tsx +199 -0
  220. package/app/src/components/import/match.tsx +2 -1
  221. package/app/src/components/import/sheet.ts +2 -1
  222. package/app/src/components/kit.tsx +55 -1
  223. package/app/src/components/ledger.tsx +3 -3
  224. package/app/src/components/record-form.tsx +12 -5
  225. package/app/src/components/shell/bar.tsx +35 -26
  226. package/app/src/components/shell/draft-card.tsx +192 -45
  227. package/app/src/components/shell/prefs.ts +5 -2
  228. package/app/src/components/store-move.tsx +2 -1
  229. package/app/src/components/ui/radio-group.tsx +26 -0
  230. package/app/src/components/who-are-you.tsx +8 -3
  231. package/app/src/demo/api.ts +42 -0
  232. package/app/src/demo/client-rpc.ts +16 -0
  233. package/app/src/demo/demo.css +31 -0
  234. package/app/src/demo/mount.tsx +100 -0
  235. package/app/src/demo/root.tsx +31 -0
  236. package/app/src/demo/tailwind.css +4 -0
  237. package/app/src/demo-build.ts +525 -0
  238. package/app/src/env.d.ts +12 -0
  239. package/app/src/functions.ts +71 -8
  240. package/app/src/handler.ts +20 -14
  241. package/app/src/index.ts +51 -32
  242. package/app/src/lib/chat.ts +3 -1
  243. package/app/src/lib/company-state.ts +73 -0
  244. package/app/src/lib/names.ts +13 -2
  245. package/app/src/login/page.ts +1 -21
  246. package/app/src/login/staff.ts +3 -3
  247. package/app/src/loopback.ts +9 -4
  248. package/app/src/queries.ts +147 -18
  249. package/app/src/routes/__root.tsx +20 -6
  250. package/app/src/routes/changes/$id.tsx +4 -3
  251. package/app/src/routes/data/$name/import.tsx +2 -1
  252. package/app/src/routes/data/$name/index.tsx +1 -2
  253. package/app/src/routes/hosting/index.tsx +307 -51
  254. package/app/src/routes/hosting/sanoma/callback.ts +7 -0
  255. package/app/src/routes/inbox.tsx +8 -1
  256. package/app/src/routes/index.tsx +15 -4
  257. package/app/src/routes/mcp.ts +26 -0
  258. package/app/src/routes/people.tsx +13 -4
  259. package/app/src/routes/sites.index.tsx +41 -3
  260. package/app/src/routes/workflows/$name/runs/$id.tsx +3 -1
  261. package/app/src/server/columns.ts +44 -18
  262. package/app/src/server/company-state.ts +82 -0
  263. package/app/src/server/core.ts +192 -120
  264. package/app/src/server/go-live.ts +102 -31
  265. package/app/src/server/mcp.ts +300 -0
  266. package/app/src/server/sanoma-sign-in.ts +219 -0
  267. package/app/src/server/setup-progress.ts +28 -0
  268. package/app/src/server/setup.ts +11 -2
  269. package/app/src/server/token-redeem.ts +49 -0
  270. package/app/src/site-api.ts +10 -0
  271. package/app/src/site-path.ts +29 -0
  272. package/app/src/site.ts +1 -1
  273. package/app/src/snapshot-build.ts +1 -0
  274. package/app/src/steps/agent/acp.ts +32 -24
  275. package/app/src/steps/agent/prompt.ts +5 -5
  276. package/app/src/steps/connect.ts +1 -1
  277. package/app/src/steps/go-live-cloud.ts +103 -0
  278. package/app/src/steps/go-live.ts +33 -17
  279. package/app/src/steps/index.ts +13 -2
  280. package/app/src/steps/writes.ts +122 -32
  281. package/app/src/worker/app.ts +11 -9
  282. package/dist/check.d.ts +3 -2
  283. package/dist/check.js +12 -6
  284. package/dist/check.js.map +1 -1
  285. package/dist/cli.js +63 -16
  286. package/dist/cli.js.map +1 -1
  287. package/dist/config.d.ts +8 -1
  288. package/dist/config.js +49 -8
  289. package/dist/config.js.map +1 -1
  290. package/dist/events.d.ts +15 -1
  291. package/dist/events.js +7 -0
  292. package/dist/events.js.map +1 -1
  293. package/dist/init.d.ts +27 -14
  294. package/dist/init.js +87 -39
  295. package/dist/init.js.map +1 -1
  296. package/dist/serve.d.ts +6 -2
  297. package/dist/serve.js +71 -9
  298. package/dist/serve.js.map +1 -1
  299. package/dist/source.d.ts +5 -0
  300. package/dist/source.js +113 -23
  301. package/dist/source.js.map +1 -1
  302. package/invoices/README.md +66 -0
  303. package/invoices/dist/calculate.d.ts +37 -0
  304. package/invoices/dist/calculate.js +97 -0
  305. package/invoices/dist/calculate.js.map +1 -0
  306. package/invoices/dist/index.d.ts +4 -0
  307. package/invoices/dist/index.js +5 -0
  308. package/invoices/dist/index.js.map +1 -0
  309. package/invoices/dist/logo.d.ts +2 -0
  310. package/invoices/dist/logo.js +89 -0
  311. package/invoices/dist/logo.js.map +1 -0
  312. package/invoices/dist/pdf.d.ts +33 -0
  313. package/invoices/dist/pdf.js +215 -0
  314. package/invoices/dist/pdf.js.map +1 -0
  315. package/invoices/dist/schema.d.ts +156 -0
  316. package/invoices/dist/schema.js +88 -0
  317. package/invoices/dist/schema.js.map +1 -0
  318. package/oxlint.json +18 -0
  319. package/package.json +37 -5
  320. package/template/.env.example +15 -4
  321. package/template/AGENTS.md +10 -6
  322. package/template/package.json +6 -1
  323. package/template/policies/policy.cedar +5 -5
  324. package/template/resources/people.ts +5 -13
  325. package/template/resources/sanoma/infra.ts +8 -0
  326. package/template/sanoma.config.ts +18 -11
  327. package/template/scenarios/record-lead/record.feature +14 -0
  328. package/template/secrets.ts +13 -0
  329. package/template/tsconfig.json +1 -0
  330. package/template/workflows/record-lead.ts +30 -0
  331. package/testing/README.md +2 -2
  332. package/testing/dist/host.d.ts +5 -1
  333. package/testing/dist/host.js +25 -3
  334. package/testing/dist/host.js.map +1 -1
  335. package/testing/dist/scenarios.d.ts +2 -1
  336. package/testing/dist/scenarios.js +14 -4
  337. package/testing/dist/scenarios.js.map +1 -1
  338. package/workflows/README.md +54 -16
  339. package/workflows/dist/app-steps.js +26 -0
  340. package/workflows/dist/app-steps.js.map +1 -1
  341. package/workflows/dist/app-workflows.d.ts +216 -7
  342. package/workflows/dist/app-workflows.js +84 -9
  343. package/workflows/dist/app-workflows.js.map +1 -1
  344. package/workflows/dist/approvals.d.ts +3 -1
  345. package/workflows/dist/approvals.js +3 -1
  346. package/workflows/dist/approvals.js.map +1 -1
  347. package/workflows/dist/call.d.ts +8 -40
  348. package/workflows/dist/call.js +24 -135
  349. package/workflows/dist/call.js.map +1 -1
  350. package/workflows/dist/cedar.js +39 -11
  351. package/workflows/dist/cedar.js.map +1 -1
  352. package/workflows/dist/change-steps.d.ts +19 -0
  353. package/workflows/dist/change-steps.js +38 -14
  354. package/workflows/dist/change-steps.js.map +1 -1
  355. package/workflows/dist/change-workflow.d.ts +22 -10
  356. package/workflows/dist/change-workflow.js +30 -12
  357. package/workflows/dist/change-workflow.js.map +1 -1
  358. package/workflows/dist/change.d.ts +233 -7
  359. package/workflows/dist/change.js +27 -9
  360. package/workflows/dist/change.js.map +1 -1
  361. package/workflows/dist/client.d.ts +33 -4
  362. package/workflows/dist/client.js +113 -40
  363. package/workflows/dist/client.js.map +1 -1
  364. package/workflows/dist/collection-driver.d.ts +20 -0
  365. package/workflows/dist/collection-driver.js +201 -0
  366. package/workflows/dist/collection-driver.js.map +1 -0
  367. package/workflows/dist/collection.d.ts +126 -14
  368. package/workflows/dist/collection.js +45 -168
  369. package/workflows/dist/collection.js.map +1 -1
  370. package/workflows/dist/company-file.d.ts +22 -0
  371. package/workflows/dist/company-file.js +82 -0
  372. package/workflows/dist/company-file.js.map +1 -0
  373. package/workflows/dist/config.d.ts +27 -5
  374. package/workflows/dist/config.js +48 -51
  375. package/workflows/dist/config.js.map +1 -1
  376. package/workflows/dist/constructors.d.ts +1 -0
  377. package/workflows/dist/ctx.d.ts +101 -0
  378. package/workflows/dist/ctx.js +171 -0
  379. package/workflows/dist/ctx.js.map +1 -0
  380. package/workflows/dist/db/company.d.ts +114 -0
  381. package/workflows/dist/db/company.js +13 -0
  382. package/workflows/dist/db/company.js.map +1 -1
  383. package/workflows/dist/db/dbos.d.ts +17 -0
  384. package/workflows/dist/db/dbos.js +2 -0
  385. package/workflows/dist/db/dbos.js.map +1 -1
  386. package/workflows/dist/db.d.ts +1 -1
  387. package/workflows/dist/db.js +10 -6
  388. package/workflows/dist/db.js.map +1 -1
  389. package/workflows/dist/deadlines.d.ts +7 -6
  390. package/workflows/dist/deadlines.js +8 -6
  391. package/workflows/dist/deadlines.js.map +1 -1
  392. package/workflows/dist/define.d.ts +0 -8
  393. package/workflows/dist/define.js +1 -24
  394. package/workflows/dist/define.js.map +1 -1
  395. package/workflows/dist/describe.d.ts +2 -2
  396. package/workflows/dist/describe.js +4 -3
  397. package/workflows/dist/describe.js.map +1 -1
  398. package/workflows/dist/description.d.ts +371 -0
  399. package/workflows/dist/description.js +108 -4
  400. package/workflows/dist/description.js.map +1 -1
  401. package/workflows/dist/drift.d.ts +5 -2
  402. package/workflows/dist/drift.js +5 -3
  403. package/workflows/dist/drift.js.map +1 -1
  404. package/workflows/dist/errors.d.ts +16 -13
  405. package/workflows/dist/errors.js +23 -39
  406. package/workflows/dist/errors.js.map +1 -1
  407. package/workflows/dist/fake.d.ts +0 -26
  408. package/workflows/dist/fake.js +0 -123
  409. package/workflows/dist/fake.js.map +1 -1
  410. package/workflows/dist/fakes.d.ts +2 -0
  411. package/workflows/dist/fakes.js +5 -0
  412. package/workflows/dist/fakes.js.map +1 -0
  413. package/workflows/dist/givens.d.ts +51 -0
  414. package/workflows/dist/givens.js +89 -0
  415. package/workflows/dist/givens.js.map +1 -0
  416. package/workflows/dist/host.d.ts +14 -2
  417. package/workflows/dist/host.js +7 -3
  418. package/workflows/dist/host.js.map +1 -1
  419. package/workflows/dist/import.d.ts +2 -0
  420. package/workflows/dist/import.js +7 -6
  421. package/workflows/dist/import.js.map +1 -1
  422. package/workflows/dist/index.d.ts +6 -5
  423. package/workflows/dist/index.js +4 -3
  424. package/workflows/dist/index.js.map +1 -1
  425. package/workflows/dist/ledger.js +8 -17
  426. package/workflows/dist/ledger.js.map +1 -1
  427. package/workflows/dist/lint.d.ts +2 -2
  428. package/workflows/dist/lint.js +8 -4
  429. package/workflows/dist/lint.js.map +1 -1
  430. package/workflows/dist/load.js +1 -1
  431. package/workflows/dist/load.js.map +1 -1
  432. package/workflows/dist/log.d.ts +0 -2
  433. package/workflows/dist/log.js +0 -11
  434. package/workflows/dist/log.js.map +1 -1
  435. package/workflows/dist/op.d.ts +11 -2
  436. package/workflows/dist/op.js +37 -0
  437. package/workflows/dist/op.js.map +1 -1
  438. package/workflows/dist/page-run.d.ts +48 -0
  439. package/workflows/dist/page-run.js +360 -0
  440. package/workflows/dist/page-run.js.map +1 -0
  441. package/workflows/dist/paths.d.ts +0 -13
  442. package/workflows/dist/paths.js +2 -46
  443. package/workflows/dist/paths.js.map +1 -1
  444. package/workflows/dist/person.d.ts +3 -1
  445. package/workflows/dist/person.js +11 -2
  446. package/workflows/dist/person.js.map +1 -1
  447. package/workflows/dist/resources.d.ts +26 -0
  448. package/workflows/dist/resources.js +83 -1
  449. package/workflows/dist/resources.js.map +1 -1
  450. package/workflows/dist/run.d.ts +4 -1
  451. package/workflows/dist/run.js.map +1 -1
  452. package/workflows/dist/runtime-ops.d.ts +16 -0
  453. package/workflows/dist/runtime-ops.js +30 -1
  454. package/workflows/dist/runtime-ops.js.map +1 -1
  455. package/workflows/dist/sandbox-contract.d.ts +11 -1
  456. package/workflows/dist/sandbox-contract.js +6 -0
  457. package/workflows/dist/sandbox-contract.js.map +1 -1
  458. package/workflows/dist/sandbox-runner.cjs +4 -4
  459. package/workflows/dist/sandbox.d.ts +0 -20
  460. package/workflows/dist/sandbox.js +23 -85
  461. package/workflows/dist/sandbox.js.map +1 -1
  462. package/workflows/dist/scenario.d.ts +19 -1
  463. package/workflows/dist/scenario.js +82 -21
  464. package/workflows/dist/scenario.js.map +1 -1
  465. package/workflows/dist/secret.d.ts +4 -5
  466. package/workflows/dist/secret.js +7 -6
  467. package/workflows/dist/secret.js.map +1 -1
  468. package/workflows/dist/shared.d.ts +124 -9
  469. package/workflows/dist/shared.js +294 -10
  470. package/workflows/dist/shared.js.map +1 -1
  471. package/workflows/dist/sites.d.ts +5 -0
  472. package/workflows/dist/sites.js +20 -2
  473. package/workflows/dist/sites.js.map +1 -1
  474. package/workflows/dist/source.d.ts +40 -1
  475. package/workflows/dist/source.js +3 -3
  476. package/workflows/dist/source.js.map +1 -1
  477. package/workflows/dist/tokens.d.ts +34 -0
  478. package/workflows/dist/tokens.js +70 -9
  479. package/workflows/dist/tokens.js.map +1 -1
  480. package/workflows/dist/vendor-info.js +1 -1
  481. package/workflows/dist/vendor-info.js.map +1 -1
  482. package/workflows/dist/version.js +1 -1
  483. package/workflows/dist/version.js.map +1 -1
  484. package/workflows/dist/wakeup-driver.js +1 -1
  485. package/workflows/dist/wakeup-driver.js.map +1 -1
  486. package/workflows/dist/wakeup-fake.d.ts +27 -0
  487. package/workflows/dist/wakeup-fake.js +125 -0
  488. package/workflows/dist/wakeup-fake.js.map +1 -0
  489. package/workflows/dist/wakeup-service.js +8 -24
  490. package/workflows/dist/wakeup-service.js.map +1 -1
  491. package/workflows/dist/wakeup-type.js +1 -1
  492. package/workflows/dist/wakeup-type.js.map +1 -1
  493. package/workflows/dist/worker.d.ts +8 -0
  494. package/workflows/dist/worker.js +58 -46
  495. package/workflows/dist/worker.js.map +1 -1
  496. package/workflows/drizzle/company/0007_token_handoffs.sql +8 -0
  497. package/workflows/drizzle/company/meta/0007_snapshot.json +1281 -0
  498. package/workflows/drizzle/company/meta/_journal.json +7 -0
  499. package/workflows/src/app-steps.ts +28 -0
  500. package/workflows/src/app-workflows.ts +169 -11
  501. package/workflows/src/approvals.ts +4 -2
  502. package/workflows/src/call.ts +37 -186
  503. package/workflows/src/cedar.ts +48 -11
  504. package/workflows/src/change-steps.ts +44 -15
  505. package/workflows/src/change-workflow.ts +45 -16
  506. package/workflows/src/change.ts +39 -10
  507. package/workflows/src/client.ts +156 -63
  508. package/workflows/src/collection-driver.ts +230 -0
  509. package/workflows/src/collection.ts +62 -186
  510. package/workflows/src/company-file.ts +82 -0
  511. package/workflows/src/config.ts +76 -63
  512. package/workflows/src/ctx.ts +266 -0
  513. package/workflows/src/db/company.ts +14 -0
  514. package/workflows/src/db/dbos.ts +2 -0
  515. package/workflows/src/db.ts +10 -6
  516. package/workflows/src/deadlines.ts +13 -9
  517. package/workflows/src/define.ts +1 -24
  518. package/workflows/src/describe.ts +21 -3
  519. package/workflows/src/description.ts +127 -4
  520. package/workflows/src/drift.ts +8 -4
  521. package/workflows/src/errors.ts +25 -48
  522. package/workflows/src/fake.ts +4 -139
  523. package/workflows/src/fakes.ts +4 -0
  524. package/workflows/src/givens.ts +141 -0
  525. package/workflows/src/host.ts +15 -4
  526. package/workflows/src/import.ts +8 -6
  527. package/workflows/src/index.ts +10 -1
  528. package/workflows/src/ledger.ts +8 -16
  529. package/workflows/src/lint.ts +12 -6
  530. package/workflows/src/load.ts +1 -1
  531. package/workflows/src/log.ts +0 -11
  532. package/workflows/src/op.ts +43 -2
  533. package/workflows/src/page-run.ts +492 -0
  534. package/workflows/src/paths.ts +2 -46
  535. package/workflows/src/person.ts +11 -2
  536. package/workflows/src/resources.ts +91 -0
  537. package/workflows/src/run.ts +4 -1
  538. package/workflows/src/runtime-ops.ts +31 -1
  539. package/workflows/src/sandbox-contract.ts +12 -1
  540. package/workflows/src/sandbox.ts +31 -109
  541. package/workflows/src/scenario.ts +102 -19
  542. package/workflows/src/secret.ts +8 -7
  543. package/workflows/src/shared.ts +353 -13
  544. package/workflows/src/sites.ts +23 -1
  545. package/workflows/src/source.ts +31 -5
  546. package/workflows/src/tokens.ts +100 -9
  547. package/workflows/src/vendor-info.ts +1 -1
  548. package/workflows/src/version.ts +1 -1
  549. package/workflows/src/wakeup-driver.ts +1 -1
  550. package/workflows/src/wakeup-fake.ts +138 -0
  551. package/workflows/src/wakeup-service.ts +8 -24
  552. package/workflows/src/wakeup-type.ts +1 -1
  553. package/workflows/src/worker.ts +99 -53
  554. package/app/dist/client/assets/ArrowDown.es-BOfBLlTP.js +0 -1
  555. package/app/dist/client/assets/_id-CUaJYD_3.js +0 -1
  556. package/app/dist/client/assets/_id-mm7bTIIl.js +0 -2
  557. package/app/dist/client/assets/_name-BOi2qVWk.js +0 -1
  558. package/app/dist/client/assets/_name-CBI1waPs.js +0 -4
  559. package/app/dist/client/assets/_name-TzQfjXo8.js +0 -1
  560. package/app/dist/client/assets/app-chrome-_ahvxx73.js +0 -5
  561. package/app/dist/client/assets/approval-BFFM_yEl.js +0 -1
  562. package/app/dist/client/assets/changes-C_K2tazO.js +0 -1
  563. package/app/dist/client/assets/common-DHOhx6Zn.js +0 -3
  564. package/app/dist/client/assets/composite-9cNA7N0P.js +0 -1
  565. package/app/dist/client/assets/connect-DHUdrwwW.js +0 -1
  566. package/app/dist/client/assets/connections-fGNKJl3J.js +0 -5
  567. package/app/dist/client/assets/credentials-Cb7Lnfxk.js +0 -1
  568. package/app/dist/client/assets/data-DZ-ufRXn.js +0 -1
  569. package/app/dist/client/assets/decidable-OFQBEcco.js +0 -1
  570. package/app/dist/client/assets/held-card-HrJ6QpRY.js +0 -1
  571. package/app/dist/client/assets/hosting-Beoi95m6.js +0 -1
  572. package/app/dist/client/assets/import-8WDFPfe6.js +0 -1
  573. package/app/dist/client/assets/inbox-B9hsZPsC.js +0 -1
  574. package/app/dist/client/assets/inbox-DM2npRZI.js +0 -1
  575. package/app/dist/client/assets/index-CHKfukjt.js +0 -10
  576. package/app/dist/client/assets/kit-n8CE0xEs.js +0 -1
  577. package/app/dist/client/assets/lazyRouteComponent-DezoGNoN.js +0 -1
  578. package/app/dist/client/assets/mermaid-WFAXDIZX-DQBKIf0O.js +0 -1
  579. package/app/dist/client/assets/people-BiiQfYJ8.js +0 -1
  580. package/app/dist/client/assets/runs-table-DMiD4HeY.js +0 -1
  581. package/app/dist/client/assets/sites.index-K4mrFsLr.js +0 -1
  582. package/app/dist/client/assets/start-form-CJ6VmNPY.js +0 -1
  583. package/app/dist/client/assets/style-CTcG_5y0.css +0 -2
  584. package/app/dist/client/assets/useLoaderData-BsksXf-p.js +0 -1
  585. package/app/dist/client/assets/who-are-you-DUoVqvfP.js +0 -1
  586. package/app/dist/client/assets/workflow-lQtyyxKx.js +0 -1
  587. package/app/dist/client/assets/workflow-view-hk_RU9WF.js +0 -1
  588. package/app/dist/server/assets/names-B04Si-sV.js +0 -9
  589. package/app/dist/server/assets/sites.index-4TK8c0QC.js +0 -138
  590. package/template/scenarios/publish-post/publish.feature +0 -28
  591. package/template/workflows/publish-post.ts +0 -20
package/README.md CHANGED
@@ -5,11 +5,11 @@ One command over a company repo: `sanoma` runs its workflows and the app, `sanom
5
5
  ## Start a company
6
6
 
7
7
  ```sh
8
- mkdir acme && cd acme
9
- npx sanoma
8
+ mkdir maple-street && cd maple-street
9
+ npx sanoma init --name "Maple Street Studio" --you "Dana Reyes" --email dana@maplestreet.studio
10
10
  ```
11
11
 
12
- In an empty directory (dotfiles aside), `sanoma` starts a company there, then runs it: it copies the template this package ships (`template/`: `sanoma.config.ts` with the Ghost connector and the Anthropic one, the model the app's chat answers on, a `publish-post` workflow with its scenarios, `policies/policy.cedar` and `policies/changes.cedar` (every change waits for `admin`), `resources/people.ts` with you as its first person (your GitHub login as `gh` is signed in, else this machine's user name, named as git's `user.name`, with git's `user.email` as the email a host's sign-in sends codes to), an empty `resources/` tree, `AGENTS.md`, `.env.example`), names the package after the directory, 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.
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.
13
13
 
14
14
  ## Install
15
15
 
@@ -36,7 +36,7 @@ import { defineConfig } from "sanoma";
36
36
  export default defineConfig({ connectors: [ghost] });
37
37
  ```
38
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 app's name is `package.json`'s `name`, 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.
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
40
 
41
41
  ```ts
42
42
  // workflows/publish.ts
@@ -109,15 +109,17 @@ Only a declared person signs in to the app (on this machine by picking their nam
109
109
 
110
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.
111
111
 
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 `<appName> running <workflows>` and `<appName> at http://127.0.0.1:3000; ctrl-c to stop`; 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 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. |
116
- | `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`. |
117
- | `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. |
118
- | `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. |
119
- | `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`. |
120
- | `sanoma --help` | The usage. |
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. |
121
123
 
122
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.
123
125
 
@@ -128,6 +130,7 @@ A parent process, such as a desktop shell, runs `sanoma` with `SANOMA_EVENTS=1`
128
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.
129
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.
130
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.
131
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.
132
135
 
133
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.
@@ -172,8 +175,40 @@ A folder under `sites/` with a `routes/` directory is a site: TanStack Router fi
172
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.
173
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.
174
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`.
175
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.
176
180
 
181
+ ### Demos
182
+
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.
211
+
177
212
  ### Developing a site
178
213
 
179
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:
@@ -186,6 +221,10 @@ A folder under `sites/` with a `routes/` directory is a site: TanStack Router fi
186
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.
187
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.
188
223
 
224
+ ## Invoices
225
+
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).
227
+
189
228
  ## Generated files
190
229
 
191
230
  | File | Written by | Commit it |
@@ -218,7 +257,7 @@ A company uses one through the runtime's own wakeup, `sanoma.wakeup({ host })` (
218
257
 
219
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.
220
259
 
221
- `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, 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.
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.
222
261
 
223
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).
224
263
 
@@ -244,4 +283,8 @@ To try the SSH path by hand, without registering a key: `docker run --rm -e SANO
244
283
 
245
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).
246
285
 
286
+ ### The box image
287
+
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
+
247
290
  Status: early (0.x). License: FSL-1.1-ALv2.