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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/steps/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/steps/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,4FAA4F;AAC5F,2FAA2F;AAC3F,iGAAiG;AACjG,6EAA6E;AAE7E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,QAAQ,GAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AdoptInput, type AppStepContext, type PatchInput, type PatchOutput, type Written } from "sanoma/workflows";
|
|
1
|
+
import { type AdoptInput, type AppStepContext, type PatchInput, type PatchOutput, type SaveDraftInput, type SaveDraftOutput, type Written } from "sanoma/workflows";
|
|
2
2
|
/** The config's root, where its data files are: a config without one has none to write. */
|
|
3
3
|
export declare function rootOf({ resolved }: Pick<AppStepContext, "resolved">): string;
|
|
4
4
|
/**
|
|
@@ -17,13 +17,27 @@ export declare function adopt(step: AppStepContext, { runId, id, paths }: AdoptI
|
|
|
17
17
|
* `rename` names (`renameFields`), as the run's actor, and lands it.
|
|
18
18
|
* With a repository that drafts and has a remote a connector's remote half is for, it is a change:
|
|
19
19
|
* the file written in a draft of its own (`ui-<id>`), committed there, and the change opened for
|
|
20
|
-
* review (`SanomaClient.openChange`, carrying `plan
|
|
21
|
-
* each change to a field it edits, for its review), whose
|
|
20
|
+
* review (`SanomaClient.openChange`, carrying `plan`, for its review and its merge), whose
|
|
22
21
|
* run holds a change to the rules for `admin`; the change's run id. Otherwise the file is written
|
|
23
22
|
* in the checkout and committed as Adopt does, but a change to the rules (a people file) only by
|
|
24
|
-
* someone in `admin`: `not_approver` for anyone else, since nothing would review it
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* someone in `admin`: `not_approver` for anyone else, since nothing would review it (the `patch`
|
|
24
|
+
* run then brings the records along with the plan itself). Refused (`invalid_input`) for a
|
|
25
|
+
* declaration the description does not name, a plan that is not of the collection at `at` with
|
|
26
|
+
* each change to a field it edits, a rename the file cannot take, and, with the writer's reason and
|
|
27
|
+
* the `field`, for a field the file computes or a declaration that is no object literal.
|
|
28
28
|
*/
|
|
29
29
|
export declare function patch(step: AppStepContext, { at, fields, rename, plan }: PatchInput): Promise<PatchOutput>;
|
|
30
|
+
/**
|
|
31
|
+
* A chat's draft saved, as the run's actor, the chat's person (or, for an undo of a commit their
|
|
32
|
+
* `chat` saved, that commit reverted first in the draft of its own, `undoDraftOf`, left as it is
|
|
33
|
+
* when a retry finds it open). With a remote a connector reviews changes on, its change is opened
|
|
34
|
+
* as saved at `head` (`ChangeInput.save`), which the policy decides: the change's run id. Otherwise
|
|
35
|
+
* saving is publishing: the draft at `head` merged into the checkout and closed (`Source.merge`),
|
|
36
|
+
* a change to the rules only by someone in `admin` (`not_approver` for anyone else, as for a
|
|
37
|
+
* form's Save), `main` pushed to `origin` when there is one (a push that fails is said in the
|
|
38
|
+
* output, never the save's failure), and the worker started again on the files (`reload`). A run
|
|
39
|
+
* that merged already (cut short after it) answers with that commit. Refused for a draft of
|
|
40
|
+
* another person's chat, a commit their chat did not save, and once the draft has moved on from
|
|
41
|
+
* `head`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function saveDraft(step: AppStepContext, { id, title, head, undo, chat, page }: SaveDraftInput): Promise<SaveDraftOutput>;
|
package/app/dist/steps/writes.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { join, relative } from "node:path";
|
|
4
|
-
import { ADMIN, errorMessage, isRules, mayDeclarePeople, peopleSources, remoteFor, SanomaError, } from "sanoma/workflows";
|
|
4
|
+
import { ADMIN, editsRules, errorMessage, isRules, mayDeclarePeople, peopleSources, remoteFor, SanomaError, } from "sanoma/workflows";
|
|
5
5
|
import { describeConfig, formatOptions, NotLiteral, renameFields, setFields, } from "sanoma/workflows/describe";
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// file and both write it.
|
|
6
|
+
// A change from the app's own pages, in the worker (the built-ins `adopt`, `patch` and
|
|
7
|
+
// `save-draft`): Adopt (a drifted field's value at the vendor) and a form's Save, each written into
|
|
8
|
+
// the checkout (or a draft of it) and committed through the worker's repository, and a chat's
|
|
9
|
+
// draft saved; each read, write and commit one of the worker's writes (`AppStepContext.serially`),
|
|
10
|
+
// so two never read the same file and both write it.
|
|
12
11
|
/** The config's root, where its data files are: a config without one has none to write. */
|
|
13
12
|
export function rootOf({ resolved }) {
|
|
14
13
|
if (resolved.root === undefined)
|
|
@@ -75,14 +74,14 @@ async function written(step, file, text, message) {
|
|
|
75
74
|
* `rename` names (`renameFields`), as the run's actor, and lands it.
|
|
76
75
|
* With a repository that drafts and has a remote a connector's remote half is for, it is a change:
|
|
77
76
|
* the file written in a draft of its own (`ui-<id>`), committed there, and the change opened for
|
|
78
|
-
* review (`SanomaClient.openChange`, carrying `plan
|
|
79
|
-
* each change to a field it edits, for its review), whose
|
|
77
|
+
* review (`SanomaClient.openChange`, carrying `plan`, for its review and its merge), whose
|
|
80
78
|
* run holds a change to the rules for `admin`; the change's run id. Otherwise the file is written
|
|
81
79
|
* in the checkout and committed as Adopt does, but a change to the rules (a people file) only by
|
|
82
|
-
* someone in `admin`: `not_approver` for anyone else, since nothing would review it
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
80
|
+
* someone in `admin`: `not_approver` for anyone else, since nothing would review it (the `patch`
|
|
81
|
+
* run then brings the records along with the plan itself). Refused (`invalid_input`) for a
|
|
82
|
+
* declaration the description does not name, a plan that is not of the collection at `at` with
|
|
83
|
+
* each change to a field it edits, a rename the file cannot take, and, with the writer's reason and
|
|
84
|
+
* the `field`, for a field the file computes or a declaration that is no object literal.
|
|
86
85
|
*/
|
|
87
86
|
export async function patch(step, { at, fields, rename = {}, plan }) {
|
|
88
87
|
const root = rootOf(step);
|
|
@@ -97,12 +96,14 @@ export async function patch(step, { at, fields, rename = {}, plan }) {
|
|
|
97
96
|
if (!named)
|
|
98
97
|
throw new SanomaError("invalid_input", `${at.file}#${at.export} is not a declaration`);
|
|
99
98
|
const paths = [...Object.keys(fields), ...Object.keys(rename)];
|
|
100
|
-
// A plan is a column change's:
|
|
101
|
-
//
|
|
99
|
+
// A plan is a column change's: only of this collection's declaration, each of its changes to a
|
|
100
|
+
// field this patch edits, so the review says what merges and the records follow what is written.
|
|
102
101
|
const collection = description.collections.find((c) => c.declared?.at.file === at.file && c.declared.at.export === at.export);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
if (plan &&
|
|
103
|
+
(plan.collection !== collection?.name ||
|
|
104
|
+
!plan.changes.every((change) => paths.includes(`fields.${change.kind === "rename" ? change.from : change.kind === "convert" ? change.key : change.field}`)))) {
|
|
105
|
+
throw new SanomaError("invalid_input", `The plan is not of the fields this saves in ${at.export}`);
|
|
106
|
+
}
|
|
106
107
|
const message = `Change ${paths.join(", ")} of ${at.export === "default" ? at.file : at.export}`;
|
|
107
108
|
/**
|
|
108
109
|
* The file under `dir` as it is, and with the fields set and renamed; refused, saying why, when
|
|
@@ -143,7 +144,7 @@ export async function patch(step, { at, fields, rename = {}, plan }) {
|
|
|
143
144
|
// No page for its pull request's status to link: the app's origin is no fact the worker has,
|
|
144
145
|
// and a run's input is its starter's to choose.
|
|
145
146
|
return {
|
|
146
|
-
change: await client.openChange({ id, title: message, ...(
|
|
147
|
+
change: await client.openChange({ id, title: message, ...(plan && { plan }) }, { startedBy: by }),
|
|
147
148
|
};
|
|
148
149
|
}
|
|
149
150
|
catch (err) {
|
|
@@ -154,13 +155,89 @@ export async function patch(step, { at, fields, rename = {}, plan }) {
|
|
|
154
155
|
}
|
|
155
156
|
return step.serially(async () => {
|
|
156
157
|
const { before, text } = await edited(root);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
throw new SanomaError("not_approver", `A change to ${at.file} waits for an admin, and this company has no remote to review on`, { approver: { group: ADMIN } });
|
|
160
|
-
}
|
|
158
|
+
if (isRules(at.file) || mayDeclarePeople(before) || peopleSources(root).has(at.file))
|
|
159
|
+
adminOnly(by, at.file);
|
|
161
160
|
return written(step, at.file, text, message);
|
|
162
161
|
});
|
|
163
162
|
}
|
|
163
|
+
const savesDrafts = (source) => !!source?.draft &&
|
|
164
|
+
!!source.drafts &&
|
|
165
|
+
!!source.diff &&
|
|
166
|
+
!!source.merge &&
|
|
167
|
+
!!source.saved &&
|
|
168
|
+
!!source.revert &&
|
|
169
|
+
!!source.closeDraft;
|
|
170
|
+
/**
|
|
171
|
+
* A chat's draft saved, as the run's actor, the chat's person (or, for an undo of a commit their
|
|
172
|
+
* `chat` saved, that commit reverted first in the draft of its own, `undoDraftOf`, left as it is
|
|
173
|
+
* when a retry finds it open). With a remote a connector reviews changes on, its change is opened
|
|
174
|
+
* as saved at `head` (`ChangeInput.save`), which the policy decides: the change's run id. Otherwise
|
|
175
|
+
* saving is publishing: the draft at `head` merged into the checkout and closed (`Source.merge`),
|
|
176
|
+
* a change to the rules only by someone in `admin` (`not_approver` for anyone else, as for a
|
|
177
|
+
* form's Save), `main` pushed to `origin` when there is one (a push that fails is said in the
|
|
178
|
+
* output, never the save's failure), and the worker started again on the files (`reload`). A run
|
|
179
|
+
* that merged already (cut short after it) answers with that commit. Refused for a draft of
|
|
180
|
+
* another person's chat, a commit their chat did not save, and once the draft has moved on from
|
|
181
|
+
* `head`.
|
|
182
|
+
*/
|
|
183
|
+
export async function saveDraft(step, { id, title, head, undo, chat = id, page }) {
|
|
184
|
+
const { client, source, by, reload, runId } = step;
|
|
185
|
+
if (!savesDrafts(source))
|
|
186
|
+
throw new Error("This instance's repository cannot save a draft");
|
|
187
|
+
if ((await client.chats.get(chat))?.person !== by.id) {
|
|
188
|
+
throw new SanomaError("invalid_input", `No draft of yours is ${chat}`);
|
|
189
|
+
}
|
|
190
|
+
if (undo !== undefined && !(await client.savedAs(chat, undo))) {
|
|
191
|
+
throw new SanomaError("invalid_input", `${undo.slice(0, 7)} is not a commit your chat ${chat} saved`);
|
|
192
|
+
}
|
|
193
|
+
/** What a merge landed as: `main` pushed to `origin` when it has one, then the worker started again on it. */
|
|
194
|
+
const landed = async ({ revision, files }) => {
|
|
195
|
+
const notPushed = source.pushOrigin && (await source.remoteUrl?.()) !== undefined
|
|
196
|
+
? await source.pushOrigin().then(() => undefined, errorMessage)
|
|
197
|
+
: undefined;
|
|
198
|
+
reload?.();
|
|
199
|
+
return { revision, files, running: reload !== undefined, ...(notPushed !== undefined && { notPushed }) };
|
|
200
|
+
};
|
|
201
|
+
const merged = await source.saved(runId);
|
|
202
|
+
if (merged)
|
|
203
|
+
return landed(merged);
|
|
204
|
+
if (undo !== undefined && !(await source.drafts()).includes(id)) {
|
|
205
|
+
// A revert that fails closes its draft, so a retry reverts again.
|
|
206
|
+
await step.serially(() => source.revert(id, { sha: undo, author: by.id }).catch(async (err) => {
|
|
207
|
+
await source.closeDraft(id);
|
|
208
|
+
throw err;
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
/** The draft's change, as long as it is still at `head`, the commit the person saved. */
|
|
212
|
+
const saving = async () => {
|
|
213
|
+
const diff = await source.diff(id);
|
|
214
|
+
if (head !== undefined && diff.head !== head) {
|
|
215
|
+
throw new SanomaError("invalid_input", "The draft has changed since: save it from its latest card");
|
|
216
|
+
}
|
|
217
|
+
return diff;
|
|
218
|
+
};
|
|
219
|
+
if (await reviewsChanges(step, source)) {
|
|
220
|
+
const input = { id, title, save: (await saving()).head, ...(page !== undefined && { page }) };
|
|
221
|
+
return { change: await client.openChange(input, { startedBy: by }) };
|
|
222
|
+
}
|
|
223
|
+
const saved = await step.serially(async () => {
|
|
224
|
+
const [diff, draft] = await Promise.all([saving(), source.draft(id)]);
|
|
225
|
+
if (await editsRules(source.root, draft.root, diff.files))
|
|
226
|
+
adminOnly(by, "the policies or the people");
|
|
227
|
+
const { revision } = await source.merge(id, { head: diff.head, title, author: by.id, run: runId });
|
|
228
|
+
return { revision, files: diff.files };
|
|
229
|
+
});
|
|
230
|
+
return landed(saved);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Refuses (`not_approver`) a change to the rules (`what` it edits) by someone outside `admin`:
|
|
234
|
+
* without a remote, nothing would review it.
|
|
235
|
+
*/
|
|
236
|
+
function adminOnly(by, what) {
|
|
237
|
+
if (by.groups?.includes(ADMIN) === true)
|
|
238
|
+
return;
|
|
239
|
+
throw new SanomaError("not_approver", `A change to ${what} waits for an admin, and this company has no remote to review on`, { approver: { group: ADMIN } });
|
|
240
|
+
}
|
|
164
241
|
/**
|
|
165
242
|
* Whether a change can be reviewed: the repository drafts and has a remote that a connector's
|
|
166
243
|
* remote half is for (`remoteFor`), as opening a change needs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writes.js","sourceRoot":"","sources":["../../src/steps/writes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,KAAK,EAGL,YAAY,EACZ,OAAO,EACP,gBAAgB,EAGhB,aAAa,EACb,SAAS,EACT,WAAW,GAGZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,cAAc,EACd,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,E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ets/style-DaqPHcI1.css"
|
package/app/src/api.ts
CHANGED
|
@@ -16,11 +16,22 @@ import type {
|
|
|
16
16
|
PreviewRequest,
|
|
17
17
|
Principal,
|
|
18
18
|
RunSummary,
|
|
19
|
+
SanomaError,
|
|
20
|
+
SaveView,
|
|
19
21
|
} from "sanoma/workflows";
|
|
20
22
|
import type { ConfigDescription, PermissionsGrid, Span } from "sanoma/workflows/describe";
|
|
21
23
|
import { ConfigDescriptionSchema } from "sanoma/workflows/description";
|
|
22
24
|
import type { RunCheck, Scenario } from "sanoma/workflows/scenario";
|
|
23
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
COMMIT_ID,
|
|
27
|
+
DRAFT_ID,
|
|
28
|
+
EFFECTS,
|
|
29
|
+
errorCode,
|
|
30
|
+
errorMessage,
|
|
31
|
+
RUN_STATUSES,
|
|
32
|
+
type Saved,
|
|
33
|
+
vendorCodeOf,
|
|
34
|
+
} from "sanoma/workflows/shared";
|
|
24
35
|
import { z } from "zod";
|
|
25
36
|
import { ColumnChange } from "./components/grid/plan.ts";
|
|
26
37
|
|
|
@@ -155,6 +166,25 @@ export interface ChangeDetail extends ChangeView {
|
|
|
155
166
|
edits: string[];
|
|
156
167
|
}
|
|
157
168
|
|
|
169
|
+
/**
|
|
170
|
+
* A save of a chat's draft as `getSaves` reads it: the client's `SaveView`, and the config's
|
|
171
|
+
* workflows whose files it saved, by name (none for a save that opened a change).
|
|
172
|
+
*/
|
|
173
|
+
export interface SaveDetail extends SaveView {
|
|
174
|
+
edits: string[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* What saving a chat's draft takes (`saveDraftFn`): the chat's id, and the draft's commit its card
|
|
179
|
+
* showed (`head`), or, to undo what it saved, that commit on `main` (`undo`).
|
|
180
|
+
*/
|
|
181
|
+
export const SaveDraftRequest = z.object({
|
|
182
|
+
id: z.string().regex(DRAFT_ID),
|
|
183
|
+
head: z.string().regex(COMMIT_ID).optional(),
|
|
184
|
+
undo: z.string().regex(COMMIT_ID).optional(),
|
|
185
|
+
});
|
|
186
|
+
export type SaveDraftRequest = z.input<typeof SaveDraftRequest>;
|
|
187
|
+
|
|
158
188
|
/** One run as `getRun` reads it: the run, its ledger, its approvals and a sandbox run's checks. */
|
|
159
189
|
export interface RunDetail {
|
|
160
190
|
run: RunSummary;
|
|
@@ -178,8 +208,16 @@ export interface RunDetail {
|
|
|
178
208
|
* those that did not load), or the scenarios could not be read at all.
|
|
179
209
|
*/
|
|
180
210
|
checksError?: string;
|
|
211
|
+
/** For a queued apply, the apply it waits for: one runs at a time (`ApplyAhead`). */
|
|
212
|
+
ahead?: ApplyAhead;
|
|
181
213
|
}
|
|
182
214
|
|
|
215
|
+
/**
|
|
216
|
+
* The apply that a queued apply waits for, as the page names it: live applies run one at a time
|
|
217
|
+
* across the company's workers, so a second waits until this one ends.
|
|
218
|
+
*/
|
|
219
|
+
export type ApplyAhead = Pick<RunSummary, "runId" | "status" | "startedBy" | "createdAt">;
|
|
220
|
+
|
|
183
221
|
/**
|
|
184
222
|
* A scenario as the page lists it: what it says and the input its run starts with, not how the
|
|
185
223
|
* worker seeds and checks it.
|
|
@@ -190,6 +228,8 @@ export type ScenarioEntry = Pick<Scenario, "name" | "workflow" | "file" | "text"
|
|
|
190
228
|
export interface ScenariosResponse {
|
|
191
229
|
scenarios: ScenarioEntry[];
|
|
192
230
|
errors: { file: string; message: string }[];
|
|
231
|
+
/** The world (`scenarios/world.feature`) a demo opens on (`sanoma demo`): its name and its Givens' steps, when the root has one that compiles. */
|
|
232
|
+
world?: { name: string; steps: string[] };
|
|
193
233
|
}
|
|
194
234
|
|
|
195
235
|
/**
|
|
@@ -429,7 +469,7 @@ export const INFRA = "resources/sanoma/infra.ts";
|
|
|
429
469
|
export const DECLARE_BOX = `Coding agents work in a box of their own on a live instance, and this company declares none: declare one in ${INFRA} (\`export const box = agent37.instance({})\`, with the agent37 connector in sanoma.config.ts) and set AGENT37_API_KEY`;
|
|
430
470
|
|
|
431
471
|
/**
|
|
432
|
-
* Why a host of type `hostType` that stops when
|
|
472
|
+
* Why a host of type `hostType` that stops when idle has no Wakeup, `wakes` being the connected
|
|
433
473
|
* wakeups and the host types each wakes, when known: going live's refusal to declare one, and
|
|
434
474
|
* Hosting's notice on a host declared without one.
|
|
435
475
|
*/
|
|
@@ -483,11 +523,15 @@ export interface GoLiveChoices {
|
|
|
483
523
|
/** An apply run as going live (on Hosting) follows it: its status, the plan it waits on, and what it did. */
|
|
484
524
|
export interface GoLiveRun {
|
|
485
525
|
runId: string;
|
|
526
|
+
/** Its workflow: `apply`, or the built-in going live that started it, before its apply. */
|
|
527
|
+
workflow: string;
|
|
486
528
|
status: RunSummary["status"];
|
|
487
529
|
/** What it asks a person to approve, in the Inbox; the plan. */
|
|
488
530
|
pending?: { approvalId: string; plan?: ApplyPlan };
|
|
489
531
|
results?: ApplyResult[];
|
|
490
532
|
error?: string;
|
|
533
|
+
/** For a queued apply, the apply it waits for. */
|
|
534
|
+
ahead?: ApplyAhead;
|
|
491
535
|
}
|
|
492
536
|
|
|
493
537
|
/**
|
|
@@ -523,6 +567,40 @@ export interface GoLiveProgress {
|
|
|
523
567
|
/** Where the host answers, from the last apply that made or changed it, and whether `/healthz` answers. */
|
|
524
568
|
host: { url: string; healthy: boolean } | null;
|
|
525
569
|
}
|
|
570
|
+
/**
|
|
571
|
+
* Where a company is, read from facts, never from how it was made (`companyStateOf`): `local`,
|
|
572
|
+
* nothing bound to run it online; `deploying`, going live's run under way; `live`, its host bound
|
|
573
|
+
* (or this instance a hosted one); `failed`, going live's latest run failed and its host is not bound.
|
|
574
|
+
*/
|
|
575
|
+
export type CompanyPhase = "local" | "deploying" | "live" | "failed";
|
|
576
|
+
|
|
577
|
+
/** What going live makes, in its order: the progress list's lines. */
|
|
578
|
+
export const GO_LIVE_LINES = ["repository", "database", "host", "signIn"] as const;
|
|
579
|
+
|
|
580
|
+
/** A company's state (`getCompanyState`): the bar's badge, Home's last step and Hosting's panel. */
|
|
581
|
+
export interface CompanyState {
|
|
582
|
+
state: CompanyPhase;
|
|
583
|
+
/** Live, and this instance is on this computer: a copy the person drafts changes in. */
|
|
584
|
+
draftingCopy: boolean;
|
|
585
|
+
/** The host `infra.ts` declares: Sanoma Cloud's (its type binds its own bootstrap), one of the company's own accounts, or none. */
|
|
586
|
+
declared: "cloud" | "own" | null;
|
|
587
|
+
/** How far going live is, a line each thing it makes: done or not. */
|
|
588
|
+
lines: { line: (typeof GO_LIVE_LINES)[number]; done: boolean }[];
|
|
589
|
+
/** Going live's latest run: its apply once it started one, else the run itself; none before going live. */
|
|
590
|
+
run: GoLiveRun | null;
|
|
591
|
+
/**
|
|
592
|
+
* Where the host answers, and whether `/healthz` did (unknown until asked): only when Hosting
|
|
593
|
+
* asks (`force`), so the badge never wakes a host that stops when idle.
|
|
594
|
+
*/
|
|
595
|
+
host: { url: string; healthy?: boolean } | null;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/** Home's setup card, in its order: each step ticked from facts (`setupProgress`). */
|
|
599
|
+
export const SETUP_STEPS = ["start", "agent", "try", "teammate", "online"] as const;
|
|
600
|
+
export type SetupStep = (typeof SETUP_STEPS)[number];
|
|
601
|
+
/** Whether each of Home's setup steps is done (`getSetupProgress`). */
|
|
602
|
+
export type SetupProgress = Record<SetupStep, boolean>;
|
|
603
|
+
|
|
526
604
|
/** Said at the top of `infra.ts` when it declares an existing database, and on the page. */
|
|
527
605
|
export const PASSWORD_NOTE = [
|
|
528
606
|
"The database password is declared as a generated secret, since Supabase never reads it back.",
|
|
@@ -554,8 +632,15 @@ export type CallRequest = z.infer<typeof CallRequest>;
|
|
|
554
632
|
export const HistoryRequest = z.object({ name: z.string().min(1), key: z.string().min(1) });
|
|
555
633
|
export type HistoryRequest = z.infer<typeof HistoryRequest>;
|
|
556
634
|
|
|
557
|
-
/** What `
|
|
558
|
-
export const
|
|
635
|
+
/** What `getColumnPlan` takes: a change to the columns of the collection `collection`, to plan over its records. */
|
|
636
|
+
export const ColumnPlanRequest = z.object({ collection: z.string().min(1), change: ColumnChange });
|
|
637
|
+
export type ColumnPlanRequest = z.infer<typeof ColumnPlanRequest>;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* What `proposeColumnChangeFn` takes: the change, and with a `clear` decision `clears`, how many
|
|
641
|
+
* values the person was shown it leaves empty (`getColumnPlan`'s count of those that won't convert).
|
|
642
|
+
*/
|
|
643
|
+
export const ProposeColumnChange = ColumnPlanRequest.extend({ clears: z.number().int().min(0).optional() });
|
|
559
644
|
export type ProposeColumnChange = z.infer<typeof ProposeColumnChange>;
|
|
560
645
|
|
|
561
646
|
/** A field one write changed: its value before and after, each absent where the field was not set. */
|
|
@@ -675,6 +760,105 @@ export class ApiError extends Error {
|
|
|
675
760
|
export const errorBodyOf = (err: unknown): ErrorResponse | undefined =>
|
|
676
761
|
err instanceof ApiError ? err.body : undefined;
|
|
677
762
|
|
|
763
|
+
const STATUS: Partial<Record<NonNullable<ErrorResponse["code"]>, number>> = {
|
|
764
|
+
invalid_input: 400,
|
|
765
|
+
not_approver: 403,
|
|
766
|
+
not_admitted: 403,
|
|
767
|
+
policy_denied: 403,
|
|
768
|
+
run_not_found: 404,
|
|
769
|
+
no_pending_approval: 404,
|
|
770
|
+
already_decided: 409,
|
|
771
|
+
approval_withdrawn: 409,
|
|
772
|
+
run_ended: 409,
|
|
773
|
+
run_running: 409,
|
|
774
|
+
approval_pending: 409,
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* An ApiError for any error: the runtime's codes get their status, and anything else is a 500.
|
|
779
|
+
* A 500 answers only that something went wrong: its message may name internal details (a
|
|
780
|
+
* database host, say), so the detail goes to the log (`toApiError`), not the caller.
|
|
781
|
+
*/
|
|
782
|
+
export function asApiError(err: unknown): ApiError {
|
|
783
|
+
if (err instanceof ApiError) return err;
|
|
784
|
+
const failure = err as { name?: string; code?: string; problem?: string } | null;
|
|
785
|
+
// These two boundaries deliberately discard provider errors. Reconstruct their safe reason
|
|
786
|
+
// rather than forwarding a message/cause that could include submitted authentication data.
|
|
787
|
+
if (failure?.name === "AuthenticationError") {
|
|
788
|
+
const problems = [
|
|
789
|
+
"missing",
|
|
790
|
+
"expired",
|
|
791
|
+
"revoked",
|
|
792
|
+
"rejected",
|
|
793
|
+
"wrong_account",
|
|
794
|
+
"scope_changed",
|
|
795
|
+
"uncertain",
|
|
796
|
+
"unavailable",
|
|
797
|
+
"unsupported",
|
|
798
|
+
];
|
|
799
|
+
const problem = problems.includes(failure.problem ?? "") ? failure.problem! : "unavailable";
|
|
800
|
+
return new ApiError(400, { error: `Authentication: ${problem.replaceAll("_", " ")}` });
|
|
801
|
+
}
|
|
802
|
+
if (failure?.name === "SecretStoreError") {
|
|
803
|
+
const codes = [
|
|
804
|
+
"invalid_configuration",
|
|
805
|
+
"unavailable",
|
|
806
|
+
"denied",
|
|
807
|
+
"conflict",
|
|
808
|
+
"read_only",
|
|
809
|
+
"unsupported",
|
|
810
|
+
"too_large",
|
|
811
|
+
"invalid_value",
|
|
812
|
+
];
|
|
813
|
+
const reason = codes.includes(failure.code ?? "") ? failure.code! : "unavailable";
|
|
814
|
+
return new ApiError(reason === "conflict" ? 409 : 400, { error: `Secret store: ${reason.replaceAll("_", " ")}` });
|
|
815
|
+
}
|
|
816
|
+
// A collection's record changed since the caller read it (`ifRecord`), or there already
|
|
817
|
+
// (`ifAbsent`): the caller's to resolve, with the record as it stands when the error carries it,
|
|
818
|
+
// or, for a batch, each entry's.
|
|
819
|
+
const vendorCode = vendorCodeOf(err);
|
|
820
|
+
if (vendorCode === "record_changed" || vendorCode === "record_exists") {
|
|
821
|
+
const { current, conflicts } = err as Pick<ErrorResponse, "current" | "conflicts">;
|
|
822
|
+
return new ApiError(409, {
|
|
823
|
+
error: errorMessage(err),
|
|
824
|
+
code: vendorCode,
|
|
825
|
+
...(current !== undefined && { current }),
|
|
826
|
+
...(Array.isArray(conflicts) && { conflicts }),
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
const code = errorCode(err);
|
|
830
|
+
const status = (code && STATUS[code]) || 500;
|
|
831
|
+
if (status === 500) return new ApiError(500, { error: "Something went wrong", ...(code ? { code } : {}) });
|
|
832
|
+
const body: ErrorResponse = { error: errorMessage(err), code };
|
|
833
|
+
// Read by property, not instanceof: DBOS hands a run's errors back as copies.
|
|
834
|
+
const data: Record<string, unknown> = (err as Partial<SanomaError>).data ?? {};
|
|
835
|
+
if (Array.isArray(data.issues)) body.issues = data.issues as InputIssue[];
|
|
836
|
+
// A batch's refusal names every entry the policy denied, saves and deletes alike.
|
|
837
|
+
if (code === "policy_denied" && Array.isArray(data.denied)) body.denied = data.denied.map(String);
|
|
838
|
+
if (typeof data.field === "string") body.field = data.field;
|
|
839
|
+
if (code === "not_approver") {
|
|
840
|
+
body.approver = data.approver as ErrorResponse["approver"];
|
|
841
|
+
if (typeof data.reason === "string") body.reason = data.reason;
|
|
842
|
+
}
|
|
843
|
+
if ((code === "approval_pending" || code === "run_running") && typeof data.runId === "string")
|
|
844
|
+
body.runId = data.runId;
|
|
845
|
+
return new ApiError(status, body);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* What `.result` answers for a run that failed or was cancelled: the runtime's answer when its
|
|
850
|
+
* error has a code with a status of its own (`policy_denied`, 403), else a 422 with the run's
|
|
851
|
+
* failure as the run recorded it and its code (`driver_failed`), if any. The failure is the
|
|
852
|
+
* run's answer, so the caller sees it (a 500 would hide it, and a client would try again).
|
|
853
|
+
*/
|
|
854
|
+
export function runFailure(run: Pick<RunSummary, "runId" | "status" | "error">, err: unknown): ApiError {
|
|
855
|
+
const answered = asApiError(err);
|
|
856
|
+
if (answered.status < 500) return answered;
|
|
857
|
+
const code = errorCode(err);
|
|
858
|
+
const error = run.error ?? `Run ${run.runId} ${run.status === "cancelled" ? "was cancelled" : "failed"}`;
|
|
859
|
+
return new ApiError(422, { error, ...(code && { code }), runId: run.runId });
|
|
860
|
+
}
|
|
861
|
+
|
|
678
862
|
/** A run's short name, for a title: "Run" and its id's first 8 characters (a UUID's first group). */
|
|
679
863
|
export const runName = (runId: string) => `Run ${runId.slice(runId.lastIndexOf(":") + 1).slice(0, 8)}`;
|
|
680
864
|
|