sanoma 0.11.21 → 0.11.22
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 +2 -0
- package/app/README.md +2 -2
- package/app/dist/api.d.ts +16 -2
- package/app/dist/api.js +1 -1
- package/app/dist/client/assets/ArrowDown.es-BOfBLlTP.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/Copy.es-CvUujKw7.js +1 -0
- package/app/dist/client/assets/DialogTitle-Dz3loDe5.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-C4bMZ73g.js +1 -0
- package/app/dist/client/assets/_id-CUaJYD_3.js +1 -0
- package/app/dist/client/assets/_id-DRetx-BJ.js +1 -0
- package/app/dist/client/assets/_id-mm7bTIIl.js +2 -0
- package/app/dist/client/assets/_id-tN6nFEpD.js +1 -0
- package/app/dist/client/assets/_name-BOi2qVWk.js +1 -0
- package/app/dist/client/assets/_name-CBI1waPs.js +4 -0
- package/app/dist/client/assets/_name-CrsiaFT6.js +1 -0
- package/app/dist/client/assets/_name-TzQfjXo8.js +1 -0
- package/app/dist/client/assets/_vendor-C3TGvx4w.js +1 -0
- package/app/dist/client/assets/_vendor-sHwAlFSF.js +1 -0
- package/app/dist/client/assets/app-chrome-_ahvxx73.js +5 -0
- package/app/dist/client/assets/app-scope-Bht7PIkQ.js +1 -0
- package/app/dist/client/assets/approval-BFFM_yEl.js +1 -0
- package/app/dist/client/assets/apps-CpdXjc1j.js +1 -0
- package/app/dist/client/assets/button-D5kdANef.js +1 -0
- package/app/dist/client/assets/change-glance-CdkbSGxZ.js +1 -0
- package/app/dist/client/assets/changes-C_K2tazO.js +1 -0
- package/app/dist/client/assets/changes-DFcdyDL_.js +1 -0
- package/app/dist/client/assets/chat-Djbdaxw8.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-DHOhx6Zn.js +3 -0
- package/app/dist/client/assets/composite-9cNA7N0P.js +1 -0
- package/app/dist/client/assets/connect-DHUdrwwW.js +1 -0
- package/app/dist/client/assets/connections-fGNKJl3J.js +5 -0
- package/app/dist/client/assets/connectors-CuS1paNm.js +1 -0
- package/app/dist/client/assets/credentials-Cb7Lnfxk.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-DZ-ufRXn.js +1 -0
- package/app/dist/client/assets/decidable-OFQBEcco.js +1 -0
- package/app/dist/client/assets/declaration-form-D2ZMEVC6.js +1 -0
- package/app/dist/client/assets/dialog-B5pmfCdJ.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-BaPrTDs8.js +1 -0
- package/app/dist/client/assets/fence-CMhOJv7H.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-B5TYhcqD.js +7 -0
- package/app/dist/client/assets/grid-diff-wo26YSgM.js +1 -0
- package/app/dist/client/assets/held-card-HrJ6QpRY.js +1 -0
- package/app/dist/client/assets/highlighted-body-JLMTFACH-CjeaSnZq.js +1 -0
- package/app/dist/client/assets/hosting-Beoi95m6.js +1 -0
- package/app/dist/client/assets/html-BHZv6uqE.js +1 -0
- package/app/dist/client/assets/import-8WDFPfe6.js +1 -0
- package/app/dist/client/assets/inbox-B9hsZPsC.js +1 -0
- package/app/dist/client/assets/inbox-DM2npRZI.js +1 -0
- package/app/dist/client/assets/index-CHKfukjt.js +10 -0
- package/app/dist/client/assets/item-B4QRpXse.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-n8CE0xEs.js +1 -0
- package/app/dist/client/assets/lazyRouteComponent-DezoGNoN.js +1 -0
- package/app/dist/client/assets/markdown-BYOwaDjH.js +1 -0
- package/app/dist/client/assets/markdown-DS_nKu0s.js +164 -0
- package/app/dist/client/assets/mermaid-WFAXDIZX-DQBKIf0O.js +1 -0
- package/app/dist/client/assets/motion-D6e1hqz4.js +1 -0
- package/app/dist/client/assets/people-BiiQfYJ8.js +1 -0
- package/app/dist/client/assets/permissions-BmKxEfBi.js +2 -0
- package/app/dist/client/assets/permissions-grid-B755bq5J.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-DGlVu9wp.js +57 -0
- package/app/dist/client/assets/react-dom-D6fTz1bt.js +1 -0
- package/app/dist/client/assets/route-BSe5L2p4.js +1 -0
- package/app/dist/client/assets/route-Ds87ixtB.js +1 -0
- package/app/dist/client/assets/runs-table-DMiD4HeY.js +1 -0
- package/app/dist/client/assets/scenario-DrgmfuFx.js +1 -0
- package/app/dist/client/assets/scenario-graph-Blv2e1PV.js +1 -0
- package/app/dist/client/assets/separator-Bdtc7rou.js +1 -0
- package/app/dist/client/assets/{sheet-BYL9XU5s.js → sheet-BKUFUA1l.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-K4mrFsLr.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-CJ6VmNPY.js +1 -0
- package/app/dist/client/assets/store-BT988jIX.js +1 -0
- package/app/dist/client/assets/style-CTcG_5y0.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-BQd5yMlA.js → useLoaderData-BsksXf-p.js} +1 -1
- package/app/dist/client/assets/useOpenInteractionType-UhakpAXY.js +1 -0
- package/app/dist/client/assets/useRegisterFieldControl-DIkKUJkh.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-DUoVqvfP.js +1 -0
- package/app/dist/client/assets/workflow-lQtyyxKx.js +1 -0
- package/app/dist/client/assets/workflow-view-hk_RU9WF.js +1 -0
- package/app/dist/client/assets/workflows-DFB7lzzN.js +1 -0
- package/app/dist/client/assets/yaml-rwi0_p6S.js +1 -0
- package/app/dist/index.d.ts +4 -4
- package/app/dist/lib/chat.d.ts +64 -19
- package/app/dist/lib/chat.js +54 -18
- package/app/dist/lib/chat.js.map +1 -1
- package/app/dist/server/assets/{_id-wuJIq2ZZ.js → _id--MWJXj9R.js} +2 -2
- package/app/dist/server/assets/{_id-ce1EGp7Y.js → _id-BEGe86NW.js} +2 -2
- package/app/dist/server/assets/{_id-BViXAagq.js → _id-CbO7Ok0w.js} +12 -10
- package/app/dist/server/assets/{_id-Dt9tTylX.js → _id-DwdpIYKk.js} +2 -2
- package/app/dist/server/assets/{_id-wB8khGTz.js → _id-fK_nPFHK.js} +6 -6
- package/app/dist/server/assets/{_name-D_-MhjNf.js → _name-BzD9TxVC.js} +17 -17
- package/app/dist/server/assets/{_name-BqFwnyf7.js → _name-ClgMsl5m.js} +2 -2
- package/app/dist/server/assets/{_name-BGagGBjX.js → _name-DdFVsjcj.js} +7 -7
- package/app/dist/server/assets/{_name-DntbHE-b.js → _name-Dyh4G9Oy.js} +10 -11
- package/app/dist/server/assets/{_tanstack-start-manifest_v-BljuBM-G.js → _tanstack-start-manifest_v-DUtnBg7y.js} +101 -91
- package/app/dist/server/assets/{_vendor-CNB03LWX.js → _vendor-DyeUY8kH.js} +8 -8
- package/app/dist/server/assets/{_vendor-CcEviOki.js → _vendor-W3KKSusM.js} +2 -2
- package/app/dist/server/assets/{actor-D6iA0pDg.js → actor-BlaOwG6A.js} +1 -1
- package/app/dist/server/assets/app-chrome-BJlxsc9y.js +2116 -0
- package/app/dist/server/assets/{app-scope-CXIgOFmi.js → app-scope-ASuhE3xI.js} +2 -2
- package/app/dist/server/assets/{apply-plan-ybBda6vQ.js → apply-plan-Djw1tNPD.js} +8 -7
- package/app/dist/server/assets/{approval-Su315ikC.js → approval-BjTnfr1U.js} +15 -13
- package/app/dist/server/assets/{apps-xwQAehch.js → apps-C28F9Y5C.js} +7 -7
- package/app/dist/server/assets/button-Xwx3rpQ0.js +43 -0
- package/app/dist/server/assets/change-glance-Bc4htVPy.js +54 -0
- package/app/dist/server/assets/{change-glance-CpArIbGS.js → changes-B5P8BJSf.js} +2 -54
- package/app/dist/server/assets/{changes-Bc_OiDBD.js → changes-tbeMKxjY.js} +8 -7
- package/app/dist/server/assets/{chat-DMN_hoKm.js → chat-BNMeLc9V.js} +108 -30
- 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-DpZcJvCy.js} +26 -24
- package/app/dist/server/assets/{connect-BpPiu5s6.js → connect-Cljunav2.js} +11 -10
- package/app/dist/server/assets/{connections-DBgb1bvX.js → connections-Cfz5LMy5.js} +12 -11
- package/app/dist/server/assets/{connectors-5a5_SlHO.js → connectors-tt9BF9L1.js} +8 -8
- package/app/dist/server/assets/{credentials-ud_Y68hx.js → credentials-CYUFAVU8.js} +10 -9
- package/app/dist/server/assets/{data-aEdhwcqy.js → data-D91ZZ5St.js} +7 -7
- package/app/dist/server/assets/{declaration-form-Dfg1yNuY.js → declaration-form-BzISD6gw.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-BZym0xE2.js} +8 -7
- package/app/dist/server/assets/fence-Br7MPP41.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-sf07C1qn.js} +2 -2
- package/app/dist/server/assets/{graph-qYOdoz2s.js → graph-C1Cl7owl.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-CDewk4rs.js +75 -0
- package/app/dist/server/assets/{hosting-bbn9UvDc.js → hosting-O-l2L0ec.js} +16 -14
- package/app/dist/server/assets/{import-DIwvzHb6.js → import-qvpEIYFx.js} +8 -8
- package/app/dist/server/assets/{inbox-D6R6sWBB.js → inbox-BcJxCIPm.js} +8 -8
- package/app/dist/server/assets/{inbox-Dj-5FleF.js → inbox-BvpSeC3M.js} +2 -2
- 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-DlT_THim.js} +2 -2
- package/app/dist/server/assets/markdown-BExKjghi.js +116 -0
- package/app/dist/server/assets/{middleware-B8JRLyxx.js → middleware-B6RPW0fH.js} +1 -1
- package/app/dist/server/assets/{people-CkU_AxrV.js → people-C8VXQrKg.js} +13 -12
- package/app/dist/server/assets/{permissions-BfMcQqQb.js → permissions-COAiOoCB.js} +9 -8
- package/app/dist/server/assets/{permissions-grid-DWP9FAAS.js → permissions-grid-CcYUiqhD.js} +4 -4
- package/app/dist/server/assets/{button-f9Lc8qLl.js → queries-DJcZ4mzA.js} +3 -45
- package/app/dist/server/assets/{route-BTT7nMJq.js → route-DOqitvxL.js} +2 -2
- package/app/dist/server/assets/{route-CF_8jQYY.js → route-aa9MThMA.js} +2 -2
- package/app/dist/server/assets/{router-BvYtxrVN.js → router-Co6gRNI1.js} +80 -46
- package/app/dist/server/assets/{runs-table-BBudn12Y.js → runs-table-BtGm2KOO.js} +6 -6
- package/app/dist/server/assets/{scenario-BXGTSTiP.js → scenario-DidUafqw.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-1l0BtgVf.js → sites.index-4TK8c0QC.js} +4 -4
- package/app/dist/server/assets/{spinner-C1ZW08lp.js → spinner-016IPVi-.js} +1 -1
- package/app/dist/server/assets/{start-CSU4irVK.js → start-VfVsXenI.js} +2 -2
- package/app/dist/server/assets/{start-form-DI60UOrc.js → start-form-CUeEdeP7.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-DW5qmIzp.js} +8 -7
- package/app/dist/server/assets/{workflow-Z99QWO42.js → workflow-BRu7ljgU.js} +5 -5
- package/app/dist/server/assets/{workflow-view-C8X8U11S.js → workflow-view-yF48p1lu.js} +14 -13
- package/app/dist/server/assets/{workflows-C0kJoGf1.js → workflows-DL-TJFLt.js} +13 -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/server.js +48 -48
- 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 +35 -14
- 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/stylesheet.json +1 -1
- package/app/src/api.ts +1 -1
- package/app/src/components/app-chrome.tsx +28 -13
- package/app/src/components/common.tsx +1 -24
- package/app/src/components/logo.tsx +25 -0
- 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/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 +9 -1
- package/app/src/components/shell/thread.tsx +174 -0
- 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/trace.tsx +133 -0
- package/app/src/hooks/use-highlighted-code.ts +72 -0
- package/app/src/index.ts +4 -4
- package/app/src/lib/chat.ts +110 -22
- package/app/src/lib/cn-tables.ts +23 -23
- package/app/src/lib/highlighter.tsx +114 -0
- package/app/src/routes/__root.tsx +7 -4
- package/app/src/routes/connectors/index.tsx +1 -1
- package/app/src/routes/hosting/index.tsx +6 -9
- package/app/src/server/chat.ts +41 -19
- 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 +42 -14
- package/app/src/steps/agent/transcript.ts +90 -3
- package/app/src/steps/agent/turn.ts +18 -16
- package/app/src/worker/app.ts +6 -5
- package/dist/cli.js +18 -6
- package/dist/cli.js.map +1 -1
- package/dist/serve.js +1 -1
- package/dist/serve.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/package.json +7 -3
- package/testing/README.md +3 -3
- 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 +34 -21
- package/testing/dist/host.js +135 -75
- package/testing/dist/host.js.map +1 -1
- package/workflows/CLOUD-IDENTITY.md +15 -20
- package/workflows/README.md +9 -7
- package/workflows/dist/client.d.ts +5 -3
- package/workflows/dist/client.js +4 -3
- 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/config.d.ts +7 -1
- package/workflows/dist/config.js +24 -1
- package/workflows/dist/config.js.map +1 -1
- package/workflows/dist/db/company.d.ts +1 -1
- package/workflows/dist/db/company.js +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/deadlines.d.ts +7 -2
- package/workflows/dist/deadlines.js +14 -5
- package/workflows/dist/deadlines.js.map +1 -1
- package/workflows/dist/describe.js +15 -3
- package/workflows/dist/describe.js.map +1 -1
- package/workflows/dist/description.d.ts +37 -2
- package/workflows/dist/description.js +22 -1
- package/workflows/dist/description.js.map +1 -1
- package/workflows/dist/host.d.ts +7 -6
- 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/index.d.ts +3 -3
- package/workflows/dist/index.js +1 -1
- package/workflows/dist/index.js.map +1 -1
- package/workflows/dist/op.d.ts +92 -1
- package/workflows/dist/op.js +19 -6
- package/workflows/dist/op.js.map +1 -1
- package/workflows/dist/renewal.d.ts +1 -1
- package/workflows/dist/renewal.js +1 -1
- package/workflows/dist/runtime-ops.d.ts +3 -4
- package/workflows/dist/runtime-ops.js +4 -4
- package/workflows/dist/runtime-ops.js.map +1 -1
- package/workflows/dist/schedules.d.ts +1 -1
- package/workflows/dist/schedules.js +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/vendor-info.d.ts +12 -3
- package/workflows/dist/vendor-info.js +20 -4
- package/workflows/dist/vendor-info.js.map +1 -1
- package/workflows/dist/worker.d.ts +11 -1
- package/workflows/dist/worker.js +9 -3
- package/workflows/dist/worker.js.map +1 -1
- package/workflows/src/client.ts +9 -6
- package/workflows/src/cloud-identity.ts +7 -4
- package/workflows/src/config.ts +36 -1
- package/workflows/src/db/company.ts +1 -1
- package/workflows/src/db/identity.ts +2 -2
- package/workflows/src/deadlines.ts +18 -8
- package/workflows/src/describe.ts +16 -3
- package/workflows/src/description.ts +25 -1
- package/workflows/src/host.ts +7 -6
- package/workflows/src/identity-provisioning.ts +19 -30
- package/workflows/src/index.ts +7 -1
- package/workflows/src/op.ts +104 -10
- package/workflows/src/renewal.ts +1 -1
- package/workflows/src/runtime-ops.ts +5 -5
- package/workflows/src/schedules.ts +1 -1
- package/workflows/src/supervisor.ts +40 -38
- package/workflows/src/vendor-info.ts +20 -5
- package/workflows/src/worker.ts +22 -5
- 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/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/native-select-DLa-He0n.js +0 -37
- package/app/dist/server/assets/utils-wksS9pYh.js +0 -138
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { Link } from "@tanstack/react-router";
|
|
3
|
+
import { Badge } from "#/components/ui/badge.tsx";
|
|
4
|
+
import { Button } from "#/components/ui/button.tsx";
|
|
5
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "#/components/ui/collapsible.tsx";
|
|
6
|
+
import {
|
|
7
|
+
Item,
|
|
8
|
+
ItemActions,
|
|
9
|
+
ItemContent,
|
|
10
|
+
ItemDescription,
|
|
11
|
+
ItemGroup,
|
|
12
|
+
ItemMedia,
|
|
13
|
+
ItemTitle,
|
|
14
|
+
} from "#/components/ui/item.tsx";
|
|
15
|
+
import { DECLARE_BOX } from "../../api.ts";
|
|
16
|
+
import { boxless, enginesHere, enginesOf, MODEL_CONNECTOR } from "../../lib/chat.ts";
|
|
17
|
+
import { configQuery } from "../../queries.ts";
|
|
18
|
+
import { ButtonLink } from "../kit.tsx";
|
|
19
|
+
import { EngineMark } from "./engine-mark.tsx";
|
|
20
|
+
|
|
21
|
+
// The empty chat while the person's agent is not connected, and when the menu's Agent… opens it:
|
|
22
|
+
// the ways to connect it, as cards, the person's own Claude plan first.
|
|
23
|
+
|
|
24
|
+
/** The agents with a card of their own: the rest of a person's own are under More agents. */
|
|
25
|
+
const CLAUDE = "claude-code";
|
|
26
|
+
const CODEX = "codex";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The cards, each with its agent's mark: Your Claude plan (its sign-in starts at once; on a live
|
|
30
|
+
* instance that declares no box, what to declare instead, `DECLARE_BOX`), Your ChatGPT plan
|
|
31
|
+
* through Codex (on a live instance, where OpenAI's plan sign-in does not reach, an OpenAI API key,
|
|
32
|
+
* which is not offered yet), an API key on the model's connector page (`vendor`'s, else the
|
|
33
|
+
* Anthropic connector to add), and More agents, the rest the chat can open on here
|
|
34
|
+
* (`enginesHere`). An agent has its card only when a connector of the company gives it on a
|
|
35
|
+
* person's own plan (`ConfigDescription.agents`): a turn on any other fails. `onChoose` gets the
|
|
36
|
+
* engine chosen: the chat opens on it and keeps it for the person's new chats.
|
|
37
|
+
*/
|
|
38
|
+
export function ConnectAgent({ vendor, onChoose }: { vendor?: string; onChoose: (engine: string) => void }) {
|
|
39
|
+
const { data: config } = useQuery(configQuery());
|
|
40
|
+
const live = config?.place === "live";
|
|
41
|
+
const noBox = config !== undefined && boxless(config);
|
|
42
|
+
// The own plans the chat can open on here; with no box, Claude's still has its card, saying what to declare.
|
|
43
|
+
const own = config ? enginesHere(config).filter((engine) => engine.plan === "own") : [];
|
|
44
|
+
const claude = (noBox ? enginesOf(config.agents) : own).find((e) => e.plan === "own" && e.agent === CLAUDE);
|
|
45
|
+
const codex = own.find((engine) => engine.agent === CODEX);
|
|
46
|
+
const more = own.filter((engine) => engine !== claude && engine !== codex);
|
|
47
|
+
return (
|
|
48
|
+
<div className="flex flex-col gap-3">
|
|
49
|
+
<div className="flex flex-col gap-1.5">
|
|
50
|
+
<h2 className="font-display text-2xl">Connect your agent</h2>
|
|
51
|
+
<p className="text-muted-foreground">
|
|
52
|
+
The agent makes every change: you ask in plain words, it drafts the change and checks it, and you save it. It
|
|
53
|
+
runs on a plan you already pay for, or an API key.
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
<ItemGroup className="gap-2">
|
|
57
|
+
{claude && (
|
|
58
|
+
<Item variant="outline" className="border-primary bg-card">
|
|
59
|
+
<ItemMedia>
|
|
60
|
+
<EngineMark engine={claude} />
|
|
61
|
+
</ItemMedia>
|
|
62
|
+
<ItemContent>
|
|
63
|
+
<ItemTitle>
|
|
64
|
+
Your Claude plan <Badge variant="secondary">Recommended</Badge>
|
|
65
|
+
</ItemTitle>
|
|
66
|
+
<ItemDescription>
|
|
67
|
+
{noBox ? `${DECLARE_BOX}.` : "Pro or Max. Sign in once in your browser; nothing extra to pay."}
|
|
68
|
+
</ItemDescription>
|
|
69
|
+
</ItemContent>
|
|
70
|
+
{!noBox && (
|
|
71
|
+
<Button className="w-full" onClick={() => onChoose(claude.name)}>
|
|
72
|
+
Sign in with Claude
|
|
73
|
+
</Button>
|
|
74
|
+
)}
|
|
75
|
+
</Item>
|
|
76
|
+
)}
|
|
77
|
+
{!codex ? null : live ? (
|
|
78
|
+
<Item variant="outline" className="bg-card">
|
|
79
|
+
<ItemMedia>
|
|
80
|
+
<EngineMark engine={codex} />
|
|
81
|
+
</ItemMedia>
|
|
82
|
+
<ItemContent>
|
|
83
|
+
<ItemTitle>An OpenAI API key</ItemTitle>
|
|
84
|
+
<ItemDescription>
|
|
85
|
+
For Codex: not offered here yet. Your ChatGPT plan signs in on your computer.
|
|
86
|
+
</ItemDescription>
|
|
87
|
+
</ItemContent>
|
|
88
|
+
</Item>
|
|
89
|
+
) : (
|
|
90
|
+
<Item variant="outline" className="bg-card">
|
|
91
|
+
<ItemMedia>
|
|
92
|
+
<EngineMark engine={codex} />
|
|
93
|
+
</ItemMedia>
|
|
94
|
+
<ItemContent>
|
|
95
|
+
<ItemTitle>Your ChatGPT plan</ItemTitle>
|
|
96
|
+
<ItemDescription>Plus or Pro, through Codex</ItemDescription>
|
|
97
|
+
</ItemContent>
|
|
98
|
+
<ItemActions>
|
|
99
|
+
<Button variant="outline" size="sm" onClick={() => onChoose(codex.name)}>
|
|
100
|
+
Sign in
|
|
101
|
+
</Button>
|
|
102
|
+
</ItemActions>
|
|
103
|
+
</Item>
|
|
104
|
+
)}
|
|
105
|
+
<Item variant="outline" className="bg-card">
|
|
106
|
+
<ItemContent>
|
|
107
|
+
<ItemTitle>An API key</ItemTitle>
|
|
108
|
+
<ItemDescription>Anthropic, billed for what you use</ItemDescription>
|
|
109
|
+
</ItemContent>
|
|
110
|
+
<ItemActions>
|
|
111
|
+
<ButtonLink variant="outline" size="sm">
|
|
112
|
+
{vendor ? (
|
|
113
|
+
<Link to="/connectors/$vendor" params={{ vendor }} onClick={() => onChoose("loop")}>
|
|
114
|
+
Add key
|
|
115
|
+
</Link>
|
|
116
|
+
) : (
|
|
117
|
+
<Link to="/connectors" search={{ add: MODEL_CONNECTOR }} onClick={() => onChoose("loop")}>
|
|
118
|
+
Add key
|
|
119
|
+
</Link>
|
|
120
|
+
)}
|
|
121
|
+
</ButtonLink>
|
|
122
|
+
</ItemActions>
|
|
123
|
+
</Item>
|
|
124
|
+
</ItemGroup>
|
|
125
|
+
<Collapsible className="flex flex-col gap-2">
|
|
126
|
+
<p className="text-xs text-muted-foreground">
|
|
127
|
+
{more.length > 0 && (
|
|
128
|
+
<>
|
|
129
|
+
Other agents ({more.map((engine) => engine.title).join(", ")}) are under{" "}
|
|
130
|
+
<CollapsibleTrigger className="underline underline-offset-4">More agents</CollapsibleTrigger>.{" "}
|
|
131
|
+
</>
|
|
132
|
+
)}
|
|
133
|
+
Change it any time under Agent… in your menu.
|
|
134
|
+
</p>
|
|
135
|
+
<CollapsibleContent>
|
|
136
|
+
<ItemGroup className="gap-2">
|
|
137
|
+
{more.map((engine) => (
|
|
138
|
+
<Item key={engine.name} variant="outline" size="xs" className="bg-card">
|
|
139
|
+
<ItemMedia>
|
|
140
|
+
<EngineMark engine={engine} />
|
|
141
|
+
</ItemMedia>
|
|
142
|
+
<ItemContent>
|
|
143
|
+
<ItemTitle>{engine.title}</ItemTitle>
|
|
144
|
+
</ItemContent>
|
|
145
|
+
<ItemActions>
|
|
146
|
+
<Button variant="outline" size="sm" onClick={() => onChoose(engine.name)}>
|
|
147
|
+
Sign in
|
|
148
|
+
</Button>
|
|
149
|
+
</ItemActions>
|
|
150
|
+
</Item>
|
|
151
|
+
))}
|
|
152
|
+
</ItemGroup>
|
|
153
|
+
</CollapsibleContent>
|
|
154
|
+
</Collapsible>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Logo } from "#/components/logo.tsx";
|
|
2
|
+
import sanoma from "../../icon-small.svg?url";
|
|
3
|
+
import type { EngineOption } from "../../lib/chat.ts";
|
|
4
|
+
|
|
5
|
+
/** An engine's mark, beside its label: its agent's, from its connector, or Sanoma's for our loop. */
|
|
6
|
+
export function EngineMark({ engine }: { engine: EngineOption }) {
|
|
7
|
+
const mark = engine.agent === "loop" ? { src: sanoma } : engine.mark;
|
|
8
|
+
return mark ? <Logo {...mark} alt="" /> : null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeBlock,
|
|
3
|
+
CodeBlockActions,
|
|
4
|
+
CodeBlockContent,
|
|
5
|
+
CodeBlockCopyButton,
|
|
6
|
+
CodeBlockLine,
|
|
7
|
+
} from "#/components/ui/code-block.tsx";
|
|
8
|
+
import { useHighlightedCode } from "#/hooks/use-highlighted-code.ts";
|
|
9
|
+
|
|
10
|
+
/** A fenced block in a reply: its lines plain until the highlighter and its language have loaded. */
|
|
11
|
+
export default function Fence({ text, language }: { text: string; language: string }) {
|
|
12
|
+
const lines = useHighlightedCode(text, language);
|
|
13
|
+
return (
|
|
14
|
+
<CodeBlock>
|
|
15
|
+
<CodeBlockActions>
|
|
16
|
+
<CodeBlockCopyButton value={text} />
|
|
17
|
+
</CodeBlockActions>
|
|
18
|
+
<CodeBlockContent>
|
|
19
|
+
{lines.map((line, i) => (
|
|
20
|
+
<CodeBlockLine key={i}>{line}</CodeBlockLine>
|
|
21
|
+
))}
|
|
22
|
+
</CodeBlockContent>
|
|
23
|
+
</CodeBlock>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { approverLabel } from "sanoma/workflows/shared";
|
|
2
|
+
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
3
|
+
import { Link } from "@tanstack/react-router";
|
|
4
|
+
import { Card, CardContent, CardFooter, CardHeader } from "#/components/ui/card.tsx";
|
|
5
|
+
import { Spinner } from "#/components/ui/spinner.tsx";
|
|
6
|
+
import { useActor } from "../../actor.ts";
|
|
7
|
+
import { pendingApprovals } from "../../api.ts";
|
|
8
|
+
import { decidableBy } from "../../lib/decidable.ts";
|
|
9
|
+
import { approvalKey, configQuery, runQuery } from "../../queries.ts";
|
|
10
|
+
import { ApprovalDecision, ApprovalDetails } from "../approval.tsx";
|
|
11
|
+
import { CardHeading } from "../kit.tsx";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A held lookup: the Inbox's approval card while you may decide it, else who it waits for with a
|
|
15
|
+
* link to the Inbox; once decided, its status.
|
|
16
|
+
*/
|
|
17
|
+
export default function HeldCard({ runId }: { runId: string }) {
|
|
18
|
+
const { actor, groups } = useActor();
|
|
19
|
+
const { data: people } = useSuspenseQuery({ ...configQuery(), select: (config) => config.resources });
|
|
20
|
+
const { data } = useQuery(runQuery(runId));
|
|
21
|
+
if (!data) {
|
|
22
|
+
return (
|
|
23
|
+
<p className="flex items-center gap-2 text-muted-foreground">
|
|
24
|
+
<Spinner /> Asking for an approval…
|
|
25
|
+
</p>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
const { run } = data;
|
|
29
|
+
const approval = pendingApprovals(data)[0] ?? data.approvals.at(-1);
|
|
30
|
+
if (!approval) return null;
|
|
31
|
+
const entry = { run, approval };
|
|
32
|
+
if (approval.status === "pending" && decidableBy(actor, groups, people)([entry]).length === 0) {
|
|
33
|
+
return (
|
|
34
|
+
<p className="text-muted-foreground">
|
|
35
|
+
Waiting for {approverLabel(approval.approver)}:{" "}
|
|
36
|
+
<Link to="/inbox" search={{ approval: approvalKey(entry) }} className="underline underline-offset-4">
|
|
37
|
+
in the Inbox
|
|
38
|
+
</Link>
|
|
39
|
+
.
|
|
40
|
+
</p>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return (
|
|
44
|
+
<Card size="sm" role="region" aria-label={approval.title}>
|
|
45
|
+
<CardHeader>
|
|
46
|
+
<CardHeading>{approval.title}</CardHeading>
|
|
47
|
+
</CardHeader>
|
|
48
|
+
<CardContent className="flex flex-col gap-3">
|
|
49
|
+
<ApprovalDetails run={run} approval={approval} showRun />
|
|
50
|
+
</CardContent>
|
|
51
|
+
{approval.status === "pending" && (
|
|
52
|
+
<CardFooter className="flex-wrap gap-2">
|
|
53
|
+
<ApprovalDecision run={run} approval={approval} />
|
|
54
|
+
</CardFooter>
|
|
55
|
+
)}
|
|
56
|
+
</Card>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { CatchBoundary } from "@tanstack/react-router";
|
|
2
|
+
import { createElement, type ElementType, lazy, Suspense } from "react";
|
|
3
|
+
import {
|
|
4
|
+
type Components,
|
|
5
|
+
defaultComponents,
|
|
6
|
+
defaultRehypePlugins,
|
|
7
|
+
type LinkSafetyModalProps,
|
|
8
|
+
Streamdown,
|
|
9
|
+
} from "streamdown";
|
|
10
|
+
import { Button } from "#/components/ui/button.tsx";
|
|
11
|
+
import { CodeBlock, CodeBlockContent } from "#/components/ui/code-block.tsx";
|
|
12
|
+
import {
|
|
13
|
+
Dialog,
|
|
14
|
+
DialogClose,
|
|
15
|
+
DialogContent,
|
|
16
|
+
DialogDescription,
|
|
17
|
+
DialogFooter,
|
|
18
|
+
DialogHeader,
|
|
19
|
+
DialogTitle,
|
|
20
|
+
} from "#/components/ui/dialog.tsx";
|
|
21
|
+
import { Separator } from "#/components/ui/separator.tsx";
|
|
22
|
+
import { Table, TableCell, TableHead } from "#/components/ui/table.tsx";
|
|
23
|
+
import { cn } from "#/lib/utils.ts";
|
|
24
|
+
|
|
25
|
+
// A reply's text as Markdown, streamed (Streamdown closes what is still open), in the app's own
|
|
26
|
+
// classes: a company's Tailwind does not scan Streamdown's install, so every element it draws with
|
|
27
|
+
// a class of its own is given here, and `space-y-0` takes its root's away. No image is ever loaded:
|
|
28
|
+
// what a reply says can come from what the agent read, and an image's address would carry data out
|
|
29
|
+
// without anyone clicking. Links are Streamdown's hardened ones, asking before they open (bar an
|
|
30
|
+
// in-page anchor); a fenced block is the kit's CodeBlock, its highlighter and each language loaded
|
|
31
|
+
// the first time one is shown.
|
|
32
|
+
|
|
33
|
+
/** An element as `tag` with `className` after any a plugin gave it (a task list's), without the `node` Streamdown passes a component. */
|
|
34
|
+
const styled =
|
|
35
|
+
(tag: ElementType, className: string) =>
|
|
36
|
+
<Props extends { className?: string }>({ node: _node, ...props }: Props & { node?: unknown }) =>
|
|
37
|
+
createElement(tag, { ...props, className: cn(props.className, className) });
|
|
38
|
+
|
|
39
|
+
/** Shiki's core with it, so a reply with no code does not load it. */
|
|
40
|
+
const Fence = lazy(() => import("./fence.tsx"));
|
|
41
|
+
|
|
42
|
+
/** A fenced block's code. */
|
|
43
|
+
const FencedCode: Components["code"] = ({ node: _node, className, children }) => {
|
|
44
|
+
const text = typeof children === "string" ? children.replace(/\n$/, "") : undefined;
|
|
45
|
+
const plain = (
|
|
46
|
+
<CodeBlock>
|
|
47
|
+
<CodeBlockContent className={className}>{text ?? children}</CodeBlockContent>
|
|
48
|
+
</CodeBlock>
|
|
49
|
+
);
|
|
50
|
+
if (text === undefined) return plain;
|
|
51
|
+
// A chunk that does not come leaves the block plain, the rest of the reply as it is.
|
|
52
|
+
return (
|
|
53
|
+
<CatchBoundary getResetKey={() => "fence"} errorComponent={() => plain}>
|
|
54
|
+
<Suspense fallback={plain}>
|
|
55
|
+
<Fence text={text} language={className?.replace("language-", "") ?? ""} />
|
|
56
|
+
</Suspense>
|
|
57
|
+
</CatchBoundary>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const StreamdownLink = defaultComponents.a;
|
|
62
|
+
|
|
63
|
+
/** Before a link leaves the app: the agent wrote it, and a page it reads can steer what it writes. */
|
|
64
|
+
function LinkCheck({ url, isOpen, onClose, onConfirm }: LinkSafetyModalProps) {
|
|
65
|
+
return (
|
|
66
|
+
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
|
|
67
|
+
<DialogContent>
|
|
68
|
+
<DialogHeader>
|
|
69
|
+
<DialogTitle>Open this link?</DialogTitle>
|
|
70
|
+
<DialogDescription>The agent wrote it. It opens in a new tab.</DialogDescription>
|
|
71
|
+
</DialogHeader>
|
|
72
|
+
<p className="font-mono text-xs break-all">{url}</p>
|
|
73
|
+
<DialogFooter>
|
|
74
|
+
<DialogClose render={<Button variant="outline" />}>Cancel</DialogClose>
|
|
75
|
+
<Button
|
|
76
|
+
onClick={() => {
|
|
77
|
+
onConfirm();
|
|
78
|
+
onClose();
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
Open
|
|
82
|
+
</Button>
|
|
83
|
+
</DialogFooter>
|
|
84
|
+
</DialogContent>
|
|
85
|
+
</Dialog>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const LINK_SAFETY = { enabled: true, renderModal: (props: LinkSafetyModalProps) => <LinkCheck {...props} /> };
|
|
90
|
+
|
|
91
|
+
// Raw HTML is left out (its tags show as the text they are, as `Array<string>` must), so the
|
|
92
|
+
// sanitizer and Streamdown's hardening are the rest of its defaults.
|
|
93
|
+
const { sanitize, harden } = defaultRehypePlugins;
|
|
94
|
+
if (!sanitize || !harden) throw new Error("Streamdown no longer names its sanitize and harden plugins");
|
|
95
|
+
const PLUGINS = [sanitize, harden];
|
|
96
|
+
|
|
97
|
+
const HEADING = "mt-1 font-medium first:mt-0";
|
|
98
|
+
const TITLE = styled("h3", `${HEADING} text-base`);
|
|
99
|
+
const CELL = "h-auto border-b py-1 whitespace-normal";
|
|
100
|
+
|
|
101
|
+
const ELEMENTS: Components = {
|
|
102
|
+
h1: TITLE,
|
|
103
|
+
h2: TITLE,
|
|
104
|
+
h3: styled("h3", HEADING),
|
|
105
|
+
h4: styled("h4", HEADING),
|
|
106
|
+
h5: styled("h5", HEADING),
|
|
107
|
+
h6: styled("h6", HEADING),
|
|
108
|
+
ul: styled("ul", "flex list-disc flex-col gap-1 pl-5"),
|
|
109
|
+
ol: styled("ol", "flex list-decimal flex-col gap-1 pl-5"),
|
|
110
|
+
li: "li",
|
|
111
|
+
strong: styled("strong", "font-medium"),
|
|
112
|
+
// Streamdown's, so an unfinished link is not followed and a click asks first (`LINK_SAFETY`); only
|
|
113
|
+
// an in-page anchor, which leaves nothing, is a plain link, and one with no address is its text.
|
|
114
|
+
a: ({ node: _node, href, ...props }) =>
|
|
115
|
+
!href ? (
|
|
116
|
+
<span>{props.children}</span>
|
|
117
|
+
) : href.startsWith("#") ? (
|
|
118
|
+
<a {...props} href={href} />
|
|
119
|
+
) : (
|
|
120
|
+
<StreamdownLink
|
|
121
|
+
{...props}
|
|
122
|
+
href={href}
|
|
123
|
+
className="text-left font-normal text-current wrap-anywhere underline underline-offset-4"
|
|
124
|
+
/>
|
|
125
|
+
),
|
|
126
|
+
blockquote: styled("blockquote", "border-l pl-3 text-muted-foreground"),
|
|
127
|
+
hr: () => <Separator />,
|
|
128
|
+
inlineCode: styled("code", "rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.875em]"),
|
|
129
|
+
code: FencedCode,
|
|
130
|
+
table: ({ node: _node, ...props }) => <Table {...props} />,
|
|
131
|
+
thead: "thead",
|
|
132
|
+
tbody: "tbody",
|
|
133
|
+
tr: "tr",
|
|
134
|
+
th: styled(TableHead, CELL),
|
|
135
|
+
td: styled(TableCell, CELL),
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/** A reply's text: `live` while it is still streaming. */
|
|
139
|
+
export default function Markdown({ text, live }: { text: string; live: boolean }) {
|
|
140
|
+
return (
|
|
141
|
+
<Streamdown
|
|
142
|
+
className="flex min-w-0 flex-col gap-3 space-y-0 text-reply wrap-break-word"
|
|
143
|
+
components={ELEMENTS}
|
|
144
|
+
disallowedElements={["img"]}
|
|
145
|
+
isAnimating={live}
|
|
146
|
+
linkSafety={LINK_SAFETY}
|
|
147
|
+
rehypePlugins={PLUGINS}
|
|
148
|
+
>
|
|
149
|
+
{text}
|
|
150
|
+
</Streamdown>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -6,6 +6,7 @@ import { BuildingsIcon } from "@phosphor-icons/react/dist/csr/Buildings";
|
|
|
6
6
|
import { DesktopIcon } from "@phosphor-icons/react/dist/csr/Desktop";
|
|
7
7
|
import { MoonIcon } from "@phosphor-icons/react/dist/csr/Moon";
|
|
8
8
|
import { PlusIcon } from "@phosphor-icons/react/dist/csr/Plus";
|
|
9
|
+
import { SparkleIcon } from "@phosphor-icons/react/dist/csr/Sparkle";
|
|
9
10
|
import { SunIcon } from "@phosphor-icons/react/dist/csr/Sun";
|
|
10
11
|
import { UserIcon } from "@phosphor-icons/react/dist/csr/User";
|
|
11
12
|
import { UserCircleGearIcon } from "@phosphor-icons/react/dist/csr/UserCircleGear";
|
|
@@ -27,13 +28,15 @@ import {
|
|
|
27
28
|
} from "#/components/ui/dropdown-menu.tsx";
|
|
28
29
|
import { useActor } from "../../actor.ts";
|
|
29
30
|
import { useDensity } from "../density.tsx";
|
|
31
|
+
import { useChatPrompt } from "./chat-prompt.ts";
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
* Who you are, the theme and the density, at the foot of the bar: your initials, your name, your
|
|
33
35
|
* groups (and whom you act for, as an agent) and where the name comes from read out to assistive
|
|
34
36
|
* tech and shown atop the menu, with Sign out when the login has one. In the desktop shell's
|
|
35
37
|
* window, the companies open there too (`useDesktopCompanies`), this one checked: another switches
|
|
36
|
-
* the window to it, and Add company… shows the shell's start screen.
|
|
38
|
+
* the window to it, and Add company… shows the shell's start screen. Agent… opens the chat on the
|
|
39
|
+
* agents to connect, to change which one a new chat opens on. The menu renders only once
|
|
37
40
|
* opened, in the browser, so the stored theme never reaches the server's markup.
|
|
38
41
|
*/
|
|
39
42
|
export function NavUser() {
|
|
@@ -41,6 +44,7 @@ export function NavUser() {
|
|
|
41
44
|
const { theme, setTheme } = useTheme();
|
|
42
45
|
const { compact, setCompact } = useDensity();
|
|
43
46
|
const companies = useDesktopCompanies();
|
|
47
|
+
const chat = useChatPrompt();
|
|
44
48
|
const shownCompany = companies?.find((company) => company.shown)?.id ?? "";
|
|
45
49
|
const setDensity = (value: string) => setCompact(value === "compact");
|
|
46
50
|
// Under the name: why the deployment could not say, or where the name comes from; nothing
|
|
@@ -103,6 +107,12 @@ export function NavUser() {
|
|
|
103
107
|
<DropdownMenuSeparator />
|
|
104
108
|
</>
|
|
105
109
|
)}
|
|
110
|
+
{/* No chat column on a phone. */}
|
|
111
|
+
<DropdownMenuItem className="max-md:hidden" onClick={() => chat.chooseAgent()}>
|
|
112
|
+
<SparkleIcon aria-hidden="true" />
|
|
113
|
+
Agent…
|
|
114
|
+
</DropdownMenuItem>
|
|
115
|
+
<DropdownMenuSeparator className="max-md:hidden" />
|
|
106
116
|
{signOut && (
|
|
107
117
|
<>
|
|
108
118
|
<DropdownMenuItem onClick={() => void signOutAt(signOut)}>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// The shell's preferences kept in cookies (the chat column's,
|
|
1
|
+
// The shell's preferences kept in cookies (the chat column's, the engine a new chat opens on, and
|
|
2
|
+
// the density's for density.tsx),
|
|
2
3
|
// so the server renders them from the first paint: the root's loader reads them (`readPrefs` in
|
|
3
4
|
// routes/__root.tsx, which imports this module statically, so it stays this small) and the
|
|
4
5
|
// chrome writes them.
|
|
@@ -16,6 +17,13 @@ export type ChatPref = "open" | "closed" | undefined;
|
|
|
16
17
|
export const chatPref = (value: string | undefined): ChatPref =>
|
|
17
18
|
value === "open" || value === "closed" ? value : undefined;
|
|
18
19
|
|
|
20
|
+
/**
|
|
21
|
+
* The cookie the engine a person's new chats open on is kept in (its name, `engineName`, which the
|
|
22
|
+
* chat takes only when the company can open a chat on it here, `enginesHere`): the one they last
|
|
23
|
+
* chose, in the empty chat's cards or the composer.
|
|
24
|
+
*/
|
|
25
|
+
export const ENGINE_COOKIE = "sanoma_engine";
|
|
26
|
+
|
|
19
27
|
/** The width from which the chat column sits beside the page rather than over it (Tailwind's `lg`). */
|
|
20
28
|
export const BESIDE_PAGE = "(min-width: 64rem)";
|
|
21
29
|
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { SparkleIcon } from "@phosphor-icons/react/dist/csr/Sparkle";
|
|
2
|
+
import { Link } from "@tanstack/react-router";
|
|
3
|
+
import type { ChatStatus } from "ai";
|
|
4
|
+
import { memo, type ReactNode } from "react";
|
|
5
|
+
import { Bubble, BubbleContent } from "#/components/ui/bubble.tsx";
|
|
6
|
+
import { Button } from "#/components/ui/button.tsx";
|
|
7
|
+
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "#/components/ui/empty.tsx";
|
|
8
|
+
import { Marker, MarkerContent } from "#/components/ui/marker.tsx";
|
|
9
|
+
import { Message, MessageContent } from "#/components/ui/message.tsx";
|
|
10
|
+
import {
|
|
11
|
+
MessageScroller,
|
|
12
|
+
MessageScrollerButton,
|
|
13
|
+
MessageScrollerContent,
|
|
14
|
+
MessageScrollerItem,
|
|
15
|
+
MessageScrollerProvider,
|
|
16
|
+
MessageScrollerViewport,
|
|
17
|
+
} from "#/components/ui/message-scroller.tsx";
|
|
18
|
+
import { Trace, TraceLine, TraceTitle } from "#/components/ui/trace.tsx";
|
|
19
|
+
import { Notice } from "../kit.tsx";
|
|
20
|
+
import { type ChatMessage, errorParts, isBusy, isIntro, suggestionsOf, textOf, unfinished } from "../../lib/chat.ts";
|
|
21
|
+
import { Reply, Suggested } from "./chat-parts.tsx";
|
|
22
|
+
|
|
23
|
+
// The chat's thread, given its messages and status: off `common.tsx` and `useChat`, so a test draws
|
|
24
|
+
// it on a scripted conversation.
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The thread (AI Elements' Chat): an empty chat's `start` (else what to ask), then each turn an
|
|
28
|
+
* item of the scroller (not the agent's cue to speak first, `isIntro`), the person's the anchor, so
|
|
29
|
+
* a new question settles near the top with the reply streaming below it; then the last reply's
|
|
30
|
+
* suggested asks, what waits on the turn, its error, and Continue (when `canContinue`) after one
|
|
31
|
+
* that stopped short. A suggested ask and Continue are sent with `onSend`.
|
|
32
|
+
*/
|
|
33
|
+
export function Thread({
|
|
34
|
+
chat,
|
|
35
|
+
messages,
|
|
36
|
+
status,
|
|
37
|
+
error,
|
|
38
|
+
start,
|
|
39
|
+
onSend,
|
|
40
|
+
canContinue,
|
|
41
|
+
}: {
|
|
42
|
+
chat: string;
|
|
43
|
+
messages: ChatMessage[];
|
|
44
|
+
status: ChatStatus;
|
|
45
|
+
error?: Error;
|
|
46
|
+
start?: ReactNode;
|
|
47
|
+
onSend: (text: string) => void;
|
|
48
|
+
canContinue: boolean;
|
|
49
|
+
}) {
|
|
50
|
+
const busy = isBusy(status);
|
|
51
|
+
const last = messages.at(-1);
|
|
52
|
+
const asks = !busy && last?.role === "assistant" ? suggestionsOf(last) : [];
|
|
53
|
+
return (
|
|
54
|
+
<MessageScrollerProvider autoScroll defaultScrollPosition="last-anchor">
|
|
55
|
+
<MessageScroller className="h-auto min-h-0 flex-1">
|
|
56
|
+
<MessageScrollerViewport aria-label="Conversation">
|
|
57
|
+
<MessageScrollerContent className="gap-4 p-4">
|
|
58
|
+
{messages.length === 0 && (
|
|
59
|
+
<MessageScrollerItem className="flex flex-1 flex-col">{start ?? <EmptyChat />}</MessageScrollerItem>
|
|
60
|
+
)}
|
|
61
|
+
{messages.map((message, i) =>
|
|
62
|
+
isIntro(message) ? null : (
|
|
63
|
+
<Turn key={message.id} message={message} live={busy && i === messages.length - 1} chat={chat} />
|
|
64
|
+
),
|
|
65
|
+
)}
|
|
66
|
+
{asks.length > 0 && (
|
|
67
|
+
<MessageScrollerItem>
|
|
68
|
+
<Suggested asks={asks} onAsk={onSend} />
|
|
69
|
+
</MessageScrollerItem>
|
|
70
|
+
)}
|
|
71
|
+
{status === "submitted" && (
|
|
72
|
+
<MessageScrollerItem>
|
|
73
|
+
<Trace>
|
|
74
|
+
<TraceLine status="running" className="text-xs">
|
|
75
|
+
<TraceTitle>Waiting for the agent</TraceTitle>
|
|
76
|
+
</TraceLine>
|
|
77
|
+
</Trace>
|
|
78
|
+
</MessageScrollerItem>
|
|
79
|
+
)}
|
|
80
|
+
{error && (
|
|
81
|
+
<MessageScrollerItem>
|
|
82
|
+
<TurnError message={error.message} />
|
|
83
|
+
</MessageScrollerItem>
|
|
84
|
+
)}
|
|
85
|
+
{!busy && !error && canContinue && stoppedShort(last) && (
|
|
86
|
+
<MessageScrollerItem>
|
|
87
|
+
<Marker>
|
|
88
|
+
<MarkerContent>The last turn stopped before it finished.</MarkerContent>
|
|
89
|
+
<Button variant="secondary" size="sm" onClick={() => onSend("continue")}>
|
|
90
|
+
Continue
|
|
91
|
+
</Button>
|
|
92
|
+
</Marker>
|
|
93
|
+
</MessageScrollerItem>
|
|
94
|
+
)}
|
|
95
|
+
</MessageScrollerContent>
|
|
96
|
+
</MessageScrollerViewport>
|
|
97
|
+
<MessageScrollerButton />
|
|
98
|
+
</MessageScroller>
|
|
99
|
+
</MessageScrollerProvider>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A turn, an item of the scroller: the person's in a bubble, and the anchor; else the agent's reply.
|
|
105
|
+
* Memoized: a streamed chunk redraws only the turn it belongs to.
|
|
106
|
+
*/
|
|
107
|
+
const Turn = memo(function Turn({ message, live, chat }: { message: ChatMessage; live: boolean; chat: string }) {
|
|
108
|
+
return (
|
|
109
|
+
<MessageScrollerItem messageId={message.id} scrollAnchor={message.role === "user"}>
|
|
110
|
+
{message.role === "user" ? (
|
|
111
|
+
<Message align="end">
|
|
112
|
+
<MessageContent>
|
|
113
|
+
<Bubble align="end" variant="outline">
|
|
114
|
+
<BubbleContent className="whitespace-pre-wrap">{textOf(message, "\n")}</BubbleContent>
|
|
115
|
+
</Bubble>
|
|
116
|
+
</MessageContent>
|
|
117
|
+
</Message>
|
|
118
|
+
) : (
|
|
119
|
+
<Reply message={message} live={live} chat={chat} />
|
|
120
|
+
)}
|
|
121
|
+
</MessageScrollerItem>
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
/** A turn that stopped before it finished (a restart, say): no reply to the last message, or a step or text still under way. */
|
|
126
|
+
function stoppedShort(last: ChatMessage | undefined): boolean {
|
|
127
|
+
if (!last) return false;
|
|
128
|
+
return last.role === "user" || last.parts.some(unfinished);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** A turn's error as text: the server's own message when it sent one, and the connector page where a missing key is set. */
|
|
132
|
+
function TurnError({ message }: { message: string }) {
|
|
133
|
+
let said = message;
|
|
134
|
+
try {
|
|
135
|
+
said = (JSON.parse(message) as { error?: string }).error ?? message;
|
|
136
|
+
} catch {
|
|
137
|
+
// Not the app's JSON error: the text as it came.
|
|
138
|
+
}
|
|
139
|
+
const { text, vendor } = errorParts(said);
|
|
140
|
+
return (
|
|
141
|
+
<Notice variant="destructive">
|
|
142
|
+
{text}
|
|
143
|
+
{vendor && (
|
|
144
|
+
<>
|
|
145
|
+
{" "}
|
|
146
|
+
<ConnectorPageLink vendor={vendor}>Set it on its connector page</ConnectorPageLink>.
|
|
147
|
+
</>
|
|
148
|
+
)}
|
|
149
|
+
</Notice>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** A link to a connector's page, where its credentials are set. */
|
|
154
|
+
export const ConnectorPageLink = ({ vendor, children }: { vendor: string; children: ReactNode }) => (
|
|
155
|
+
<Link to="/connectors/$vendor" params={{ vendor }} className="underline underline-offset-4">
|
|
156
|
+
{children}
|
|
157
|
+
</Link>
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
function EmptyChat() {
|
|
161
|
+
return (
|
|
162
|
+
<Empty className="p-6">
|
|
163
|
+
<EmptyHeader>
|
|
164
|
+
<EmptyMedia variant="icon">
|
|
165
|
+
<SparkleIcon aria-hidden="true" />
|
|
166
|
+
</EmptyMedia>
|
|
167
|
+
<EmptyTitle className="font-display text-2xl font-normal">What should change?</EmptyTitle>
|
|
168
|
+
<EmptyDescription>
|
|
169
|
+
Ask the agent: it drafts the change on a branch of its own and checks it. You merge it.
|
|
170
|
+
</EmptyDescription>
|
|
171
|
+
</EmptyHeader>
|
|
172
|
+
</Empty>
|
|
173
|
+
);
|
|
174
|
+
}
|