sanoma 0.11.21 → 0.11.23
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.
- package/README.md +55 -14
- package/app/README.md +12 -8
- package/app/dist/api.d.ts +191 -5
- package/app/dist/api.js +125 -4
- package/app/dist/api.js.map +1 -1
- package/app/dist/build.d.ts +28 -3
- package/app/dist/build.js +154 -15
- package/app/dist/build.js.map +1 -1
- package/app/dist/bundle-build.d.ts +32 -0
- package/app/dist/bundle-build.js +127 -67
- package/app/dist/bundle-build.js.map +1 -1
- package/app/dist/client/assets/ArrowDown.es-BVRf--PS.js +1 -0
- package/app/dist/client/assets/CaretDown.es-D12mWb2j.js +1 -0
- package/app/dist/client/assets/CatchBoundary-Cb__yx-s.js +1 -0
- package/app/dist/client/assets/Check.es-b7BdqO2s.js +1 -0
- package/app/dist/client/assets/CheckCircle.es-DKXiWmAT.js +1 -0
- package/app/dist/client/assets/Copy.es-CvUujKw7.js +1 -0
- package/app/dist/client/assets/DialogTitle-5oboyLiq.js +1 -0
- package/app/dist/client/assets/FloppyDisk.es-CDyDob8p.js +1 -0
- package/app/dist/client/assets/Globe.es-C1pgZCGM.js +1 -0
- package/app/dist/client/assets/MagnifyingGlass.es-CZ3i6pz0.js +1 -0
- package/app/dist/client/assets/Play.es-DGJ1CGhp.js +1 -0
- package/app/dist/client/assets/Plug.es-BPhGL8MK.js +1 -0
- package/app/dist/client/assets/Plus.es-i3Vaa2WW.js +1 -0
- package/app/dist/client/assets/Separator-Cu9cQDBN.js +1 -0
- package/app/dist/client/assets/X.es-B7rq0E_-.js +1 -0
- package/app/dist/client/assets/_id-0_Y-lz6G.js +1 -0
- package/app/dist/client/assets/_id-3tGIwJ5T.js +1 -0
- package/app/dist/client/assets/_id-CgPVeQe8.js +1 -0
- package/app/dist/client/assets/_id-DFlFuBDE.js +1 -0
- package/app/dist/client/assets/_id-QNnNLGx_.js +1 -0
- package/app/dist/client/assets/_name-6k1yqjX8.js +1 -0
- package/app/dist/client/assets/_name-B4Qba2-o.js +4 -0
- package/app/dist/client/assets/_name-BfPXcP49.js +1 -0
- package/app/dist/client/assets/_name-CqBzHz7c.js +1 -0
- package/app/dist/client/assets/_vendor-CfHRJBG8.js +1 -0
- package/app/dist/client/assets/_vendor-Dj7KCZ74.js +1 -0
- package/app/dist/client/assets/app-chrome-CFH47gLL.js +5 -0
- package/app/dist/client/assets/app-scope-Z_2GE9oz.js +1 -0
- package/app/dist/client/assets/approval-CgksyU5L.js +1 -0
- package/app/dist/client/assets/apps-BDsPVmMY.js +1 -0
- package/app/dist/client/assets/button-D5kdANef.js +1 -0
- package/app/dist/client/assets/change-glance-D6N6Xaqu.js +1 -0
- package/app/dist/client/assets/changes-B6xxBiC0.js +1 -0
- package/app/dist/client/assets/changes-BS7eJI5T.js +1 -0
- package/app/dist/client/assets/chat-Bw3WhRE9.js +14 -0
- package/app/dist/client/assets/chat-button-DNusaP5n.js +1 -0
- package/app/dist/client/assets/chat-prompt-z0XJPDtH.js +1 -0
- package/app/dist/client/assets/{code-BVYaiQEr.js → code-CT4-YDKq.js} +2 -2
- package/app/dist/client/assets/common-DZLdx_jS.js +3 -0
- package/app/dist/client/assets/composite-CoGyvQjv.js +1 -0
- package/app/dist/client/assets/connect-BMk-KP-f.js +1 -0
- package/app/dist/client/assets/connections-TbS_jeiy.js +5 -0
- package/app/dist/client/assets/connectors-CgRpyRdd.js +1 -0
- package/app/dist/client/assets/credentials-Dxpl8sUw.js +1 -0
- package/app/dist/client/assets/css-BGIxQoYs.js +1 -0
- package/app/dist/client/assets/css-DgaLhXQH.js +1 -0
- package/app/dist/client/assets/data-lKkklNeo.js +1 -0
- package/app/dist/client/assets/decidable-w2VGgZwN.js +1 -0
- package/app/dist/client/assets/declaration-form-CAwox7F1.js +1 -0
- package/app/dist/client/assets/dialog-DDAfDsGh.js +1 -0
- package/app/dist/client/assets/diff-woXpYk--.js +1 -0
- package/app/dist/client/assets/engine-CBuzy-Ik.js +1 -0
- package/app/dist/client/assets/existing-2kDivy4p.js +1 -0
- package/app/dist/client/assets/fence-BdtS5gi0.js +157 -0
- package/app/dist/client/assets/github-dark-C-LZuMrd.js +1 -0
- package/app/dist/client/assets/github-light-EUqPIrTm.js +1 -0
- package/app/dist/client/assets/graph-BqVQ68hK.js +7 -0
- package/app/dist/client/assets/grid-diff-Jj1nTy52.js +1 -0
- package/app/dist/client/assets/held-card-DjBO8PTe.js +1 -0
- package/app/dist/client/assets/highlighted-body-JLMTFACH-Co7ss_Ht.js +1 -0
- package/app/dist/client/assets/hosting-DC7Pftfb.js +1 -0
- package/app/dist/client/assets/html-BHZv6uqE.js +1 -0
- package/app/dist/client/assets/import-DhVQArmJ.js +1 -0
- package/app/dist/client/assets/inbox-5h39e_tI.js +1 -0
- package/app/dist/client/assets/inbox-CUNaP4uz.js +1 -0
- package/app/dist/client/assets/index-CA_5CFb4.js +10 -0
- package/app/dist/client/assets/item-vV00RYfb.js +1 -0
- package/app/dist/client/assets/javascript-BzbQS41l.js +1 -0
- package/app/dist/client/assets/javascript-CpIGwZ_Y.js +1 -0
- package/app/dist/client/assets/json-qhed-kSA.js +1 -0
- package/app/dist/client/assets/jsx-Bz0zcwM4.js +1 -0
- package/app/dist/client/assets/kit-BZcdh1Xm.js +1 -0
- package/app/dist/client/assets/lazyRouteComponent-C2a8bGcK.js +1 -0
- package/app/dist/client/assets/markdown-BYOwaDjH.js +1 -0
- package/app/dist/client/assets/markdown-bsqylRZb.js +164 -0
- package/app/dist/client/assets/mermaid-WFAXDIZX-CYMnek4e.js +1 -0
- package/app/dist/client/assets/motion-D6e1hqz4.js +1 -0
- package/app/dist/client/assets/people-Bn8GAJ3z.js +1 -0
- package/app/dist/client/assets/permissions-Csf87P7b.js +2 -0
- package/app/dist/client/assets/permissions-grid-CzK64E29.js +1 -0
- package/app/dist/client/assets/preload-helper-BLdHbfdN.js +1 -0
- package/app/dist/client/assets/python-gzcpVVnB.js +1 -0
- package/app/dist/client/assets/queries-XJ-fmuYb.js +57 -0
- package/app/dist/client/assets/react-dom-D6fTz1bt.js +1 -0
- package/app/dist/client/assets/review-BjpH-tT4.js +1 -0
- package/app/dist/client/assets/route-CD2oErox.js +1 -0
- package/app/dist/client/assets/route-CRwDZE-c.js +1 -0
- package/app/dist/client/assets/routes-gbZbqIhO.js +1 -0
- package/app/dist/client/assets/runs-table-nkQLXJxG.js +1 -0
- package/app/dist/client/assets/scenario-CZ7tmap7.js +1 -0
- package/app/dist/client/assets/scenario-graph-W2XcWuur.js +1 -0
- package/app/dist/client/assets/separator-Bdtc7rou.js +1 -0
- package/app/dist/client/assets/{sheet-BYL9XU5s.js → sheet-P-hJsTeq.js} +1 -1
- package/app/dist/client/assets/shellscript-CLZ0U2zV.js +1 -0
- package/app/dist/client/assets/site-icon-1Mcc1UIb.js +1 -0
- package/app/dist/client/assets/sites.index-CXcRF_R0.js +1 -0
- package/app/dist/client/assets/spinner-XaRXIj9W.js +1 -0
- package/app/dist/client/assets/sql-CEbI0hMM.js +1 -0
- package/app/dist/client/assets/start-form-6whPfUoW.js +1 -0
- package/app/dist/client/assets/store-BT988jIX.js +1 -0
- package/app/dist/client/assets/style-DaqPHcI1.css +2 -0
- package/app/dist/client/assets/table-B81tv0LG.js +1 -0
- package/app/dist/client/assets/textarea-CRpYU-qx.js +1 -0
- package/app/dist/client/assets/tsx-udAQXfEw.js +1 -0
- package/app/dist/client/assets/typescript-bsJCZSQ-.js +1 -0
- package/app/dist/client/assets/useLoaderData-BIegJC9y.js +1 -0
- package/app/dist/client/assets/useOpenInteractionType-UhakpAXY.js +1 -0
- package/app/dist/client/assets/useRegisterFieldControl-CT8iqvDE.js +1 -0
- package/app/dist/client/assets/useValueChanged-DBqn456b.js +1 -0
- package/app/dist/client/assets/utils-BRvE9-Fo.js +1 -0
- package/app/dist/client/assets/who-are-you-_7OehU_o.js +1 -0
- package/app/dist/client/assets/workflow-DSNK0oFo.js +1 -0
- package/app/dist/client/assets/workflow-view-VFD3onJL.js +1 -0
- package/app/dist/client/assets/workflows-CT9wqMl2.js +1 -0
- package/app/dist/client/assets/yaml-rwi0_p6S.js +1 -0
- package/app/dist/components/grid/plan.d.ts +46 -262
- package/app/dist/components/grid/plan.js +134 -138
- package/app/dist/components/grid/plan.js.map +1 -1
- package/app/dist/demo-build.d.ts +58 -0
- package/app/dist/demo-build.js +440 -0
- package/app/dist/demo-build.js.map +1 -0
- package/app/dist/handler.d.ts +9 -7
- package/app/dist/handler.js +10 -10
- package/app/dist/handler.js.map +1 -1
- package/app/dist/index.d.ts +4 -4
- package/app/dist/index.js +52 -35
- package/app/dist/index.js.map +1 -1
- package/app/dist/lib/chat.d.ts +67 -20
- package/app/dist/lib/chat.js +54 -18
- package/app/dist/lib/chat.js.map +1 -1
- package/app/dist/lib/names.d.ts +7 -0
- package/app/dist/lib/names.js +6 -2
- package/app/dist/lib/names.js.map +1 -1
- package/app/dist/login/page.d.ts +1 -10
- package/app/dist/login/page.js +0 -14
- package/app/dist/login/page.js.map +1 -1
- package/app/dist/login/staff.js +3 -3
- package/app/dist/login/staff.js.map +1 -1
- package/app/dist/server/assets/{_id-wuJIq2ZZ.js → _id-B6iAc90c.js} +2 -2
- package/app/dist/server/assets/{_id-Dt9tTylX.js → _id-BlceO2iK.js} +3 -3
- package/app/dist/server/assets/{_id-wB8khGTz.js → _id-Cc0uBuJb.js} +12 -7
- package/app/dist/server/assets/{_id-ce1EGp7Y.js → _id-DYfvgveB.js} +2 -2
- package/app/dist/server/assets/{_id-BViXAagq.js → _id-Dvn0wB-1.js} +15 -330
- package/app/dist/server/assets/{_name-BGagGBjX.js → _name-3AGcE6tj.js} +7 -7
- package/app/dist/server/assets/{_name-DntbHE-b.js → _name-BIcmcEwj.js} +11 -11
- package/app/dist/server/assets/{_name-BqFwnyf7.js → _name-CfoydEzk.js} +2 -2
- package/app/dist/server/assets/{_name-D_-MhjNf.js → _name-VpcPszKf.js} +210 -63
- package/app/dist/server/assets/{_tanstack-start-manifest_v-BljuBM-G.js → _tanstack-start-manifest_v-DUL7FcJk.js} +119 -91
- package/app/dist/server/assets/{_vendor-CcEviOki.js → _vendor-Bwis2sPx.js} +2 -2
- package/app/dist/server/assets/{_vendor-CNB03LWX.js → _vendor-DUtH-Z9W.js} +8 -8
- package/app/dist/server/assets/{actor-D6iA0pDg.js → actor-DAOPjcdj.js} +1 -1
- package/app/dist/server/assets/app-chrome-B8oA4uXZ.js +2298 -0
- package/app/dist/server/assets/{app-scope-CXIgOFmi.js → app-scope-BxuIu0xV.js} +2 -2
- package/app/dist/server/assets/{apply-plan-ybBda6vQ.js → apply-plan-CHJ_Hr71.js} +8 -7
- package/app/dist/server/assets/{approval-Su315ikC.js → approval-DR_9mBcx.js} +17 -14
- package/app/dist/server/assets/{apps-xwQAehch.js → apps-CtPev5RI.js} +7 -7
- package/app/dist/server/assets/button-Xwx3rpQ0.js +43 -0
- package/app/dist/server/assets/change-glance-DGqh7Pxb.js +54 -0
- package/app/dist/server/assets/{change-glance-CpArIbGS.js → changes-C3qjEBZP.js} +2 -54
- package/app/dist/server/assets/{changes-Bc_OiDBD.js → changes-DfOnO87K.js} +8 -7
- package/app/dist/server/assets/{chat-DMN_hoKm.js → chat-B19X0_8f.js} +133 -34
- package/app/dist/server/assets/{chat-button-LtA80MoR.js → chat-button-SluTWK8R.js} +2 -2
- package/app/dist/server/assets/{code-COyt8L-n.js → code-hVpCkmAZ.js} +1 -1
- package/app/dist/server/assets/{common-CWHLj7KV.js → common-JUUJLp4v.js} +30 -82
- package/app/dist/server/assets/{connect-BpPiu5s6.js → connect-DKu1UgY-.js} +11 -10
- package/app/dist/server/assets/{connections-DBgb1bvX.js → connections-Dyedl4qi.js} +12 -11
- package/app/dist/server/assets/{connectors-5a5_SlHO.js → connectors-yojQH7WS.js} +8 -8
- package/app/dist/server/assets/{credentials-ud_Y68hx.js → credentials-2Z6EHitQ.js} +10 -9
- package/app/dist/server/assets/{data-aEdhwcqy.js → data-1padc_i_.js} +7 -7
- package/app/dist/server/assets/{declaration-form-Dfg1yNuY.js → declaration-form-MAnn_M8g.js} +7 -6
- package/app/dist/server/assets/{dialog-BGjiw3Dx.js → dialog-T0bzlKzs.js} +2 -2
- package/app/dist/server/assets/{dropdown-menu-DAC3LWas.js → dropdown-menu-RGvPORm4.js} +1 -1
- package/app/dist/server/assets/{existing-B4d4NrC8.js → existing-BZjX_7Aa.js} +8 -7
- package/app/dist/server/assets/fence-BvNu3YNO.js +130 -0
- package/app/dist/server/assets/{field-C0Xx_90s.js → field-DFpkT1id.js} +1 -1
- package/app/dist/server/assets/{functions-BvFYzabD.js → functions-wlvFaDkF.js} +246 -44
- package/app/dist/server/assets/{graph-qYOdoz2s.js → graph-DjANDk1P.js} +5 -5
- package/app/dist/server/assets/{grid-diff-jTvp-8wS.js → grid-diff-D5bQDKl2.js} +1 -1
- package/app/dist/server/assets/held-card-CCEypEau.js +75 -0
- package/app/dist/server/assets/{hosting-bbn9UvDc.js → hosting-Csr6AVC7.js} +321 -42
- package/app/dist/server/assets/{import-DIwvzHb6.js → import-CtPlwdIl.js} +12 -10
- package/app/dist/server/assets/{inbox-Dj-5FleF.js → inbox-9-WMgjdU.js} +2 -2
- package/app/dist/server/assets/{inbox-D6R6sWBB.js → inbox-BYKHV9Yh.js} +8 -8
- package/app/dist/server/assets/{input-D63gF3G2.js → input-CF-vX8Xp.js} +1 -1
- package/app/dist/server/assets/{item-BDSXoEr_.js → item-LBDNja5f.js} +1 -1
- package/app/dist/server/assets/{kit-D6EulwBe.js → kit-D5moAfcg.js} +57 -4
- package/app/dist/server/assets/markdown-B9odAiMy.js +116 -0
- package/app/dist/server/assets/{middleware-B8JRLyxx.js → middleware-C4Wn6uHO.js} +325 -285
- package/app/dist/server/assets/{native-select-DLa-He0n.js → native-select-etaMvR-i.js} +2 -9
- package/app/dist/server/assets/{people-CkU_AxrV.js → people-LpcYXtEq.js} +13 -12
- package/app/dist/server/assets/{permissions-BfMcQqQb.js → permissions-M0kzvVVm.js} +9 -8
- package/app/dist/server/assets/{permissions-grid-DWP9FAAS.js → permissions-grid-CwWWdcQA.js} +4 -4
- package/app/dist/server/assets/{button-f9Lc8qLl.js → queries-BDuQsTdU.js} +141 -59
- package/app/dist/server/assets/review-BFZCPdVZ.js +355 -0
- package/app/dist/server/assets/{route-CF_8jQYY.js → route-BJLQf4ik.js} +2 -2
- package/app/dist/server/assets/{route-BTT7nMJq.js → route-C3uFABee.js} +2 -2
- package/app/dist/server/assets/{router-BvYtxrVN.js → router-Dx7Gu0CN.js} +175 -147
- package/app/dist/server/assets/routes-iVrnGFaR.js +227 -0
- package/app/dist/server/assets/{runs-table-BBudn12Y.js → runs-table-g3QYggO3.js} +6 -6
- package/app/dist/server/assets/{scenario-BXGTSTiP.js → scenario-B5dGlEGF.js} +5 -5
- package/app/dist/server/assets/{separator-8MZ7vR3f.js → separator-Cf98V8ie.js} +1 -1
- package/app/dist/server/assets/{sheet-5Cyp-4UW.js → sheet-DTOG7OHQ.js} +2 -2
- package/app/dist/server/assets/sites.index-BNeYUQnQ.js +165 -0
- package/app/dist/server/assets/{spinner-C1ZW08lp.js → spinner-016IPVi-.js} +1 -1
- package/app/dist/server/assets/{start-CSU4irVK.js → start-CIKqNkKp.js} +2 -2
- package/app/dist/server/assets/{start-form-DI60UOrc.js → start-form-BXAi2lVm.js} +10 -9
- package/app/dist/server/assets/{table-DtPk_h_5.js → table-y-dGlLx6.js} +1 -1
- package/app/dist/server/assets/{textarea-f0Ip5ed1.js → textarea-B02joDnr.js} +1 -1
- package/app/dist/server/assets/utils-CHesvfjo.js +138 -0
- package/app/dist/server/assets/{who-are-you-ZGyMnpVi.js → who-are-you-CavnVMGe.js} +16 -10
- package/app/dist/server/assets/{workflow-Z99QWO42.js → workflow-BXhqp6S1.js} +5 -5
- package/app/dist/server/assets/{workflow-view-C8X8U11S.js → workflow-view-go1rbTSF.js} +14 -13
- package/app/dist/server/assets/{workflows-C0kJoGf1.js → workflows-BCcXZtN-.js} +14 -14
- package/app/dist/server/chat.d.ts +6 -1
- package/app/dist/server/chat.js +39 -20
- package/app/dist/server/chat.js.map +1 -1
- package/app/dist/server/core.d.ts +24 -9
- package/app/dist/server/core.js +58 -119
- package/app/dist/server/core.js.map +1 -1
- package/app/dist/server/go-live.d.ts +11 -2
- package/app/dist/server/go-live.js +27 -27
- package/app/dist/server/go-live.js.map +1 -1
- package/app/dist/server/server.js +68 -48
- package/app/dist/server/setup.js +1 -1
- package/app/dist/server/setup.js.map +1 -1
- package/app/dist/server/token-redeem.d.ts +8 -0
- package/app/dist/server/token-redeem.js +45 -0
- package/app/dist/server/token-redeem.js.map +1 -0
- package/app/dist/site-path.d.ts +15 -0
- package/app/dist/site-path.js +26 -0
- package/app/dist/site-path.js.map +1 -1
- package/app/dist/snapshot-build.js +1 -0
- package/app/dist/snapshot-build.js.map +1 -1
- package/app/dist/steps/agent/acp.d.ts +3 -97
- package/app/dist/steps/agent/acp.js +19 -49
- package/app/dist/steps/agent/acp.js.map +1 -1
- package/app/dist/steps/agent/checkout.d.ts +18 -1
- package/app/dist/steps/agent/checkout.js +17 -0
- package/app/dist/steps/agent/checkout.js.map +1 -1
- package/app/dist/steps/agent/harness.d.ts +2 -4
- package/app/dist/steps/agent/harness.js +45 -61
- package/app/dist/steps/agent/harness.js.map +1 -1
- package/app/dist/steps/agent/prompt.d.ts +1 -1
- package/app/dist/steps/agent/prompt.js +37 -16
- package/app/dist/steps/agent/prompt.js.map +1 -1
- package/app/dist/steps/agent/transcript.d.ts +10 -1
- package/app/dist/steps/agent/transcript.js +75 -2
- package/app/dist/steps/agent/transcript.js.map +1 -1
- package/app/dist/steps/agent/turn.d.ts +4 -6
- package/app/dist/steps/agent/turn.js +14 -16
- package/app/dist/steps/agent/turn.js.map +1 -1
- package/app/dist/steps/index.js +2 -2
- package/app/dist/steps/index.js.map +1 -1
- package/app/dist/steps/writes.d.ts +21 -7
- package/app/dist/steps/writes.js +100 -23
- package/app/dist/steps/writes.js.map +1 -1
- package/app/dist/stylesheet.json +1 -1
- package/app/src/api.ts +188 -4
- package/app/src/build.ts +177 -14
- package/app/src/bundle-build.ts +132 -63
- package/app/src/components/app-chrome.tsx +28 -13
- package/app/src/components/approval.tsx +1 -1
- package/app/src/components/common.tsx +18 -88
- package/app/src/components/data-grid.tsx +2 -1
- package/app/src/components/go-live-cloud.tsx +44 -0
- package/app/src/components/go-live.tsx +51 -13
- package/app/src/components/grid/columns.tsx +175 -53
- package/app/src/components/grid/grid.tsx +4 -2
- package/app/src/components/grid/plan.ts +153 -164
- package/app/src/components/grid/review.tsx +108 -118
- package/app/src/components/home.tsx +199 -0
- package/app/src/components/import/match.tsx +2 -1
- package/app/src/components/import/sheet.ts +2 -1
- package/app/src/components/kit.tsx +55 -1
- package/app/src/components/logo.tsx +25 -0
- package/app/src/components/record-form.tsx +12 -5
- package/app/src/components/shell/bar.tsx +35 -26
- package/app/src/components/shell/chat-parts.tsx +185 -126
- package/app/src/components/shell/chat-prompt.ts +6 -2
- package/app/src/components/shell/chat.tsx +154 -220
- package/app/src/components/shell/composer.tsx +140 -0
- package/app/src/components/shell/connect-agent.tsx +157 -0
- package/app/src/components/shell/draft-card.tsx +192 -45
- package/app/src/components/shell/engine-mark.tsx +9 -0
- package/app/src/components/shell/fence.tsx +25 -0
- package/app/src/components/shell/held-card.tsx +58 -0
- package/app/src/components/shell/markdown.tsx +152 -0
- package/app/src/components/shell/nav-user.tsx +11 -1
- package/app/src/components/shell/prefs.ts +12 -1
- package/app/src/components/shell/thread.tsx +174 -0
- package/app/src/components/store-move.tsx +2 -1
- package/app/src/components/ui/bubble.tsx +117 -0
- package/app/src/components/ui/code-block.tsx +235 -0
- package/app/src/components/ui/input-group.tsx +136 -0
- package/app/src/components/ui/marker.tsx +67 -0
- package/app/src/components/ui/message-scroller.tsx +117 -0
- package/app/src/components/ui/message.tsx +74 -0
- package/app/src/components/ui/radio-group.tsx +26 -0
- package/app/src/components/ui/trace.tsx +133 -0
- package/app/src/components/who-are-you.tsx +8 -3
- package/app/src/demo/api.ts +42 -0
- package/app/src/demo/client-rpc.ts +16 -0
- package/app/src/demo/demo.css +31 -0
- package/app/src/demo/mount.tsx +97 -0
- package/app/src/demo/root.tsx +31 -0
- package/app/src/demo/tailwind.css +4 -0
- package/app/src/demo-build.ts +525 -0
- package/app/src/env.d.ts +12 -0
- package/app/src/functions.ts +50 -7
- package/app/src/handler.ts +20 -14
- package/app/src/hooks/use-highlighted-code.ts +72 -0
- package/app/src/index.ts +55 -36
- package/app/src/lib/chat.ts +113 -23
- package/app/src/lib/cn-tables.ts +23 -23
- package/app/src/lib/company-state.ts +73 -0
- package/app/src/lib/highlighter.tsx +114 -0
- package/app/src/lib/names.ts +13 -2
- package/app/src/login/page.ts +1 -21
- package/app/src/login/staff.ts +3 -3
- package/app/src/queries.ts +121 -18
- package/app/src/routes/__root.tsx +24 -7
- package/app/src/routes/changes/$id.tsx +4 -3
- package/app/src/routes/connectors/index.tsx +1 -1
- package/app/src/routes/data/$name/import.tsx +2 -1
- package/app/src/routes/data/$name/index.tsx +1 -2
- package/app/src/routes/hosting/index.tsx +277 -60
- package/app/src/routes/index.tsx +15 -4
- package/app/src/routes/sites.index.tsx +41 -3
- package/app/src/routes/workflows/$name/runs/$id.tsx +3 -1
- package/app/src/server/chat.ts +41 -19
- package/app/src/server/columns.ts +44 -18
- package/app/src/server/company-state.ts +76 -0
- package/app/src/server/core.ts +72 -116
- package/app/src/server/go-live.ts +35 -27
- package/app/src/server/setup-progress.ts +28 -0
- package/app/src/server/setup.ts +1 -1
- package/app/src/server/token-redeem.ts +49 -0
- package/app/src/site-api.ts +10 -0
- package/app/src/site-path.ts +29 -0
- package/app/src/site.ts +1 -1
- package/app/src/snapshot-build.ts +1 -0
- package/app/src/steps/agent/acp.ts +10 -80
- package/app/src/steps/agent/checkout.ts +30 -0
- package/app/src/steps/agent/harness.ts +53 -78
- package/app/src/steps/agent/prompt.ts +45 -17
- package/app/src/steps/agent/transcript.ts +90 -3
- package/app/src/steps/agent/turn.ts +18 -16
- package/app/src/steps/index.ts +2 -2
- package/app/src/steps/writes.ts +121 -31
- package/app/src/worker/app.ts +17 -14
- package/dist/check.js +2 -2
- package/dist/check.js.map +1 -1
- package/dist/cli.js +81 -22
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +8 -1
- package/dist/config.js +49 -8
- package/dist/config.js.map +1 -1
- package/dist/events.d.ts +15 -1
- package/dist/events.js +7 -0
- package/dist/events.js.map +1 -1
- package/dist/init.d.ts +27 -14
- package/dist/init.js +87 -39
- package/dist/init.js.map +1 -1
- package/dist/serve.d.ts +6 -2
- package/dist/serve.js +71 -9
- package/dist/serve.js.map +1 -1
- package/dist/source.d.ts +5 -0
- package/dist/source.js +113 -23
- package/dist/source.js.map +1 -1
- package/dist/worker-port.d.ts +16 -2
- package/dist/worker-port.js +44 -5
- package/dist/worker-port.js.map +1 -1
- package/invoices/README.md +66 -0
- package/invoices/dist/calculate.d.ts +37 -0
- package/invoices/dist/calculate.js +97 -0
- package/invoices/dist/calculate.js.map +1 -0
- package/invoices/dist/index.d.ts +4 -0
- package/invoices/dist/index.js +5 -0
- package/invoices/dist/index.js.map +1 -0
- package/invoices/dist/logo.d.ts +2 -0
- package/invoices/dist/logo.js +89 -0
- package/invoices/dist/logo.js.map +1 -0
- package/invoices/dist/pdf.d.ts +33 -0
- package/invoices/dist/pdf.js +215 -0
- package/invoices/dist/pdf.js.map +1 -0
- package/invoices/dist/schema.d.ts +156 -0
- package/invoices/dist/schema.js +88 -0
- package/invoices/dist/schema.js.map +1 -0
- package/oxlint.json +18 -0
- package/package.json +42 -7
- package/template/.env.example +15 -4
- package/template/AGENTS.md +10 -6
- package/template/package.json +6 -1
- package/template/policies/policy.cedar +5 -5
- package/template/resources/people.ts +5 -13
- package/template/resources/sanoma/infra.ts +8 -0
- package/template/sanoma.config.ts +18 -11
- package/template/scenarios/record-lead/record.feature +14 -0
- package/template/secrets.ts +13 -0
- package/template/tsconfig.json +1 -0
- package/template/workflows/record-lead.ts +30 -0
- package/testing/README.md +4 -4
- package/testing/dist/build.d.ts +3 -3
- package/testing/dist/build.js +4 -4
- package/testing/dist/build.js.map +1 -1
- package/testing/dist/host.d.ts +38 -21
- package/testing/dist/host.js +159 -77
- package/testing/dist/host.js.map +1 -1
- package/testing/dist/scenarios.d.ts +2 -1
- package/testing/dist/scenarios.js +14 -4
- package/testing/dist/scenarios.js.map +1 -1
- package/workflows/CLOUD-IDENTITY.md +15 -20
- package/workflows/README.md +54 -19
- package/workflows/dist/app-steps.js +8 -0
- package/workflows/dist/app-steps.js.map +1 -1
- package/workflows/dist/app-workflows.d.ts +172 -6
- package/workflows/dist/app-workflows.js +57 -9
- package/workflows/dist/app-workflows.js.map +1 -1
- package/workflows/dist/approvals.d.ts +3 -1
- package/workflows/dist/approvals.js +3 -1
- package/workflows/dist/approvals.js.map +1 -1
- package/workflows/dist/call.d.ts +8 -40
- package/workflows/dist/call.js +24 -135
- package/workflows/dist/call.js.map +1 -1
- package/workflows/dist/change-steps.d.ts +7 -0
- package/workflows/dist/change-steps.js +37 -13
- package/workflows/dist/change-steps.js.map +1 -1
- package/workflows/dist/change-workflow.d.ts +22 -10
- package/workflows/dist/change-workflow.js +30 -12
- package/workflows/dist/change-workflow.js.map +1 -1
- package/workflows/dist/change.d.ts +233 -7
- package/workflows/dist/change.js +27 -9
- package/workflows/dist/change.js.map +1 -1
- package/workflows/dist/client.d.ts +32 -5
- package/workflows/dist/client.js +94 -35
- package/workflows/dist/client.js.map +1 -1
- package/workflows/dist/cloud-identity.d.ts +5 -2
- package/workflows/dist/cloud-identity.js +7 -4
- package/workflows/dist/cloud-identity.js.map +1 -1
- package/workflows/dist/collection-driver.d.ts +20 -0
- package/workflows/dist/collection-driver.js +201 -0
- package/workflows/dist/collection-driver.js.map +1 -0
- package/workflows/dist/collection.d.ts +126 -14
- package/workflows/dist/collection.js +45 -168
- package/workflows/dist/collection.js.map +1 -1
- package/workflows/dist/company-file.d.ts +22 -0
- package/workflows/dist/company-file.js +82 -0
- package/workflows/dist/company-file.js.map +1 -0
- package/workflows/dist/config.d.ts +34 -6
- package/workflows/dist/config.js +58 -45
- package/workflows/dist/config.js.map +1 -1
- package/workflows/dist/ctx.d.ts +101 -0
- package/workflows/dist/ctx.js +171 -0
- package/workflows/dist/ctx.js.map +1 -0
- package/workflows/dist/db/company.d.ts +115 -1
- package/workflows/dist/db/company.js +14 -1
- package/workflows/dist/db/company.js.map +1 -1
- package/workflows/dist/db/dbos.d.ts +17 -0
- package/workflows/dist/db/dbos.js +2 -0
- package/workflows/dist/db/dbos.js.map +1 -1
- package/workflows/dist/db/identity.d.ts +2 -2
- package/workflows/dist/db/identity.js +2 -2
- package/workflows/dist/db/identity.js.map +1 -1
- package/workflows/dist/db.d.ts +1 -1
- package/workflows/dist/db.js +10 -6
- package/workflows/dist/db.js.map +1 -1
- package/workflows/dist/deadlines.d.ts +14 -8
- package/workflows/dist/deadlines.js +22 -11
- package/workflows/dist/deadlines.js.map +1 -1
- package/workflows/dist/define.d.ts +0 -8
- package/workflows/dist/define.js +1 -24
- package/workflows/dist/define.js.map +1 -1
- package/workflows/dist/describe.d.ts +1 -1
- package/workflows/dist/describe.js +18 -5
- package/workflows/dist/describe.js.map +1 -1
- package/workflows/dist/description.d.ts +408 -2
- package/workflows/dist/description.js +130 -5
- package/workflows/dist/description.js.map +1 -1
- package/workflows/dist/drift.d.ts +5 -2
- package/workflows/dist/drift.js +5 -3
- package/workflows/dist/drift.js.map +1 -1
- package/workflows/dist/errors.d.ts +11 -11
- package/workflows/dist/errors.js +17 -36
- package/workflows/dist/errors.js.map +1 -1
- package/workflows/dist/fake.d.ts +0 -26
- package/workflows/dist/fake.js +0 -123
- package/workflows/dist/fake.js.map +1 -1
- package/workflows/dist/fakes.d.ts +2 -0
- package/workflows/dist/fakes.js +5 -0
- package/workflows/dist/fakes.js.map +1 -0
- package/workflows/dist/givens.d.ts +51 -0
- package/workflows/dist/givens.js +89 -0
- package/workflows/dist/givens.js.map +1 -0
- package/workflows/dist/host.d.ts +8 -7
- package/workflows/dist/host.js +1 -1
- package/workflows/dist/host.js.map +1 -1
- package/workflows/dist/identity-provisioning.d.ts +2 -5
- package/workflows/dist/identity-provisioning.js +16 -20
- package/workflows/dist/identity-provisioning.js.map +1 -1
- package/workflows/dist/import.d.ts +2 -0
- package/workflows/dist/import.js +7 -6
- package/workflows/dist/import.js.map +1 -1
- package/workflows/dist/index.d.ts +8 -7
- package/workflows/dist/index.js +4 -3
- package/workflows/dist/index.js.map +1 -1
- package/workflows/dist/ledger.js +8 -17
- package/workflows/dist/ledger.js.map +1 -1
- package/workflows/dist/lint.d.ts +2 -2
- package/workflows/dist/lint.js +8 -4
- package/workflows/dist/lint.js.map +1 -1
- package/workflows/dist/load.js +1 -1
- package/workflows/dist/load.js.map +1 -1
- package/workflows/dist/log.d.ts +0 -2
- package/workflows/dist/log.js +0 -11
- package/workflows/dist/log.js.map +1 -1
- package/workflows/dist/op.d.ts +103 -3
- package/workflows/dist/op.js +56 -6
- package/workflows/dist/op.js.map +1 -1
- package/workflows/dist/page-run.d.ts +40 -0
- package/workflows/dist/page-run.js +317 -0
- package/workflows/dist/page-run.js.map +1 -0
- package/workflows/dist/paths.d.ts +0 -13
- package/workflows/dist/paths.js +2 -46
- package/workflows/dist/paths.js.map +1 -1
- package/workflows/dist/renewal.d.ts +1 -1
- package/workflows/dist/renewal.js +1 -1
- package/workflows/dist/run.d.ts +4 -1
- package/workflows/dist/run.js.map +1 -1
- package/workflows/dist/runtime-ops.d.ts +19 -4
- package/workflows/dist/runtime-ops.js +34 -5
- package/workflows/dist/runtime-ops.js.map +1 -1
- package/workflows/dist/sandbox-runner.cjs +4 -4
- package/workflows/dist/sandbox.d.ts +0 -20
- package/workflows/dist/sandbox.js +23 -85
- package/workflows/dist/sandbox.js.map +1 -1
- package/workflows/dist/scenario.d.ts +19 -1
- package/workflows/dist/scenario.js +82 -21
- package/workflows/dist/scenario.js.map +1 -1
- package/workflows/dist/schedules.d.ts +1 -1
- package/workflows/dist/schedules.js +1 -1
- package/workflows/dist/secret.d.ts +4 -5
- package/workflows/dist/secret.js +7 -6
- package/workflows/dist/secret.js.map +1 -1
- package/workflows/dist/shared.d.ts +84 -7
- package/workflows/dist/shared.js +255 -8
- package/workflows/dist/shared.js.map +1 -1
- package/workflows/dist/sites.d.ts +5 -0
- package/workflows/dist/sites.js +7 -0
- package/workflows/dist/sites.js.map +1 -1
- package/workflows/dist/source.d.ts +40 -1
- package/workflows/dist/source.js +3 -3
- package/workflows/dist/source.js.map +1 -1
- package/workflows/dist/supervisor.d.ts +21 -18
- package/workflows/dist/supervisor.js +20 -22
- package/workflows/dist/supervisor.js.map +1 -1
- package/workflows/dist/tokens.d.ts +34 -0
- package/workflows/dist/tokens.js +70 -9
- package/workflows/dist/tokens.js.map +1 -1
- package/workflows/dist/vendor-info.d.ts +12 -3
- package/workflows/dist/vendor-info.js +21 -5
- package/workflows/dist/vendor-info.js.map +1 -1
- package/workflows/dist/version.js +1 -1
- package/workflows/dist/version.js.map +1 -1
- package/workflows/dist/wakeup-driver.js +1 -1
- package/workflows/dist/wakeup-driver.js.map +1 -1
- package/workflows/dist/wakeup-fake.d.ts +27 -0
- package/workflows/dist/wakeup-fake.js +125 -0
- package/workflows/dist/wakeup-fake.js.map +1 -0
- package/workflows/dist/wakeup-service.js +8 -24
- package/workflows/dist/wakeup-service.js.map +1 -1
- package/workflows/dist/wakeup-type.js +1 -1
- package/workflows/dist/wakeup-type.js.map +1 -1
- package/workflows/dist/worker.d.ts +19 -1
- package/workflows/dist/worker.js +67 -49
- package/workflows/dist/worker.js.map +1 -1
- package/workflows/drizzle/company/0007_token_handoffs.sql +8 -0
- package/workflows/drizzle/company/meta/0007_snapshot.json +1281 -0
- package/workflows/drizzle/company/meta/_journal.json +7 -0
- package/workflows/src/app-steps.ts +11 -0
- package/workflows/src/app-workflows.ts +100 -10
- package/workflows/src/approvals.ts +4 -2
- package/workflows/src/call.ts +37 -186
- package/workflows/src/change-steps.ts +43 -14
- package/workflows/src/change-workflow.ts +45 -16
- package/workflows/src/change.ts +39 -10
- package/workflows/src/client.ts +137 -62
- package/workflows/src/cloud-identity.ts +7 -4
- package/workflows/src/collection-driver.ts +230 -0
- package/workflows/src/collection.ts +62 -186
- package/workflows/src/company-file.ts +82 -0
- package/workflows/src/config.ts +97 -56
- package/workflows/src/ctx.ts +266 -0
- package/workflows/src/db/company.ts +15 -1
- package/workflows/src/db/dbos.ts +2 -0
- package/workflows/src/db/identity.ts +2 -2
- package/workflows/src/db.ts +10 -6
- package/workflows/src/deadlines.ts +31 -17
- package/workflows/src/define.ts +1 -24
- package/workflows/src/describe.ts +27 -5
- package/workflows/src/description.ts +152 -5
- package/workflows/src/drift.ts +8 -4
- package/workflows/src/errors.ts +19 -45
- package/workflows/src/fake.ts +4 -139
- package/workflows/src/fakes.ts +4 -0
- package/workflows/src/givens.ts +141 -0
- package/workflows/src/host.ts +8 -7
- package/workflows/src/identity-provisioning.ts +19 -30
- package/workflows/src/import.ts +8 -6
- package/workflows/src/index.ts +13 -2
- package/workflows/src/ledger.ts +8 -16
- package/workflows/src/lint.ts +12 -6
- package/workflows/src/load.ts +1 -1
- package/workflows/src/log.ts +0 -11
- package/workflows/src/op.ts +147 -12
- package/workflows/src/page-run.ts +437 -0
- package/workflows/src/paths.ts +2 -46
- package/workflows/src/renewal.ts +1 -1
- package/workflows/src/run.ts +4 -1
- package/workflows/src/runtime-ops.ts +36 -6
- package/workflows/src/sandbox.ts +31 -109
- package/workflows/src/scenario.ts +102 -19
- package/workflows/src/schedules.ts +1 -1
- package/workflows/src/secret.ts +8 -7
- package/workflows/src/shared.ts +304 -10
- package/workflows/src/sites.ts +8 -0
- package/workflows/src/source.ts +31 -5
- package/workflows/src/supervisor.ts +40 -38
- package/workflows/src/tokens.ts +100 -9
- package/workflows/src/vendor-info.ts +21 -6
- package/workflows/src/version.ts +1 -1
- package/workflows/src/wakeup-driver.ts +1 -1
- package/workflows/src/wakeup-fake.ts +138 -0
- package/workflows/src/wakeup-service.ts +8 -24
- package/workflows/src/wakeup-type.ts +1 -1
- package/workflows/src/worker.ts +121 -58
- package/app/dist/client/assets/ArrowUp.es-DOgvoS0P.js +0 -1
- package/app/dist/client/assets/Copy.es-B0D5SwiQ.js +0 -1
- package/app/dist/client/assets/DialogTitle-BgjYK22C.js +0 -1
- package/app/dist/client/assets/FloppyDisk.es-DnuNe_a8.js +0 -1
- package/app/dist/client/assets/Globe.es-B6x2e4-a.js +0 -1
- package/app/dist/client/assets/MagnifyingGlass.es-DoNoHEhT.js +0 -1
- package/app/dist/client/assets/Play.es-BwXalGBh.js +0 -1
- package/app/dist/client/assets/Plug.es-CaZsN5P-.js +0 -1
- package/app/dist/client/assets/Plus.es-w9VPpTJB.js +0 -1
- package/app/dist/client/assets/Separator-BAhKFgSd.js +0 -1
- package/app/dist/client/assets/X.es-DKMYClf-.js +0 -1
- package/app/dist/client/assets/_id-BSRAaWtO.js +0 -1
- package/app/dist/client/assets/_id-BjDP-cPH.js +0 -1
- package/app/dist/client/assets/_id-BudM76zX.js +0 -1
- package/app/dist/client/assets/_id-C37U5bBa.js +0 -1
- package/app/dist/client/assets/_id-lmg24JVh.js +0 -2
- package/app/dist/client/assets/_name-CylqFo_t.js +0 -1
- package/app/dist/client/assets/_name-D8Gl8iwy.js +0 -4
- package/app/dist/client/assets/_name-DdPCU8pt.js +0 -1
- package/app/dist/client/assets/_name-TteWQXe0.js +0 -1
- package/app/dist/client/assets/_vendor-BLxW83yk.js +0 -1
- package/app/dist/client/assets/_vendor-Bq3uZU4-.js +0 -1
- package/app/dist/client/assets/app-chrome-H8uZ4dHI.js +0 -16
- package/app/dist/client/assets/app-scope-BeUW_8Qh.js +0 -1
- package/app/dist/client/assets/approval-DpgmTc63.js +0 -1
- package/app/dist/client/assets/apps-CoWzNm8M.js +0 -1
- package/app/dist/client/assets/change-glance-DbYcBT7H.js +0 -1
- package/app/dist/client/assets/changes-DIJvP7wQ.js +0 -1
- package/app/dist/client/assets/chat-button-BgpOfYh1.js +0 -1
- package/app/dist/client/assets/chat-prompt-hiawXcK0.js +0 -1
- package/app/dist/client/assets/common-Dw2i6XKZ.js +0 -3
- package/app/dist/client/assets/composite-D9GNDzFj.js +0 -1
- package/app/dist/client/assets/connect-CIq2KJTz.js +0 -1
- package/app/dist/client/assets/connections-iqd2XbWQ.js +0 -5
- package/app/dist/client/assets/connectors-rI8_D1n1.js +0 -1
- package/app/dist/client/assets/credentials-26vu6Fv5.js +0 -1
- package/app/dist/client/assets/data-sDMlKaLV.js +0 -1
- package/app/dist/client/assets/decidable-zcYI7bY8.js +0 -1
- package/app/dist/client/assets/declaration-form-BtSVvxhq.js +0 -1
- package/app/dist/client/assets/dialog-DskpUgkl.js +0 -1
- package/app/dist/client/assets/existing-BD3VgJ_8.js +0 -1
- package/app/dist/client/assets/graph-Prxl3c55.js +0 -7
- package/app/dist/client/assets/grid-diff-SMsvea6t.js +0 -1
- package/app/dist/client/assets/hosting-BBHUppH-.js +0 -1
- package/app/dist/client/assets/import-B92fd4Tl.js +0 -1
- package/app/dist/client/assets/inbox-57oGZtxE.js +0 -1
- package/app/dist/client/assets/inbox-B2AMNtk5.js +0 -1
- package/app/dist/client/assets/index-Bn3XeKy8.js +0 -10
- package/app/dist/client/assets/kit-BsK6VZTQ.js +0 -1
- package/app/dist/client/assets/lazyRouteComponent-Uri98HNq.js +0 -1
- package/app/dist/client/assets/motion-C8lNeYvK.js +0 -1
- package/app/dist/client/assets/people-ISOMYCTu.js +0 -1
- package/app/dist/client/assets/permissions-Cenat84K.js +0 -2
- package/app/dist/client/assets/permissions-grid-B2GtGwzv.js +0 -1
- package/app/dist/client/assets/route-BP1XwaTB.js +0 -1
- package/app/dist/client/assets/route-KVU6QgwJ.js +0 -1
- package/app/dist/client/assets/runs-table-35lNzKLn.js +0 -1
- package/app/dist/client/assets/scenario-DSwsavxS.js +0 -1
- package/app/dist/client/assets/scenario-graph-CAzWOtqV.js +0 -1
- package/app/dist/client/assets/separator-BlwkzEY0.js +0 -1
- package/app/dist/client/assets/site-icon-DZvOfBvU.js +0 -1
- package/app/dist/client/assets/sites.index-CcNo6N8u.js +0 -1
- package/app/dist/client/assets/spinner-BGy6LWIW.js +0 -1
- package/app/dist/client/assets/start-form-Bgo9I63s.js +0 -1
- package/app/dist/client/assets/store-BGu0d2Ld.js +0 -57
- package/app/dist/client/assets/style-CCDLLPgG.css +0 -2
- package/app/dist/client/assets/table-DjbI5VTn.js +0 -1
- package/app/dist/client/assets/textarea-DXO0eUdp.js +0 -1
- package/app/dist/client/assets/useLoaderData-BQd5yMlA.js +0 -1
- package/app/dist/client/assets/useOpenInteractionType-Bin8RjM5.js +0 -1
- package/app/dist/client/assets/useRegisterFieldControl-CQPTOU7Z.js +0 -1
- package/app/dist/client/assets/useValueChanged-DMkuvFZG.js +0 -1
- package/app/dist/client/assets/utils-CMsCvwYQ.js +0 -1
- package/app/dist/client/assets/who-are-you-Bt1WI3Cz.js +0 -1
- package/app/dist/client/assets/workflow-BJpO61A-.js +0 -1
- package/app/dist/client/assets/workflow-view-DP-UlRiH.js +0 -1
- package/app/dist/client/assets/workflows-BLCBgxbx.js +0 -1
- package/app/dist/server/assets/app-chrome-BYS81Vnx.js +0 -1410
- package/app/dist/server/assets/sites.index-1l0BtgVf.js +0 -138
- package/app/dist/server/assets/utils-wksS9pYh.js +0 -138
- package/template/scenarios/publish-post/publish.feature +0 -28
- 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
|
|
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
|
|
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
|
|
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 `<
|
|
115
|
-
| `sanoma
|
|
116
|
-
| `sanoma
|
|
117
|
-
| `sanoma
|
|
118
|
-
| `sanoma
|
|
119
|
-
| `sanoma
|
|
120
|
-
| `sanoma --
|
|
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; `ctx.sleep` moves the run's own clock on instead of waiting, so a run that waits a week ends at once, a week later by `ctx.now()`. 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
|
|
|
@@ -230,6 +269,8 @@ With `PORT` set, as a container host sets it, `sanoma worker` runs its worker un
|
|
|
230
269
|
- `GET /wake`: a [wakeup](workflows/README.md#hosts)'s wake, handed to the supervisor (resume if stopped); 204, never cached.
|
|
231
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.
|
|
232
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
|
+
|
|
233
274
|
Without `PORT`, it listens on nothing and its worker never stops itself: nothing in its process would start it again.
|
|
234
275
|
|
|
235
276
|
### Cloning a private repository
|
package/app/README.md
CHANGED
|
@@ -419,7 +419,7 @@ The app reads no file while it answers: what the company's files say reaches it
|
|
|
419
419
|
|
|
420
420
|
## Screens
|
|
421
421
|
|
|
422
|
-
The bar's sections, in groups: Inbox and Workflows; a tile per site ([Sites](#sites)); then Setup, by purpose: Data (when the company has collections or sites), People, Hosting, Connectors, Apps and Permissions (when it has policies, `policies/*.cedar`). The app opens on
|
|
422
|
+
The bar's sections, in groups: Home, Inbox and Workflows; a tile per site ([Sites](#sites)); then Setup, by purpose: Data (when the company has collections or sites), People, Hosting, Connectors, Apps and Permissions (when it has policies, `policies/*.cedar`). The app opens on Home. At the bar's foot a badge says the company's state, read from facts each time, never stored: **Local** (it runs on this computer), **Going live…** (going live's run has not ended), **Go live failed** (its last run failed, or failed the host's step) or **Live** (its host is bound, or this is the hosted instance), **Live · drafting copy** on this computer once the company is live; its tooltip names the database's host. The badge never asks the host anything, so a host that stops when idle is not woken by it. Old links still work: `/resources` to `/hosting` (with its `?resource=`), `/setup` and the pages under it to Hosting's, `/runs` to its All runs view, `/runs/<id>` to the run's page under its workflow, and `/start?workflow=<name>` to that workflow's page with New run open, which says if the workflow is unknown (`/start` naming none, to `/workflows`).
|
|
423
423
|
|
|
424
424
|
- **Workflow** (`/workflows/<name>`): one workflow's page, which takes the window's full width (as the Inbox, Workflows and a collection's grid do; the other pages keep to a reading width). Its header names the workflow under **Workflows**, with its name, and **New run** at its end (none for a retired workflow), which opens New run over the Graph. Under it, pill tabs, each its own URL (`?view=`), each keeping the rest of the URL's search:
|
|
425
425
|
- **Graph** (no `?view=`): the workflow's outline (see [Outline](#outline)), marked with the scenario `?scenario=` names, the inspector floating over its right (under it while the page is narrow, as with the chat column open on a laptop).
|
|
@@ -442,11 +442,13 @@ A workflow's Graph and Code, and a run's graph, Ledger and Code, are one view: c
|
|
|
442
442
|
- With nothing selected, **About** on the workflow's page: how it starts (by hand, or "Runs <cron> (<time zone>), next <time>", the next fire computed by the server), what it may call, its operations with their effects, its built-ins, its input and **Used by**: each site's page that calls it, under the site's title, through `RunForm` or `api`, linking to the page (a component's file, which is no one page, by its file); on a run's page, the run's facts (who started it, when and its id) and its approvals, each with the operations it lets through (badged by effect), and **Approve** and **Reject** with an optional note while the run can still read a decision. When the run has not read a decision within 5 seconds (no worker is running, say), it stays queued and the run reads it when it next runs: the dialog closes and the page shows the decision as queued, with Approve and Reject disabled for that approval, until the run's status changes. Every card but New run has a close button: closing hides the inspector (and drops the selection) until a node is clicked, and an **About this workflow** (on a run's page **Show the run**) button at the card's corner brings the overview back.
|
|
443
443
|
|
|
444
444
|
- **Inbox** (`/inbox`): the approvals, with how many are pending beside its title. Pill tabs pick the list, each its own URL (`?show=`): **For you**, the pending approvals you may decide (the default once the page knows who you are, and counted from then), **Everyone**, every pending approval (the default until then), both newest first and with how many they list, each with **Decided today** under it, the approvals decided since midnight (your browser's) in the latest 50 runs; and **Decided** (`?show=decided`), the approvals decided in the latest 50 runs, latest first. The list is one card: each row has the approval's title, how long ago it was asked (a decided one: its decision, and how long ago it was made), its workflow and who started the run, and opens it (`?approval=<runId>/<approvalId>`), marked while it is open. The open one, by default the first for you, else the first, floats over the list's right (above the list while the card is narrow, as with the chat column open on a laptop): its title and status, a sentence saying whose run of which workflow wants to do what (the operations it lets through, such as "publish a post in Ghost"), its details, and at its foot the same controls as on its run's page. Once you decide, it leaves the list and the next one opens; with nothing for you, a link shows those waiting on others. Refreshes every 5 seconds.
|
|
445
|
-
- **Changes** (`/changes`, in the bar after Inbox when the repository has a remote): the changes
|
|
446
|
-
- **
|
|
445
|
+
- **Changes** (`/changes`, in the bar after Inbox when the repository has a remote): the changes from a chat's draft card (**Save to** the company, or **Review**, offered once the draft has a commit and its checks pass), each draft's latest, newest first, **Open** and **Done** as pill tabs (`?show=`), each row its title, where it is, how many files it edits, its pull request and when it last moved. A change's page (`/changes/<id>`) shows where it is ("Waiting for admin", Published, Closed), its branch at the head it last planned, its pull request and its run; what changed, by kind (policies, people, resources, workflows, sites, each app's); who may do what, the Permissions grid of `main` against the branch's, each changed cell with its before and after; and, floating, Publish: the policy's answer, the checks, and once merged the merge commit and the deploy, with **Publish** and **Reject** while it waits. Publish is also the change's approval in the Inbox, with the change linked. How a change runs is the [runtime's](../workflows/README.md#changes).
|
|
446
|
+
- **Home** (`/`): the company's name, then **Set up your company** with how many of its five steps are done, each from a fact (Start the company; Connect your agent; Try the sample workflow, a finished run of a workflow of the company's own; Add a teammate, a second person; Put it online, its host bound), each not done with what does it, and **Hide**, kept in a cookie (`sanoma_home_setup`); gone once all five are done. Under it, **Waiting on you** (the approvals you may decide, each opening in the Inbox) and **Recent runs** (the company's own latest ten, not the built-ins', with **All runs**).
|
|
447
|
+
|
|
448
|
+
- **Workflows** (`/workflows`): the window's full width. Its header says how many workflows the app has and the config's version (cut short, the whole of it in its tooltip), with **New workflow**, which opens the chat on a new chat with "Make a workflow that " in its composer for you to finish; a notice says so when the repo's policies do not hold, as they then refuse every call and start. Pill tabs, each its own URL with how many it holds, pick the rows (`?filter=`): **All**, **Waiting on you** (runs waiting on an approval you may decide), **Failed last run** and **Built-in**; the last tab is **All runs**. While the workflows are in more than one folder, a second row of tabs, **All**, **Yours** (the root's, the built-ins among them) and one per app (`?app=`), picks a folder, and the table puts each folder's under its heading, as Data does. Under them, one card: a box that finds a workflow by its title or name as you type, over a table of every workflow in the config, those whose runs wait on an approval you may decide first (badged with how many), then by their last run: its title (linking to its page), its name, built-in for the built-in `drift` (which starts like any other, with no input), how it starts (by hand, or the cron it runs on and its time zone), the vendors its operations call, in order of title, its last run's status and when, and how many approvals its runs wait on, on anyone. What it may call, its built-ins, its input and its outline are on its page. **All runs** (`?view=runs`) lists the latest 50 runs of every workflow, newest first: each with its workflow (linking to the run's page under its workflow, the run's id as its tooltip), a sandbox run's badge, its status, who started it and when, how many approvals it waits on, and a failed run's error. Its **Status** menu shows only the runs with that status, the latest 50 however old, kept in the URL as `?status=`; `?workflow=<name>` shows only that workflow's, named beside the menu with a button that removes it. The table refreshes as a workflow's Runs tab does. **New workflow** opens a dialog saying how to add one to the repo (a file under `workflows/`, listed in `sanoma.config.ts`, which the app shows once it restarts); drafting one from a description is coming.
|
|
447
449
|
- **People** (`/people`): who may act, as the data files declare them (`sanoma.person`, `.agent` and `.group`), with how many people beside the title, and the tabs **People**, **Groups** and **Agents** (`?show=`), each with how many. The problems with a declaration of theirs, or in a file that declares them, show above the table (their resources are left out, and nobody is admitted while there are any). People lists each person's name, email (`none` without one), groups (written on each group, read back by its members), how they sign in (an email code to their email, their GitHub login, or that they cannot) and when they last signed in and how (`Never` until they do), from the ledger; Agents lists each one's name, whom it acts for, its groups (also `agents`, muted and marked built in, the group the runtime puts every agent in) and the declaration, which opens in its file on Hosting; Groups lists each group's members, then, while there are agents, the built-in `agents` with them. A row opens over the list (`?person=<id>`, a group's name) with its file and export (opening it on Hosting) and its declaration's form (below): its fields from the type's schema, as declared, its id (a group's name) read-only, as the policy and the groups name it, and a group's members read-only, since they name declared people. On a host, each person's row, and their open card, has **Invite link** (only someone in `admin` makes one, and only for someone with an email declared; otherwise it is disabled and says why), which mints a one-use link that signs them in and shows it in a card, **Invite link for <name>**, with **Copy**, to send them however you like; a new link replaces their last.
|
|
448
|
-
- **Hosting** (`/hosting`): where the company runs, then the rest of what the data files declare at vendors. On top, a card per slot: Repository, Database, Host, Wakeup and Agent box (the sandbox the coding agents' boxes are opened in), each the declared resource whose type meets that contract (`resourceTypes[].capabilities`; the repository is the one the host clones), with its name, type, its plain declared fields, its binding and the latest drift verdict (with the fields that differ, and Adopt), the host's with where the last apply that made it says it answers and how it stays up, from its type (`resourceTypes[].host.lifetime`): Always on, or Stops when
|
|
449
|
-
- **Data** (`/data`): the config's collections, with how many beside the title, in a table: each one's title and name, the field it is found by, its fields, the workflows that save it (**Written by**), the sites that call it (**Shown on**) and the file that declares it (opening its declaration on Hosting), a row opening its grid. While they are declared in more than one folder, the rows are grouped by it, the root's first (**Yours**), then each app's with its folder and source, and tabs above the card show All or one folder's (`?app=<name>`, `?app=.` for the root's), with how many each. How many records each holds is not shown yet. **A collection** (`/data/<name>`) is its records in a grid you edit in place, the page's full width: a column per field, in the collection's order, then when each record was saved and by whom. Click or arrow to a cell (Shift and an arrow, or a drag, selects a range; Cmd/Ctrl+C copies it, tab-separated, for a spreadsheet), type or press Enter to change it, Enter to save it, Esc to cancel, Tab to save and move right: text and numbers in an input, a date in a date input, yes/no a checkbox, an enum's values and the declared people a menu. An edit shows at once and is one save of that record, made over the record as the edit found it (`ifRecord`); a record's edits, the form's too, are saved one after another, each over the one before, and a toast offers **Undo**, which puts that field back. A save the policy denies says why and the cell goes back to the record as it is; one it holds shows the record as it is stored, marked with a hollow dot, **waits for approval**, until its `call` run ends. A record someone changed since the grid read it is a conflict, never overwritten: the cell turns orange with what you typed, and a row under it says what is there now (who set what, and when, when the runtime says) with **Keep theirs** and **Use mine**. **Paste** a range (Cmd/Ctrl+V, tab-separated as Excel and Sheets copy one, quoted cells too) from the cell you are on, over the rows there and as new records past the last (each new record's key from the pasted column that lands on the key, else one to type before Save), or one value into every selected cell; drag the **fill handle**, at the selection's bottom-right corner, down to repeat its values; type into a selection to set every cell in it; **Delete** clears the selected cells, and deletes the records whose key is among them; **Shift+Enter** adds a record below the rows. Each value is read as its field reads it, so a number column gets numbers and an enum one of its values. None of these saves: they are staged as one change, its cells tinted with a bar at their left, new rows green, deleted ones struck, a cell its field cannot read (or a new record's missing key or field) in red, and a bar above the footer counts them ("6 changes in 3 records · from your paste: …") with **Review**, **Discard** and **Save as one change**; Cmd/Ctrl+Z takes back the last step, and while a change is staged an edit of a cell is a step of it, and the record form, the filters, the sort and the key links wait for it ("Save or discard the staged changes first"), as does leaving the page. **Review** lists each record's changed fields, as they were and as staged, the cells to fix first, and **Save n now**, which saves the records ready and leaves the rest staged. Save reads the records again first: one changed since it was staged is a conflict to settle, per cell, before anything is sent. Then the change is one call, `data.<name>.saveMany`, all or nothing, the policy deciding each record and the ledger recording each, in one run: a conflict it finds keeps the change to settle; a denial drops the records it refused, marked **refused**, and keeps the rest; a hold says the change **waits for approval**, linking to its run, and marks its records; any other failure saves nothing and keeps the change staged. The footer says how many records match, when you last saved, and the cell you are on; **Export CSV** downloads the grid as shown. Drag a heading's edge to widen its column (kept per collection in this browser). A field's heading sorts by it, ascending, then descending, then by key again (`?order=`, `-` for descending); above the grid, **<key> starts with** keeps the records whose key starts with what you type (`?key=`), each enum field has a menu of its values (`?where=`), **Fields** hides some (`?hide=`, said by a chip that shows them again), and **Show at most** sets how many it reads, 100 at first, up to 1000 (`?limit=`); it says so when there may be more. **Columns**: each field's heading but the key's has a menu: **Rename**, **Change type**, **Hide column** (`?hide=`), on a free-form field each key its records hold with how many, to make a column of (**Convert to column**), and **Remove column**; **+** after the last heading, or **New column** under **Fields**, opens the New column panel. Each opens a panel beside the grid (`?column=`) with what it takes (a name; a type of the chips Text, Number, Yes / no, Date, A person, A choice with its choices one per line, and Link to another table and Free-form, which arrive with real tables; Optional) and **What will happen** in plain words, drafted over the records on screen; **Review the change** proposes it (`proposeColumnChangeFn`): the collection's declaration in `resources/data.ts` edited by a `patch` run as a form's Save is (a rename renames the field, a removal leaves the records' values where they are), landed as a change for review that carries its plan, or, with no remote, written and committed. A table change's page reviews it in its words: a card per change (**Safe**; **Needs a decision**, with the records that won't convert, a sample and two choices; **Keeps the data**), **Try it first** (a copy, once previews land), **The details** (the declaration's lines, and what runs on the database: nothing until the runtime plans the change), **Approve and apply** and **Send back** for its Publish and Reject, and **Couldn't apply this change · Nothing changed** over a run that failed. The plan is the app's draft (`planOf` in `components/grid/plan.ts`) until the runtime plans a table change itself; and since repository writes answer 501 on the Cloudflare Worker, columns change from a laptop first. A record saved before its fields changed, which they now refuse, is badged **needs fixing**, what they refuse in its tooltip. **Add record**, or a record's key (or Space on its row), opens the record form beside the grid (`?new`, `?record=<key>`), drawn from the collection's fields as a start form is from a workflow's input: text, a number, yes/no, a choice for an enum, a date input for a date (one a workflow saved with a time shows as a date and time), and a person as their id, a new record's people starting as you; an edit's key cannot change. **Save** saves it (an edit over the record as the form read it, so one someone changed since is refused), and **Delete**, once confirmed, deletes it. The grid and the form change one copy of the records in the browser (a TanStack DB collection over the page's read of them), so each shows the other's change at once, without reading the records again. Every read and change is the collection's operation (`data.<name>.list`, `.save`, `.delete`) called through `api` as you, so the policy decides each and a save or a delete is in the ledger: a denial shows on the form; a call the policy holds for an approval says **Held for approval**, linking to its run of the built-in `call` workflow (`/workflows/call/runs/<runId>`), which makes it once approved in the Inbox; what the fields refuse shows under them. Under an open record's form, **History · from the ledger** lists its saves and deletes, newest first, each with when, who (a workflow's run by the workflow's name), the fields it changed (before → after; the first save says **created**) and a link to its run but for a direct call's, which has no page yet: read from the ledger by the record's target (`SanomaClient.history`), and only for someone the policy lets `get` the record, since the ledger holds its values (its latest 500 calls, reads among them: it says so when older changes are not shown); a saved toast's key opens it there. The header names the collection, its operations' prefix and where `resources/data.ts` declares it (opening it on Hosting), and **Used by** lists the workflows whose `uses` name one of its operations, then the sites' pages that read or write it, as a workflow's page lists those that call it. **Import** (`/data/<name>/import`, Data / the collection / Import) brings a sheet in, in three steps, each its own URL (`?step=match`, `?step=review`): **Upload** takes a CSV file, chosen or dropped (its first row names the columns; RFC 4180, so quoted cells with commas, quotes or line breaks read whole), and shows its first rows; **Match columns** has a select per column, matched to the field of its name (each field once, the key marked), **Skip**, and for a column no field is named for, a new field to add first (the collection's columns change through the file, not here, yet); a column whose values its field does not take as written lists each with how many rows hold it and what it stands for: an enum's value, a declared person (a name or an email guessed as that person; while nobody is declared, any id is taken as written), left out (filling nothing: a new record's field stays empty, an update keeps the record's), or **Fix first**; under them, the rows the fields would still refuse, by row and why. **Review** reads the records the sheet's keys have, as you, and counts the rows, the new records, the updates, the unchanged and those with problems, over a table of what each row will do: **add**, **update** (a changed field showing what it **was**), **unchanged**, or **fix first**, with why. **Add n, update m** starts a run of the built-in `import` (`sanoma/workflows`' [Importing a sheet](../workflows/README.md#importing-a-sheet)) as you and opens it: the policy decides each save, a denied row is left as a problem, a held batch waits in the Inbox, and the run's output lists what it added, updated and left. A workbook (`.xlsx`) is refused with how to save it as CSV: reading one in the browser would add a 930 kB library.
|
|
450
|
+
- **Hosting** (`/hosting`): where the company runs, then the rest of what the data files declare at vendors. On top, a card per slot: Repository, Database, Host, Wakeup and Agent box (the sandbox the coding agents' boxes are opened in), each the declared resource whose type meets that contract (`resourceTypes[].capabilities`; the repository is the one the host clones), with its name, type, its plain declared fields, its binding and the latest drift verdict (with the fields that differ, and Adopt), the host's with where the last apply that made it says it answers and how it stays up, from its type (`resourceTypes[].host.lifetime`): Always on, or Stops when idle, what is due while it sleeps started by the Wakeup, or, with no Wakeup declared, a notice that none wakes it, so going live declares none and the host stays up. For a host that derives (`cloudflare.host`), its card also shows, read-only, what apply gives it (`hostDerived`, by `deriveHosts` as apply runs it, nothing minted): the runtime image, the repository and branch it runs, the public sites' domains it attaches, and each key it is given, stored or not and since when: `SANOMA_SIGNING_KEY` (or, when the config binds none, the host's own, `SANOMA_HOST_SIGNING_KEY`, generated into the store at its create), `SANOMA_SECRETS_KEY` with the built-in store, `SANOMA_SOURCE_KEY` and the wakeup's token; never a value. The agent box's card says whether each key its connector takes is set, with a link to the connector page where it is; a live instance that declares no sandbox says what to declare instead, since its coding agents refuse to run without one. While no host and no database are declared, and while going live has bound its repository but not yet its host (`resources/sanoma/infra.ts`), going live's steps show above them (**Go live**, below). Under them, **Other resources**: each other resource the data files declare (people are on People, collections on Data; its name, type and vendor, the declaration it comes from, which opens in its file below the table, marked, and the vendor object the lockfile binds it to, its id cut short), with the latest drift check's verdict: clean, drifted (with each field that differs, as declared and as the vendor holds it, shown under its row), gone, absent (not bound yet, and whether its identity found an object), error (and why), or not checked. Bindings in the lockfile that no data file declares are listed under the table, each with its key, type and id: apply asks whether to forget each or delete its object. **Apply** starts the built-in `apply` workflow on every declaration, and goes to its run; the config registers it beside drift. Apply holds its plan for a person: wherever an approval's details carry one, the Inbox and the run show it as the change view: problems in the data files, each change to the lockfile apply did not make in plain words ("points store at a different project: abcdefgh… → wxyzabcd…"), then the steps by action: creates with their planned fields (what the vendor fills in is "known after apply"), updates and replaces with the fields that differ (and, for a replace, the fields that cannot change in place), binds (found by identity, or given), gone objects and orphaned bindings with the question each asks, and the unchanged, folded. Each drifted field has **Adopt**, which writes the value the vendor holds, as that check's report has it, into the data file (`setFields`: only that declaration changes), commits it when the worker is given a `source` (the company's repository; without one it only writes the file), as an `adopt` run in the worker, and starts a drift check, which reads the file as it now is. A declaration's literal fields are written from a form too: **Edit**, beside the file a declared resource opens in (`?edit`), and a row of People open, draw the declaration's form (`components/declaration-form.tsx`): its type's schema's fields (less those only the vendor sets or never reads back), as the data file declares them, a field that names another declared resource and a person's, agent's or group's identity read-only. **Save** sends the fields you changed (a `patch` run, `{ at: { file, export }, fields }`, for a declaration the description names: a resource, a collection, a site or an app; it sets fields and removes none, so an emptied one is refused on the form) through the same writer, which parses the file and changes literals only: a field the file computes (a name or reference, a call, a spread) or a declaration that is no object literal is refused with the writer's reason (`invalid_input`, with the `field`), which the form shows under that field, read-only from then on, and stays the code's to change. Under the form, where it landed: **Saved as a change**, linking to its review, or saved to the file and the commit; a refusal (a 403) shows its reason. The form shows the declaration as the files hold it: the app makes its description again on the next request once a file it loaded changes (`liveDescription`), and a Save or an Adopt reads the config again, so what was saved shows on People, Hosting and Data at once. Where a Save lands: when the repository drafts and its remote has a connector's remote half, it is a change (**Changes**, above): the fields set in a draft of its own, `ui-<8 hex>`, committed there as you ("Change <fields> of <export>") and sent for review, the answer being the change's run, whose page is `/changes/<id>`; a change to the rules (a people file) waits for `admin` as any change to them does. Without a remote it is written and committed in the checkout as Adopt is, a people file (or a file one imports) only by someone in `admin` (403 for anyone else, since nothing would review it). Adopt and Save write the checkout one at a time. **Run drift** starts the built-in `drift` workflow, which reads the data files as they are then; the page reads the drift runs as a workflow's Runs tab does, every 2 seconds, links to the latest run, and shows the report of the latest that finished. Problems in the data files show under the tables, each at its file, line and column, since their resources are left out: those the app found when it started, and any the last check found. The declared list is the description's, made again once a data file, the lockfile or a folder they are in changes, so a declaration written since opens without a restart; the public sites' hosts and logins stay as the app started.
|
|
451
|
+
- **Data** (`/data`): the config's collections, with how many beside the title, in a table: each one's title and name, the field it is found by, its fields, the workflows that save it (**Written by**), the sites that call it (**Shown on**) and the file that declares it (opening its declaration on Hosting), a row opening its grid. While they are declared in more than one folder, the rows are grouped by it, the root's first (**Yours**), then each app's with its folder and source, and tabs above the card show All or one folder's (`?app=<name>`, `?app=.` for the root's), with how many each. How many records each holds is not shown yet. **A collection** (`/data/<name>`) is its records in a grid you edit in place, the page's full width: a column per field but a removed one (below), in the collection's order, then when each record was saved and by whom. Click or arrow to a cell (Shift and an arrow, or a drag, selects a range; Cmd/Ctrl+C copies it, tab-separated, for a spreadsheet), type or press Enter to change it, Enter to save it, Esc to cancel, Tab to save and move right: text and numbers in an input, a date in a date input, yes/no a checkbox, an enum's values and the declared people a menu. An edit shows at once and is one save of that record, made over the record as the edit found it (`ifRecord`); a record's edits, the form's too, are saved one after another, each over the one before, and a toast offers **Undo**, which puts that field back. A save the policy denies says why and the cell goes back to the record as it is; one it holds shows the record as it is stored, marked with a hollow dot, **waits for approval**, until its `call` run ends. A record someone changed since the grid read it is a conflict, never overwritten: the cell turns orange with what you typed, and a row under it says what is there now (who set what, and when, when the runtime says) with **Keep theirs** and **Use mine**. **Paste** a range (Cmd/Ctrl+V, tab-separated as Excel and Sheets copy one, quoted cells too) from the cell you are on, over the rows there and as new records past the last (each new record's key from the pasted column that lands on the key, else one to type before Save), or one value into every selected cell; drag the **fill handle**, at the selection's bottom-right corner, down to repeat its values; type into a selection to set every cell in it; **Delete** clears the selected cells, and deletes the records whose key is among them; **Shift+Enter** adds a record below the rows. Each value is read as its field reads it, so a number column gets numbers and an enum one of its values. None of these saves: they are staged as one change, its cells tinted with a bar at their left, new rows green, deleted ones struck, a cell its field cannot read (or a new record's missing key or field) in red, and a bar above the footer counts them ("6 changes in 3 records · from your paste: …") with **Review**, **Discard** and **Save as one change**; Cmd/Ctrl+Z takes back the last step, and while a change is staged an edit of a cell is a step of it, and the record form, the filters, the sort and the key links wait for it ("Save or discard the staged changes first"), as does leaving the page. **Review** lists each record's changed fields, as they were and as staged, the cells to fix first, and **Save n now**, which saves the records ready and leaves the rest staged. Save reads the records again first: one changed since it was staged is a conflict to settle, per cell, before anything is sent. Then the change is one call, `data.<name>.saveMany`, all or nothing, the policy deciding each record and the ledger recording each, in one run: a conflict it finds keeps the change to settle; a denial drops the records it refused, marked **refused**, and keeps the rest; a hold says the change **waits for approval**, linking to its run, and marks its records; any other failure saves nothing and keeps the change staged. The footer says how many records match, when you last saved, and the cell you are on; **Export CSV** downloads the grid as shown. Drag a heading's edge to widen its column (kept per collection in this browser). A field's heading sorts by it, ascending, then descending, then by key again (`?order=`, `-` for descending); above the grid, **<key> starts with** keeps the records whose key starts with what you type (`?key=`), each enum field has a menu of its values (`?where=`), **Fields** hides some (`?hide=`, said by a chip that shows them again), and **Show at most** sets how many it reads, 100 at first, up to 1000 (`?limit=`); it says so when there may be more. **Columns**: each field's heading but the key's has a menu: **Rename**, **Change type**, **Hide for me** (`?hide=`, in your view only, as **Fields** does), on a free-form field each key its records hold with how many, to make a column of (**Convert to column**), and **Remove for everyone**, which takes the column out of the grid and the forms for everyone and keeps its values (the field stays declared, `hidden: true`); **+** after the last heading, or **New column** under **Fields**, opens the New column panel. Each opens a panel beside the grid (`?column=`) with what it takes (a name; a type of the chips Text, Number, Yes / no, Date, A person, A choice with its choices one per line, and Link to another table and Free-form, which aren't available yet; Optional) and **What will happen** in plain words, drafted over the records on screen. A type change with values that won't convert shows them, a sample by key, and asks before it goes on: **Leave these n empty**, which removes what they hold, or **Keep them as they are**, so they show as **needs fixing** until someone edits them. **Review the change** proposes it (`proposeColumnChangeFn`): the collection's declaration in `resources/data.ts` edited by a `patch` run as a form's Save is, landed as a change for review that carries its plan and the choice, or, with no remote, written and committed, the records brought along at once and a toast saying what became of them (and, when Sanoma cannot start again on the new declaration by itself, that it shows once it does). The records follow the change when it lands (`sanoma.records.reshape`): a rename moves each value to the new name, a type change stores the values that convert as the new type and leaves the rest empty or as they are, as chosen, and a removal leaves every record as it is. A table change's page reviews it in its words: a card per change (**Safe**, a rename among them; for a type change with values that won't convert, a sample of them and the choice made, **Clears n values** or **Keeps n for fixing**, read-only: sending the change back is how to choose the other way; **Keeps the data** for a removal), **Try it first** (a copy, once previews land), **The details** (the declaration's lines), and **Approve and apply** and **Send back** for its Publish and Reject. Once applied, **The records** says what became of them ("297 contact values converted, 15 left empty"), or, when they could not be brought along, that the change is published and the records are as they were, linking its run; **Couldn't apply this change · Nothing changed** is for a run that failed before merging. The plan is drafted by the app (`planOf` in `components/grid/plan.ts`) over every record when the change is proposed; and since repository writes answer 501 on the Cloudflare Worker, columns change from a laptop first. A record saved before its fields changed, which they now refuse, is badged **needs fixing**, what they refuse in its tooltip. **Add record**, or a record's key (or Space on its row), opens the record form beside the grid (`?new`, `?record=<key>`), drawn from the collection's fields (a removed one left out, and its value kept by an edit) as a start form is from a workflow's input: text, a number, yes/no, a choice for an enum, a date input for a date (one a workflow saved with a time shows as a date and time), and a person as their id, a new record's people starting as you; an edit's key cannot change. **Save** saves it (an edit over the record as the form read it, so one someone changed since is refused), and **Delete**, once confirmed, deletes it. The grid and the form change one copy of the records in the browser (a TanStack DB collection over the page's read of them), so each shows the other's change at once, without reading the records again. Every read and change is the collection's operation (`data.<name>.list`, `.save`, `.delete`) called through `api` as you, so the policy decides each and a save or a delete is in the ledger: a denial shows on the form; a call the policy holds for an approval says **Held for approval**, linking to its run of the built-in `call` workflow (`/workflows/call/runs/<runId>`), which makes it once approved in the Inbox; what the fields refuse shows under them. Under an open record's form, **History · from the ledger** lists its saves and deletes, newest first, each with when, who (a workflow's run by the workflow's name), the fields it changed (before → after; the first save says **created**) and a link to its run but for a direct call's, which has no page yet: read from the ledger by the record's target (`SanomaClient.history`), and only for someone the policy lets `get` the record, since the ledger holds its values (its latest 500 calls, reads among them: it says so when older changes are not shown); a saved toast's key opens it there. The header names the collection, its operations' prefix and where `resources/data.ts` declares it (opening it on Hosting), and **Used by** lists the workflows whose `uses` name one of its operations, then the sites' pages that read or write it, as a workflow's page lists those that call it. **Import** (`/data/<name>/import`, Data / the collection / Import) brings a sheet in, in three steps, each its own URL (`?step=match`, `?step=review`): **Upload** takes a CSV file, chosen or dropped (its first row names the columns; RFC 4180, so quoted cells with commas, quotes or line breaks read whole), and shows its first rows; **Match columns** has a select per column, matched to the field of its name (each field once, the key marked, a removed one not offered), **Skip**, and for a column no field is named for, a new field to add first (the collection's columns change through the file, not here, yet); a column whose values its field does not take as written lists each with how many rows hold it and what it stands for: an enum's value, a declared person (a name or an email guessed as that person; while nobody is declared, any id is taken as written), left out (filling nothing: a new record's field stays empty, an update keeps the record's), or **Fix first**; under them, the rows the fields would still refuse, by row and why. **Review** reads the records the sheet's keys have, as you, and counts the rows, the new records, the updates, the unchanged and those with problems, over a table of what each row will do: **add**, **update** (a changed field showing what it **was**), **unchanged**, or **fix first**, with why. **Add n, update m** starts a run of the built-in `import` (`sanoma/workflows`' [Importing a sheet](../workflows/README.md#importing-a-sheet)) as you and opens it: the policy decides each save, a denied row is left as a problem, a held batch waits in the Inbox, and the run's output lists what it added, updated and left. A workbook (`.xlsx`) is refused with how to save it as CSV: reading one in the browser would add a 930 kB library.
|
|
450
452
|
|
|
451
453
|

|
|
452
454
|
|
|
@@ -454,12 +456,12 @@ A workflow's Graph and Code, and a run's graph, Ledger and Code, are one view: c
|
|
|
454
456
|
- **Apps** (`/apps`): the company's apps, with how many beside the title, in three lists, each app's name opening its page. **Yours**: the apps of its own (no source), each with its folder and what it holds (workflows, collections, sites). **Taken**: those merged from a source repository (`app.ts`'s `source`), each with its source, linked, and how many commits it is behind that source (fetched by the worker when it starts and after each push to `main`, or why it cannot tell). **Available**: the apps on GitHub not taken yet (the repositories with the topic `sanoma-app`, through the built-in `sanoma.apps.list`, called as you once the page knows who you are, so the policy decides it and GitHub never holds up the rest of the page), Sanoma's own first, each with its tier (Official, Vendor verified or Community, from Sanoma's claims, `sanoma/claims`), whether Sanoma reviewed it, its description and license, its README, a solution's demo (**Try it**) and **Add**. **New app**, **Add** and **Update** open the chat with a prompt for the agent ("Make an app that ", "Take the app from <url> into this company with take_app, …", "Update the app in apps/<name>/ from its source with update_app, …"), which drafts the change on a branch of its own; when GitHub cannot be searched, a notice says why and the repo's apps show all the same. **An app** (`/apps/<name>`) is its parts in one card: its header has, for a taken app, how far behind its source it is, **Source** and **Update**; then a line saying where it lives, and a section each for its **Sites** (its pages, what they call, who sees them), **Collections** (key and fields, opening the grid), **Workflows** (the operations each may call with their effects, its last run, its runs), **Policies** (each file under its `policies/`, how many rules and their reasons, to the Permissions grid) and **Scenarios** (each feature file under it, how many scenarios, of which workflows). People never sit in an app: they are declared at the root, on People.
|
|
455
457
|
- **Connectors**: each vendor the config's operations are from, by title, with its logo and id (never the built-in `sanoma` and `data`, which call nothing outside: a workflow's vendors and New run's "Calls … for real" leave them out too), how many operations it has and how many workflows use it, and, when its drivers declare environment variables, whether it is configured or how many variables it needs, each linking to its page, under Installed, with its tier (Official for an `@sanoma-ai/` package, else Community). Under Available, the connector packages on npm that the config does not install, found by the `sanoma-connector` keyword and shown by the `sanoma` field of each one's latest version (title, and logo files the server reads from jsDelivr and checks as an installed connector's are, shown as images only), with its tier, description and version; nothing is stored, and npm is read at most every 10 minutes. Choosing one opens the steps to add it (`?add=<package>`): `pnpm add`, the import in `sanoma.config.ts`, then its credentials; there is no install button. When npm cannot be reached, a notice says only the installed connectors show.
|
|
456
458
|
- **Connector** (`/connectors/<vendor>`): its [named connections](#connection-management), plus links to its connector's npm package and source (from `defineConnector`'s `package` and `homepage`, when it gives them), its resource types, and each operation with its effect, whether it is safe to retry, its description, its contract (input and output as JSON Schema), its scenario `phrases`, the scenarios with a step about it (each marked as seeding it, making it fail, expecting it or saying it must not be called, and linking to its workflow's New run in Sandbox mode with it chosen), and the workflows that may call it; a feature file that cannot be read says why above the operations, as on a workflow's page. A vendor with workflow operations whose connector attaches no fake (its `VendorEntry`'s `fake`) says "Its connector attaches no fake" once, above its operations; one with only a resource type's `read` and `import` needs none, since those read real state and a sandbox run never calls them.
|
|
457
|
-
- **Go live** (on `/hosting` while
|
|
459
|
+
- **Go live** (on `/hosting` while the company is Local, and `/hosting/connect`). On top of Hosting, a panel by the company's state, the host's health asked once as the page opens (not as a link to it is hovered, nor as the window regains focus; every few seconds while going live, and until a host just bound answers), with at most one ask every ten seconds: while Local, **Ready to go live** when `resources/sanoma/infra.ts` declares Sanoma Cloud (what going live makes and where it will answer; going live on Sanoma Cloud from the app is not built yet, so **Use your own accounts instead…** shows the steps below, `?own`), else the steps; **Going live** with its lines (repository, database, host, sign-in) and its run; **Go live failed** with the run's error, **Retry** and **Ask the agent**; **Live** with whether the host answers, on this computer that this is a drafting copy and, once the host answers, **Open, signed in as <your email>** (below), and on the hosted instance **Open on your Mac** (the desktop app, opening the company's repository). The steps' first, **Connect**, connects the company's GitHub and the vendors of its database, host and wakeup. When how far going live is cannot be read, its steps say why in their place, with Try again, and the rest of Hosting shows as ever. **Create GitHub App** (with an organization's login, or empty for your personal account) goes to `/setup/github/manifest`, a page that posts the App's manifest to GitHub (administration, contents, pull requests and commit statuses: write; push and pull request events, its webhook at the app's `/webhooks/github`, on unless the app is on this machine; its OAuth callback the staff sign-in's `/auth/better-auth/callback/github`, and email addresses: read, for the verified email), with its state and who asked in a signed, httpOnly cookie (nobody signed in is sent back here, told to say who they are first). You name and create the App on GitHub's page; GitHub sends you back to `/setup/github/callback`, which checks the state, exchanges the code (`POST /app-manifests/{code}/conversions`) and writes the App's id, slug, client id and secret, webhook secret and private key through the selected store as who asked (`SANOMA_GITHUB_APP_ID`, `SANOMA_GITHUB_APP_SLUG`, `SANOMA_GITHUB_CLIENT_ID`, `SANOMA_GITHUB_CLIENT_SECRET`, `SANOMA_GITHUB_WEBHOOK_SECRET`, `SANOMA_GITHUB_APP_PEM`), then comes back here saying how it went (sign-in uses the new client once the app restarts on a host beyond this machine). Step 1 ends with **Sign-in**, how people will sign in on the host (ready, or invite links only): you, signed in from this machine when the host starts (or, while the people file declares no email for you, to declare one), an email code through the config's `login.sender` once its connector is connected, GitHub through the company's App once its client is stored (and, when the App lacks the permission to read email addresses, which a sign-in with a private GitHub email needs, that Connect says what to add), and invite links always. While the email code is not ready, it has a `warning · not blocking` badge and the ways to fix it: name a sender in `sanoma.config.ts`, or connect the one named on Hosting › Connect, and, without GitHub, connect the GitHub App. A sender whose connector Connect does not list gets a row of its own there. When the config names a sender, going live gives the host its driver's variables among the host's `secrets` (`RESEND_API_KEY`; the address it sends from is the config's `login.from`). Once the host answers, **Open, signed in as <your email>** asks the host for an invite for the email the people file declares for you, sealed with the signing key it shares (the host's own, `SANOMA_HOST_SIGNING_KEY`, when the config binds none), and opens it. The page then shows the App's slug with **Install**, and, from GitHub's listing of the App, read as the App with its stored keys (at most every ten minutes, two seconds allowed), the permissions the manifest asks for that it lacks, as an App made before the manifest asked for them, or by hand, may: set them in the App's settings under Permissions & events, then accept the update on its installation. Vendors with named authentication use the same connection forms as their connector pages, instead of the old per-vendor token controls. Going live requires an explicitly declared default account that is connected; a sole connected account does not become a default automatically. Other bootstrap inputs, including the wakeup service's URL and account token, remain separate. Going live chooses by contract among the config's types whose vendor is connected (for the database and the host, a vendor this page does not connect counts as connected; the page names the vendors still to connect, and refuses a database or host other than the one it showed): the database (Neon's project first, else the first type that meets the `Database` contract, with its regions, which it holds the choice to, and size), the host (Cloudflare's container once its required connection is ready, else Docker's, else the first host; any host but Docker runs `ghcr.io/sanoma-ai/runtime:<the sanoma version the company installs>`, which Cloudflare copies into its account's registry at apply) and the wakeup (a connected one that wakes that host, the host's own vendor's first: Cloudflare's alarm before `sanoma.wakeup`). The repository is private, so going live also makes a new deploy key, its private half stored as the host's `SANOMA_SOURCE_KEY` (among its `secrets`, never shown) and its public half declared after the repository as a read-only `github.repository_deploy_key`, which the apply that makes the repository adds to it, and the host's apply waits for (a file written before deploy keys, or by **Connect an existing repository**, declares none, and its host clones as before); a GitHub connector with no such type is named among what is missing before anything is written. Every start of the host clones with it ([Cloning a private repository](../README.md#cloning-a-private-repository)). When the config declares a host type, the page also offers **Connect a wakeup service**, for scale to zero: the [wakeup service](../README.md#the-wakeup-service)'s URL, `SANOMA_WAKEUP_URL` (Sanoma's, or your own `sanoma wakeup`), and an account's token there, `SANOMA_WAKEUP_ACCOUNT_TOKEN`, both optional. Storing the account's token also mints the instance's own, `SANOMA_WAKEUP_TOKEN`, unless one is stored, and never shows it. With both stored and no wakeup of the host's own vendor connected, going live writes the runtime's own wakeup (`export const wakeup = sanoma.wakeup({ host })`, imported from `sanoma/resources`) into `resources/sanoma/infra.ts` after the host, mints `SANOMA_WAKEUP_TOKEN` when none is stored, and gives the host it (and `SANOMA_WAKEUP_URL`, for `sanoma.wakeup`) among its `secrets`, so the one apply of the host and the wakeup gives the worker on the host what it registers with; removing the line and answering its orphaned binding **delete** on Hosting deletes the instance.
|
|
458
460
|
- **Connect an existing repository or database** (`/hosting/existing`, linked from the connect page): takes a GitHub repository (`owner/name`, its owner required) and/or a Supabase project's ref, reads each through its type's import (in the worker, as a `connect-existing` run, before any declaration names it; apply's own import, when it binds, is in the ledger), and writes `resources/sanoma/infra.ts` from what was read: the repository's owner, name, description and visibility; the project's name, organization and region, with its database password declared as a generated secret, which Supabase never reads back, so the next apply that changes the project sets a new one. In a repository without a remote, the file is committed where the checkout is; with one, on a new branch, `setup/connect-existing`, checked out, and the page shows the diff: merging it is the approval. Then the run starts apply as its child with `bind` and `only` for those declarations, which binds them in the lockfile (committed on the same branch) and creates nothing. Refused when `infra.ts` or the branch is there already.
|
|
459
461
|
|
|
460
462
|
Named authentication uses the connection forms below. A connector that still declares only an `env` schema retains its separate credential fields; those are not account selectors. Named connections never gain an environment-first fallback or process-wide credential swapping.
|
|
461
463
|
|
|
462
|
-
The screens share one shell: down the left, the bar, and beside it the chat column, then the page. The bar has **Chat** first, then the sections and the sites' tiles in their groups, each an icon in a tile with its label under it, the current one filled (Inbox badged with how many approvals are pending), and at its foot the menu under your initials. **Chat** folds the chat column away and opens it again, and the app opens it as you left it on your next visit (it keeps that in a cookie, `sanoma_chat`, so the server renders the page with it open or folded from the first paint); until then it is open where it sits beside the page and folded where it would lie over it. The column is your chat with the agent: your latest chat (the others, and **New chat**, at its top), your messages at the right, its replies under them with the steps it took as a checked list, and at its foot the composer, carrying the page you are on. The agent edits only a draft of its own, a branch `draft/<chat>` it opens at its first edit and commits to as it goes, and runs the checks there; its reply ends with the draft's card (the branch, what changes, the checks) and you apply it by merging the branch (the live instance runs the old code until it restarts). It takes an app into the draft with `take_app`, a git merge of the source repository (an `https` URL) whose `apps/<name>/` lands as the company's, every other file staying the company's but `package.json`, which gets the source's beside its own, and updates one with `update_app`, a merge of the new commits of the source its `app.ts` names, as far as they touch `apps/<name>/` and `package.json`; a file git cannot merge is committed with its conflict markers, which the agent resolves before the checks pass ([Apps](../workflows/README.md#apps)). `takeAppPrompt` and `updateAppPrompt` (`src/lib/apps.ts`) are what the Apps page's Add and Update put in the chat. A lookup the policy holds shows its approval's card in the reply (or who it waits for, with the Inbox's link), and the turn goes on once it is decided. The chat is kept in the company's database: a restart loses the turn under way, not the chat or the draft, and **Continue** picks up. The model is the first connector with a model half, its default; without its key, the reply says so with a link to its connector page. A new chat's composer picks its engine, which the chat keeps and names at its top: **Sanoma** (our own loop, the default), or an existing coding agent on the company's Anthropic key, **Pi** or **Claude Code**, driven through the AI SDK's `HarnessAgent` in the person's box, one per person per company, kept across restarts: in the sandbox the company declares (one `agent37.instance` in a data file, which going live writes into `resources/sanoma/infra.ts` once Agent37's key is stored), each box an Agent37 instance its connector opens, else, on this computer, a directory of its own (`.sanoma/agent-home/boxes/<box>`); a live instance that declares none refuses the coding agents, the reply saying what to declare, so no agent ever runs inside the live instance. Each turn opens the box, brings the chat's draft into the box's clone (`repo/`) as a git bundle, which carries commits and the branch alone (no remote, no token, no secret of the company's), and runs `pnpm install --frozen-lockfile --ignore-scripts` there with the box's own pnpm (never the one a `packageManager` field names) on the first turn and whenever the lockfile changed, so the box keeps a second `node_modules` of its own. A coding agent reads the repository's `AGENTS.md` itself; its file edits are allowed inside the clone and refused outside it (by their real paths in the box, where the files are) or under `.git` or `node_modules`, its shell commands are refused, each with the reason shown as a refused step (so taking or updating an app is the Sanoma engine's) (Claude Code reads files itself, as this machine's user: only its edits and commands ask); at the end of its turn its edits are committed in the clone as the person, brought back to the draft as a bundle and checked there. One turn runs in a box at a time: a second, from another of the person's chats, is refused until the first ends; a box that fails mid-turn loses that turn's edits, and says so. Claude Code's first turn in a box installs it under the box's home (about 760 MB, 40 s), which needs pnpm 11 and bash on the `PATH`; its bridge listens on all interfaces, guarded by a token, so keep that port behind a firewall. Under **Your own plan**, the composer offers a person's own coding agent, on their own subscription, driven over the Agent Client Protocol by the app's own client in the person's box, on its clone of the chat's draft: **Copilot**, **OpenCode** (its free models need no sign-in), **Pi**, **Claude Code** and **Codex**. A person's own agent spends that person's plan under their vendor's terms, which Sanoma neither checks nor changes. The agent runs in the person's box (on a laptop, a directory of this machine) with an environment of its own: its `HOME` is `.acp` in that box (`.sanoma/agent-home/boxes/<box>/.acp`, kept across restarts), so a sign-in is kept for that person and never the company's (every person's agent runs as this machine's user, so on an instance several people share, what an agent runs itself can reach another person's sign-in), and none of the app's or this machine's credentials reach it (no token variables; `gh`, `security` and the browser openers refuse on its `PATH`). Its first turn on a machine installs it there (`.acp/<agent>`) with the pnpm on the `PATH` (the desktop shell ships its own), in 10 to 45 s and 150 to 340 MB each. So `.sanoma/agent-home/boxes` holds a box for each person of the company: its home is Pi's and Claude Code's on the company's key (whose session's files are the clone's and that home's only, never its `.acp`; Claude Code's own reads and the commands a bridge runs are this machine's user's), and its `.acp` the person's own agents' (their `HOME`, installs and sign-ins, given only to that person's agents). The `harness`, `acp` and `people` directories of earlier versions are no longer read: delete them by hand. When the vendor asks the person to sign in, the reply is a sign-in card: the vendor's link and code (Copilot's and Codex's device flows), with a field for a code the vendor asks to have pasted back (Claude Code's), or, for Pi, whose sign-in needs a real terminal, the command to run once on this computer; the app opens no link and enters no code, the card keeps neither once it ends, and after signing in the person sends the message again. The agent's requests to read or edit a file are allowed inside the clone and refused outside it or under `.git` or `node_modules`, as are its requests to run a command and anything else it asks for, each with the reason as a refused step (it is never given an always-allow); the files it reads and writes through the app are the clone's only. What it runs in the app's terminal, and what its own tools do without asking (OpenCode edits and runs commands inside the clone without asking), are its own: the commit brought back to the draft and its checks, at the end of the turn, are the gate. From 1024 px wide the column sits beside the page; narrower, it lies over the page; on a phone (under 768 px) there is none, and the bar is a sheet over the page, opened from the menu button atop it, that closes as you follow a link or tap beside it. Each page starts with its title, with what it counts beside it and the pages above it as links (Workflows, then the workflow's title, on a run's page), its actions at the end of the row; then, on a page with views, pill tabs, each a URL; then one card. What you open from a list, an approval, a run, a scenario or a graph's node, floats over the card's right in a card of its own, and sits above the list (under a graph) while the page's card is too narrow. **Density**, in the menu at the bar's foot under the theme, switches the page to **Compact**, a tighter density for people who live in the app: the page a quarter tighter in every padding, gap and control (its icons too; the text keeps its size), half the gap between a page's regions, a lower graph card and source (a floating card keeps its width). The browser remembers the density in a cookie (`sanoma_density`), so the server renders the page in it from the first paint. The menu at the bar's foot, under your initials, has who you are (and Change name, under the default resolver), the theme (light, dark or the system's, which the browser remembers) and the density. Inside the [desktop app](../../desktop/README.md)'s window it also lists the companies open there, this one checked: choosing another switches the window to it, and **Add company…** shows the desktop app's start screen (`src/lib/desktop.ts`, over the `window.sanomaDesktop` the desktop app gives the page; in a browser there is none, and the menu has no Companies). The screens are built with [shadcn/ui](https://ui.shadcn.com) components (`src/components/ui`, from `components.json`) on Tailwind CSS, in the theme `src/style.css` holds: Sanoma's palette in light and dark, IBM Plex Sans and Mono (Fraunces for display), and 28 px controls.
|
|
464
|
+
The screens share one shell: down the left, the bar, and beside it the chat column, then the page. The bar has **Chat** first, then the sections and the sites' tiles in their groups, each an icon in a tile with its label under it, the current one filled (Inbox badged with how many approvals are pending), and at its foot the menu under your initials. **Chat** folds the chat column away and opens it again, and the app opens it as you left it on your next visit (it keeps that in a cookie, `sanoma_chat`, so the server renders the page with it open or folded from the first paint); until then it is open where it sits beside the page and folded where it would lie over it. The column is your chat with the agent: your latest chat (the others, and **New chat**, at its top), your messages at the right, its replies under them with the steps it took as a checked list, and at its foot the composer, carrying the page you are on. Until the agent is connected (our loop without its model's key, and no engine chosen), a new chat shows **Connect your agent**: **Your Claude plan** (recommended; **Sign in with Claude** starts Claude Code's sign-in at once), **Your ChatGPT plan** through Codex (on a live instance **An OpenAI API key**, not offered yet, since OpenAI's plan sign-in is this computer's), **An API key** (the Anthropic connector's page) and **More agents** (Copilot, OpenCode, Pi); **Agent…** in the menu at the bar's foot shows them again. The engine chosen there or in the composer is the one your new chats open on, kept in a cookie (`sanoma_engine`). Once it is connected, the agent speaks first in your first chat (titled Getting started): who it is, what it read in the company (its workflows, connectors and people) and a few suggested asks, each a button that sends it in the chat; after a sign-in it asked for, it speaks once that is done. A reply that ends with suggested asks (after a change, two next ones) shows them the same way, never as text. The agent edits only a draft of its own, a branch `draft/<chat>` it opens at its first edit and commits to as it goes, and runs the checks there; its reply ends with the draft's card (the branch, what changes, the checks), with **Save to** the company once something is committed and the checks pass. Without a remote a connector reviews changes on, Save puts it to work at once: the draft is merged into the company as one commit titled as the chat, `main` is pushed to the repository's `origin` when it has one (the card says so when the push fails; the save stands), and the worker and the app start again on the files (a page open meanwhile catches up by itself); the card then says who saved it and when, with **Open the workflow** and **Undo**, which saves a draft reverting it the same way. With such a remote, Save opens the draft's change, published at once when the policy lets you decide it, and **Review** opens it for someone else's review ([Changes](../workflows/README.md#changes)). It takes an app into the draft with `take_app`, a git merge of the source repository (an `https` URL) whose `apps/<name>/` lands as the company's, every other file staying the company's but `package.json`, which gets the source's beside its own, and updates one with `update_app`, a merge of the new commits of the source its `app.ts` names, as far as they touch `apps/<name>/` and `package.json`; a file git cannot merge is committed with its conflict markers, which the agent resolves before the checks pass ([Apps](../workflows/README.md#apps)). `takeAppPrompt` and `updateAppPrompt` (`src/lib/apps.ts`) are what the Apps page's Add and Update put in the chat. A lookup the policy holds shows its approval's card in the reply (or who it waits for, with the Inbox's link), and the turn goes on once it is decided. The chat is kept in the company's database: a restart loses the turn under way, not the chat or the draft, and **Continue** picks up. The model is the first connector with a model half, its default; without its key, the reply says so with a link to its connector page. A new chat's composer picks its engine, each with its mark (a coding agent's from its connector), which the chat keeps, the agent with the account it runs on, and names at its top: **Sanoma** (our own loop, the default), or an existing coding agent on the company's Anthropic key, **Pi** or **Claude Code**, driven through the AI SDK's `HarnessAgent` in the person's box, one per person per company, kept across restarts: in the sandbox the company declares (one `agent37.instance` in a data file, which going live writes into `resources/sanoma/infra.ts` once Agent37's key is stored), each box an Agent37 instance its connector opens, else, on this computer, a directory of its own (`.sanoma/agent-home/boxes/<box>`); a live instance that declares none refuses the coding agents, the reply saying what to declare, so no agent ever runs inside the live instance. Each turn opens the box, brings the chat's draft into the box's clone (`repo/`) as a git bundle, which carries commits and the branch alone (no remote, no token, no secret of the company's), and runs `pnpm install --frozen-lockfile --ignore-scripts` there with the box's own pnpm (never the one a `packageManager` field names) on the first turn and whenever the lockfile changed, so the box keeps a second `node_modules` of its own. A coding agent reads the repository's `AGENTS.md` itself; its file edits are allowed inside the clone and refused outside it (by their real paths in the box, where the files are) or under `.git` or `node_modules`, its shell commands are refused, each with the reason shown as a refused step (so taking or updating an app is the Sanoma engine's) (Claude Code reads files itself, as this machine's user: only its edits and commands ask); at the end of its turn its edits are committed in the clone as the person, brought back to the draft as a bundle and checked there. One turn runs in a box at a time: a second, from another of the person's chats, is refused until the first ends; a box that fails mid-turn loses that turn's edits, and says so. Claude Code's first turn in a box installs it under the box's home (about 760 MB, 40 s), which needs pnpm 11 and bash on the `PATH`; its bridge listens on all interfaces, guarded by a token, so keep that port behind a firewall. Under **Your own plan**, the composer offers a person's own coding agent, on their own subscription, driven over the Agent Client Protocol by the app's own client in the person's box, on its clone of the chat's draft: **Copilot**, **OpenCode** (its free models need no sign-in), **Pi**, **Claude Code** and **Codex**, as far as their connectors are installed. A live instance offers no coding agent while it declares no box, and not **OpenCode** or **Pi** on a person's plan, whose sign-in is a command run once on the person's own computer. A person's own agent spends that person's plan under their vendor's terms, which Sanoma neither checks nor changes. The agent runs in the person's box (on a laptop, a directory of this machine) with an environment of its own: its `HOME` is `.acp` in that box (`.sanoma/agent-home/boxes/<box>/.acp`, kept across restarts), so a sign-in is kept for that person and never the company's (every person's agent runs as this machine's user, so on an instance several people share, what an agent runs itself can reach another person's sign-in), and none of the app's or this machine's credentials reach it (no token variables; `gh`, `security` and the browser openers refuse on its `PATH`). Its first turn on a machine installs it there (`.acp/<agent>`) with the pnpm on the `PATH` (the desktop shell ships its own), in 10 to 45 s and 150 to 340 MB each. So `.sanoma/agent-home/boxes` holds a box for each person of the company: its home is Pi's and Claude Code's on the company's key (whose session's files are the clone's and that home's only, never its `.acp`; Claude Code's own reads and the commands a bridge runs are this machine's user's), and its `.acp` the person's own agents' (their `HOME`, installs and sign-ins, given only to that person's agents). The `harness`, `acp` and `people` directories of earlier versions are no longer read: delete them by hand. When the vendor asks the person to sign in, the reply is a sign-in card: the vendor's link and code (Copilot's and Codex's device flows), with a field for a code the vendor asks to have pasted back (Claude Code's), or, for Pi, whose sign-in needs a real terminal, the command to run once on this computer; the app opens no link and enters no code, the card keeps neither once it ends, and after signing in the person sends the message again. The agent's requests to read or edit a file are allowed inside the clone and refused outside it or under `.git` or `node_modules`, as are its requests to run a command and anything else it asks for, each with the reason as a refused step (it is never given an always-allow); the files it reads and writes through the app are the clone's only. What it runs in the app's terminal, and what its own tools do without asking (OpenCode edits and runs commands inside the clone without asking), are its own: the commit brought back to the draft and its checks, at the end of the turn, are the gate. From 1024 px wide the column sits beside the page; narrower, it lies over the page; on a phone (under 768 px) there is none, and the bar is a sheet over the page, opened from the menu button atop it, that closes as you follow a link or tap beside it. Each page starts with its title, with what it counts beside it and the pages above it as links (Workflows, then the workflow's title, on a run's page), its actions at the end of the row; then, on a page with views, pill tabs, each a URL; then one card. What you open from a list, an approval, a run, a scenario or a graph's node, floats over the card's right in a card of its own, and sits above the list (under a graph) while the page's card is too narrow. **Density**, in the menu at the bar's foot under the theme, switches the page to **Compact**, a tighter density for people who live in the app: the page a quarter tighter in every padding, gap and control (its icons too; the text keeps its size), half the gap between a page's regions, a lower graph card and source (a floating card keeps its width). The browser remembers the density in a cookie (`sanoma_density`), so the server renders the page in it from the first paint. The menu at the bar's foot, under your initials, has who you are (and Change name, under the default resolver), the theme (light, dark or the system's, which the browser remembers) and the density. Inside the [desktop app](../../desktop/README.md)'s window it also lists the companies open there, this one checked: choosing another switches the window to it, and **Add company…** shows the desktop app's start screen (`src/lib/desktop.ts`, over the `window.sanomaDesktop` the desktop app gives the page; in a browser there is none, and the menu has no Companies). The screens are built with [shadcn/ui](https://ui.shadcn.com) components (`src/components/ui`, from `components.json`) on Tailwind CSS, in the theme `src/style.css` holds: Sanoma's palette in light and dark, IBM Plex Sans and Mono (Fraunces for display), and 28 px controls.
|
|
463
465
|
|
|
464
466
|
### Connection management
|
|
465
467
|
|
|
@@ -499,13 +501,15 @@ Each workflow card on the Workflows page, and a workflow's page, draw the workfl
|
|
|
499
501
|
|
|
500
502
|
`startApp(config, { ingress })` adds machine routes (`IngressRoute`), answered by exact path right after `/healthz`, ahead of the public sites and the login, at any host: each checks its own token. A route with `prefix: true` also answers every path under its own (`/wakeup` answers `/wakeup/instances/…`, the [wakeup service](../README.md#the-wakeup-service)) and matches what follows itself; a route at the exact path comes first, then the longest prefix.
|
|
501
503
|
|
|
504
|
+
`POST /api/token/redeem` is the other half of [`sanoma.token.handoff`](../workflows/README.md#the-runtimes-own-operations), answered before any login at every host: a machine signing in posts `{ code, verifier }`, the one-time code a browser brought it and the PKCE verifier it kept, and is answered `{ token }`, the api token the code hands off, once, with `cache-control: no-store` and no cookie. A code used, expired or unknown, a verifier that is not the code's (which leaves the code to be redeemed) and a token revoked since, or another put under its name, all get one answer, 410; a body that is not `{ code, verifier }` gets a 400.
|
|
505
|
+
|
|
502
506
|
Beside them, the app answers a git host's webhooks at `POST /webhooks/<vendor>` for each connector whose remote half reads them (`webhook`; [remote halves](../workflows/README.md#usage)), GitHub's at `/webhooks/github`: the half verifies the delivery's signature over its raw body with the webhook secret (`SANOMA_GITHUB_WEBHOOK_SECRET`, the environment's, else the stored one), and each event it carries starts a run of the built-in `follow` as the runtime's agent `host-check` (`SanomaClient.follow`; one run per event, so a redelivery starts none), which the worker does with its checkout: a push to `main` applies the declared hosts, a push to a draft's branch plans its change again, a closed pull request ends it. Every host answers them, the Worker's bundle too. It answers 204 once the runs are started, 401 for a missing or wrong signature, 404 when no half of that vendor reads webhooks or its secret is not stored. Only an instance GitHub can reach hears them: a laptop has no public URL, so there a change's merge reads its pull request on GitHub itself (one merged or closed there ends the change once Publish is pressed), and a push to `main` made outside Sanoma is not deployed. An App made by the manifest before this version has its webhook off and lacks commit statuses: turn on **Active** under the App's settings' Webhook (GitHub's `PATCH /app/hook/config` sets only its URL, content type, secret and SSL check, not whether it is active), set its secret there if it has none and store it as `SANOMA_GITHUB_WEBHOOK_SECRET`, add **Commit statuses: Read and write** under its permissions, and accept the new permission on each installation. `onWrite` is called right before each change the app makes that a worker must run, a run's start or an approval's decision, never a read (`sanoma serve` starts its stopped worker again with it).
|
|
503
507
|
|
|
504
508
|
`startApp` takes a `login` provider, which says who may use the app and who is making each change. Without one, the app has no login and listens on this machine only; with one, it may listen on any host. A public site's own host has its front door instead, its visitor login or none ([Public sites](#public-sites)): the login here is for the people who run the company.
|
|
505
509
|
|
|
506
510
|
### No login, on this machine
|
|
507
511
|
|
|
508
|
-
The default, `loopbackLogin()`. The page asks "Who are you?" once (the people the data files declare, a row each with their groups, to pick from, or while they declare no one a name to type), keeps the answer in the browser, and sends it, URI-encoded, in the `x-sanoma-actor` header with every server function call; a change that names nobody is refused. It keeps the name in the `sanoma_actor` cookie too (`SameSite=Strict`), which the login reads when a request has no header, so the server's render of a page whose loader calls `api` knows who is asking; a page another site sends the browser to renders as nobody. Anyone who can reach the app can start runs and decide approvals as any name they type; the approver check only compares names. So `startApp` refuses any `host` but this machine's (127.0.0.1, the default, `localhost` or `::1`) without another login. While it listens on this machine only, it refuses every request (page, server function or static file) whose `Host` names anything but this machine (`localhost`, a loopback address, or a `*.localhost` name), so another site cannot reach it through DNS rebinding.
|
|
512
|
+
The default, `loopbackLogin()`. The page asks "Who are you?" once (the people the data files declare, a row each with their groups, to pick from, or while they declare no one a name to type; when they declare one person, as a new company does its founder, it takes them without asking), keeps the answer in the browser, and sends it, URI-encoded, in the `x-sanoma-actor` header with every server function call; a change that names nobody is refused. It keeps the name in the `sanoma_actor` cookie too (`SameSite=Strict`), which the login reads when a request has no header, so the server's render of a page whose loader calls `api` knows who is asking; a page another site sends the browser to renders as nobody. Anyone who can reach the app can start runs and decide approvals as any name they type; the approver check only compares names. So `startApp` refuses any `host` but this machine's (127.0.0.1, the default, `localhost` or `::1`) without another login. While it listens on this machine only, it refuses every request (page, server function or static file) whose `Host` names anything but this machine (`localhost`, a loopback address, or a `*.localhost` name), so another site cannot reach it through DNS rebinding.
|
|
509
513
|
|
|
510
514
|
Reads are open. Anyone who can reach the app sees every run, its ledger (each operation's input and output included) and its approvals, through the page and the server functions it reads them with; nothing asks who they are. On this machine, the Host check above is the only protection. A failure the app does not expect shows only "Something went wrong": its message can name internal details, such as a database host, so the app logs it instead.
|
|
511
515
|
|