@qredence/fleet 0.7.4 → 0.9.0
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/CHANGELOG.md +48 -0
- package/README.md +5 -4
- package/bin/fleet-prime.mjs +33 -6
- package/bin/prime-runtime.mjs +79 -0
- package/dist/runtime-manifest.json +32 -0
- package/dist/web/client/assets/DialogTitle-BlVq-tcv.js +1 -0
- package/dist/web/client/assets/FloatingPortal-D8-EPDs2.js +1 -0
- package/dist/web/client/assets/activity-BPIKUzOU.js +1 -0
- package/dist/web/client/assets/agents-CGjUBYX7.js +2 -0
- package/dist/web/client/assets/agents-page-CTuFJL9H.js +1 -0
- package/dist/web/client/assets/alert-CzWGeumf.js +1 -0
- package/dist/web/client/assets/alert-dialog-D-e1Pr4q.js +1 -0
- package/dist/web/client/assets/arrow-up-right-CG9RNk4p.js +1 -0
- package/dist/web/client/assets/artifacts-panel-6JEdy6jU.js +1 -0
- package/dist/web/client/assets/badge-CzQFgmVK.js +1 -0
- package/dist/web/client/assets/button-CWYjn8Zk.js +1 -0
- package/dist/web/client/assets/{card-Hngi3HGC.js → card-Dj1SnGUU.js} +1 -1
- package/dist/web/client/assets/chat-command-palette-Bxr5EkO6.js +1 -0
- package/dist/web/client/assets/chat-hpzV6IA6.js +57 -0
- package/dist/web/client/assets/chat-queries-CfZiupub.js +3 -0
- package/dist/web/client/assets/clock-3-BwWCSCm_.js +1 -0
- package/dist/web/client/assets/code-block-pKKmFZ5w.js +3 -0
- package/dist/web/client/assets/collapsible-Bk6zCsRX.js +1 -0
- package/dist/web/client/assets/{command-CmtCIDdH.js → command-xo-NK4xO.js} +1 -1
- package/dist/web/client/assets/connectors-CFxLqG2x.js +2 -0
- package/dist/web/client/assets/connectors-page-DQJdoAnl.js +1 -0
- package/dist/web/client/assets/create-project-dialog-Db-WhUmP.js +1 -0
- package/dist/web/client/assets/createBaseUIEventDetails-DIxvaz-Y.js +1 -0
- package/dist/web/client/assets/dialog-CK8dym6z.js +1 -0
- package/dist/web/client/assets/eye-iNSvs0UA.js +1 -0
- package/dist/web/client/assets/file-code-corner-BkDULqko.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-DfGlB17w.js → fork-picker-dialog-DSaFeUii.js} +1 -1
- package/dist/web/client/assets/globals-DJhWyayo.css +2 -0
- package/dist/web/client/assets/index-C9FHZDGw.js +13 -0
- package/dist/web/client/assets/input-CBoTMPC_.js +1 -0
- package/dist/web/client/assets/{input-group-EPMGh55u.js → input-group-BFubAtz9.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-CMhnRVrC.js → ipython-tool-bieUhw9K.js} +1 -1
- package/dist/web/client/assets/markdown-CvBfbPCn.js +2 -0
- package/dist/web/client/assets/markdown-code-rFOkzN5N.js +4 -0
- package/dist/web/client/assets/mcp-connections-section-DEo6Kemv.js +2 -0
- package/dist/web/client/assets/message-queue-Btjt9wK2.js +1 -0
- package/dist/web/client/assets/{model-selector-list-BiU_7ivt.js → model-selector-list-CbDAT0Rw.js} +1 -1
- package/dist/web/client/assets/mutation-Da9zdeWr.js +1 -0
- package/dist/web/client/assets/notify-BIL0-CGy.js +1 -0
- package/dist/web/client/assets/open-panel-action-message-SdA1VU42.js +1 -0
- package/dist/web/client/assets/openui-renderer-DG-iML7M.js +291 -0
- package/dist/web/client/assets/pencil-Cbgq3ybX.js +1 -0
- package/dist/web/client/assets/plus-DUP2JPVG.js +1 -0
- package/dist/web/client/assets/product-page-header-Ck6I13CE.js +1 -0
- package/dist/web/client/assets/{prompt-input-Dy-DSPqF.js → prompt-input-CoV1gTUQ.js} +1 -1
- package/dist/web/client/assets/{prompt-suggestions-CrpAiKeB.js → prompt-suggestions-CAY5JI-C.js} +1 -1
- package/dist/web/client/assets/provider-catalog-CLEDlH_v.js +1 -0
- package/dist/web/client/assets/provider-label-BItazQ6H.js +1 -0
- package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +1 -0
- package/dist/web/client/assets/rehype-katex-DITkIpVl.js +259 -0
- package/dist/web/client/assets/{repl-panel-DN5kZAcB.js → repl-panel-5xgkDXO5.js} +1 -1
- package/dist/web/client/assets/{resources-panel-DD6iWOF3.js → resources-panel-aJCKt9eF.js} +1 -1
- package/dist/web/client/assets/right-panel-context-CjX-HkDO.js +1 -0
- package/dist/web/client/assets/right-panel-registry-BAJ6TuEY.js +2 -0
- package/dist/web/client/assets/rotate-ccw-DLkfsmG9.js +1 -0
- package/dist/web/client/assets/routes-ja_liP8Z.js +14 -0
- package/dist/web/client/assets/select-DYh951qi.js +1 -0
- package/dist/web/client/assets/session-activity-panel-DwaXiSrS.js +1 -0
- package/dist/web/client/assets/{session-insights-panel-D0v_DKcb.js → session-insights-panel-BXEmuJKf.js} +1 -1
- package/dist/web/client/assets/session-reasoning-panel-CjJJK_bq.js +1 -0
- package/dist/web/client/assets/session-tool-renderer-DEABxZG3.js +166 -0
- package/dist/web/client/assets/{session-tree-panel-BBwP_EK2.js → session-tree-panel-5QgMvXoX.js} +1 -1
- package/dist/web/client/assets/settings-dialog-DiikSLhF.js +1 -0
- package/dist/web/client/assets/shield-check-7HDd-2Fn.js +1 -0
- package/dist/web/client/assets/{skeleton-DNAr5ULI.js → skeleton-B_Lq2XFl.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-B28mF4tJ.js → skeleton-loaders-DWc1eDL3.js} +1 -1
- package/dist/web/client/assets/sparkles-CASAe1AI.js +1 -0
- package/dist/web/client/assets/{spinner-CSBXk3Lo.js → spinner-B5TaKP7k.js} +1 -1
- package/dist/web/client/assets/{subagent-chat-panel-DhvBO4dQ.js → subagent-chat-panel-R2RoX1Yt.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-DVZhMo7a.js +1 -0
- package/dist/web/client/assets/{subagents-panel-DRo8Xs6j.js → subagents-panel-CMMRUP8F.js} +1 -1
- package/dist/web/client/assets/surfaces-BUjUJTyD.js +1 -0
- package/dist/web/client/assets/switch-BrxDfsX6.js +1 -0
- package/dist/web/client/assets/toast-BNWkgZ0u.js +1 -0
- package/dist/web/client/assets/tool-output-normalizer-DDU09Zc6.js +4 -0
- package/dist/web/client/assets/tool-part-normalizer-CF6bmJ0s.js +4 -0
- package/dist/web/client/assets/tool-result-7qREIVv_.js +5 -0
- package/dist/web/client/assets/tool-timeline-CGhwMeNl.js +2 -0
- package/dist/web/client/assets/trace-IsV5RRvM.js +1 -0
- package/dist/web/client/assets/trash-sm2UyOxe.js +1 -0
- package/dist/web/client/assets/types-gIgIxnnG.js +1 -0
- package/dist/web/client/assets/ui-preferences-B-PNDkyY.js +1 -0
- package/dist/web/client/assets/use-hover-capable-CLq8BADD.js +1 -0
- package/dist/web/client/assets/useBaseUiId-lKfDDIcw.js +1 -0
- package/dist/web/client/assets/useButton-CvcmqA2s.js +1 -0
- package/dist/web/client/assets/useNavigate-CVhM7pag.js +1 -0
- package/dist/web/client/assets/useRender-CzJUrRlB.js +1 -0
- package/dist/web/client/assets/useScrollLock-BcsteNzT.js +1 -0
- package/dist/web/client/assets/{utils-CFDGLzf6.js → utils-oBThwhjm.js} +1 -1
- package/dist/web/client/assets/with-selector-B_VDO56x.js +1 -0
- package/dist/web/client/assets/{workspace-panel-DdZutYnd.js → workspace-panel-Da5I4p_t.js} +1 -1
- package/dist/web/client/assets/workspace-path-nav-D-77sJ_A.js +2 -0
- package/dist/web/client/assets/wrench-BXX_Ah2s.js +1 -0
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/server/_tanstack-start-manifest_v-B6ne-00G-OFX7UD4K.js +119 -0
- package/dist/web/server/agents-BwzqhPjK-ANFHE5AG.js +22 -0
- package/dist/web/server/agents-page-DEqPV-eG-BR5MR74O.js +215 -0
- package/dist/web/server/{artifacts-panel-COSC8o7j-GKW2HH2G.js → artifacts-panel-DLO8OfXb-B2ZWCDFP.js} +35 -29
- package/dist/web/server/{chat-command-palette-CuOWdzkk-PKZQ5EZP.js → chat-command-palette-CaDQAMAu-KDH7BTDS.js} +22 -15
- package/dist/web/server/chunk-2ETDIMNM.js +40 -0
- package/dist/web/server/{chunk-2VKVSL6Y.js → chunk-35RIM6VP.js} +128 -127
- package/dist/web/server/chunk-5IE54MRG.js +207 -0
- package/dist/web/server/{chunk-VUBITQ5X.js → chunk-5MOXRFX6.js} +180 -7
- package/dist/web/server/{chunk-6GTTTYSE.js → chunk-6AFVCERK.js} +72 -79
- package/dist/web/server/chunk-6GYLXDX3.js +588 -0
- package/dist/web/server/chunk-7DQQMT5V.js +8993 -0
- package/dist/web/server/chunk-APOS34PW.js +8965 -0
- package/dist/web/server/{chunk-BUKOEXE7.js → chunk-AXN2OBPF.js} +2 -4
- package/dist/web/server/{chunk-WCKKN5BR.js → chunk-B5FKCW75.js} +357 -910
- package/dist/web/server/chunk-BD7YKYWL.js +1007 -0
- package/dist/web/server/{chunk-36CAMOVG.js → chunk-BZ2EAUZZ.js} +10 -12
- package/dist/web/server/chunk-CE7U5QB2.js +42 -0
- package/dist/web/server/chunk-FNV3WZXL.js +125 -0
- package/dist/web/server/{chunk-GLSR4ZI2.js → chunk-FSQWWR2M.js} +698 -832
- package/dist/web/server/chunk-FT7HNDR5.js +143 -0
- package/dist/web/server/chunk-GNXIDE26.js +44 -0
- package/dist/web/server/{chunk-ORCOCCER.js → chunk-HAFELESQ.js} +5 -7
- package/dist/web/server/{chunk-LLO4MNGE.js → chunk-HUHUPGHT.js} +53 -45
- package/dist/web/server/{chunk-QSM3BRMA.js → chunk-KBMRRJQN.js} +256 -157
- package/dist/web/server/chunk-KDCSEISZ.js +6890 -0
- package/dist/web/server/chunk-KSGGSGOA.js +50 -0
- package/dist/web/server/chunk-PQVTLG3E.js +270 -0
- package/dist/web/server/{chunk-YU6RHHK6.js → chunk-Q4ECIATK.js} +65 -53
- package/dist/web/server/{chunk-IN2ATSEG.js → chunk-R4BS3KYI.js} +2 -4
- package/dist/web/server/chunk-RX2ZJARF.js +73 -0
- package/dist/web/server/{chunk-AKSDWYJY.js → chunk-SYS5FDNA.js} +5 -5
- package/dist/web/server/chunk-TOJA3X5N.js +421 -0
- package/dist/web/server/chunk-TQ2RECTH.js +193 -0
- package/dist/web/server/{chunk-KHHXJZK7.js → chunk-TTNONWZZ.js} +16001 -14668
- package/dist/web/server/chunk-TXZDDJCT.js +5115 -0
- package/dist/web/server/{chunk-XA7EOCHM.js → chunk-UDUG3MYZ.js} +2 -2
- package/dist/web/server/{chunk-EBC7QORX.js → chunk-V2GCVTDP.js} +5056 -12556
- package/dist/web/server/{chunk-TMQ3MT3D.js → chunk-VDEUVEWL.js} +2255 -1
- package/dist/web/server/chunk-VM3U6PUU.js +769 -0
- package/dist/web/server/connectors-C0xm91Ss-DJVBGD73.js +22 -0
- package/dist/web/server/connectors-page-B6tJNZ6c-R5K4NSAT.js +66 -0
- package/dist/web/server/{create-project-dialog-0-arQpsX-ZELQKHS5.js → create-project-dialog-PFPHHWIV-GH7JR5IK.js} +27 -18
- package/dist/web/server/{dist-7G2NZPF4.js → dist-GQUZLXN5.js} +2 -2
- package/dist/web/server/{dist-E5637ZAY.js → dist-MN5NWCX6.js} +1 -1
- package/dist/web/server/{fork-picker-dialog-fj9p33Mq-I5SA3GLJ.js → fork-picker-dialog-DFpKOdAw-JPLJSYYU.js} +7 -12
- package/dist/web/server/{markdown-CShfYRVO-RBTK7TRB.js → markdown-Cc8V9dOF-JTNTJKQU.js} +7 -5
- package/dist/web/server/{markdown-code-BDV_2b2T-6JYA5FWZ.js → markdown-code-gaRnbgNM-V5LIRYCD.js} +46 -8
- package/dist/web/server/{message-queue-BBC843IU-GY4ZIMM4.js → message-queue-nQ2_kU82-KKSLYR4S.js} +7 -16
- package/dist/web/server/{model-selector-list-DE6aLNXt-LJZMCYOI.js → model-selector-list-By_G7_Hr-GXT27BZO.js} +12 -16
- package/dist/web/server/{openui-renderer-C3aqSKuS-PWLWJFYO.js → openui-renderer-B9D8-Av--LFZP4U5V.js} +20 -15
- package/dist/web/server/{prompt-suggestions-CpTK_fHV-UKJDTLVM.js → prompt-suggestions-B67Uy5Rk-5SMTSIFQ.js} +5 -4
- package/dist/web/server/{rehype-katex-IDPYWU6M.js → rehype-katex-CYHGKI6Q.js} +490 -843
- package/dist/web/server/{repl-panel-1kSS1UGd-U64BPA7X.js → repl-panel-1kSS1UGd-POXRYDDJ.js} +2 -3
- package/dist/web/server/{resources-panel-DWb0eGKa-K4EM3H7Y.js → resources-panel-CTzOOKPz-5G6RS2D6.js} +18 -12
- package/dist/web/server/router-CnBux_Ld-YTVBMJFL.js +23 -0
- package/dist/web/server/routes-BUGzvQoO-WW43X7W2.js +124 -0
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/session-activity-panel-f0d3fCm7-I6L5IKFQ.js +181 -0
- package/dist/web/server/{session-insights-panel-CfMX2NRu-6HWZTTAC.js → session-insights-panel-BiVObm_6-AP4FITT7.js} +2 -12
- package/dist/web/server/session-reasoning-panel-QIt_xjP0-FKJWMNHO.js +70 -0
- package/dist/web/server/session-tool-renderer-Cg_ZPHxS-BNQKNJNZ.js +34 -0
- package/dist/web/server/{session-tree-panel-HNl6R9VZ-4JUF34M7.js → session-tree-panel-B--el8O5-NZOZJM5L.js} +18 -13
- package/dist/web/server/{settings-dialog-DGZBA5Z_-6HYFMPNZ.js → settings-dialog-D_eJN2ia-W47Y474K.js} +104 -795
- package/dist/web/server/{subagent-chat-panel-DuB4hqUk-LDCAJOCL.js → subagent-chat-panel-C9nWP21E-D5C2TTYD.js} +22 -17
- package/dist/web/server/{subagents-panel-wAvx3-Rs-L6UTDFUX.js → subagents-panel-fAKvBNRG-O7QHXNE2.js} +26 -22
- package/dist/web/server/{workspace-panel-CPzJZwgv-YS7PTI5C.js → workspace-panel-CZMNMU63-SYOSM3B7.js} +23 -17
- package/package.json +2 -2
- package/dist/web/client/assets/DialogTitle-D-zqaHvF.js +0 -1
- package/dist/web/client/assets/FloatingPortal-73ZRZeD9.js +0 -1
- package/dist/web/client/assets/action-swap-BcFwS6is.js +0 -1
- package/dist/web/client/assets/alert-dialog-DtXvVhsF.js +0 -1
- package/dist/web/client/assets/artifacts-panel-Bseg97yQ.js +0 -1
- package/dist/web/client/assets/badge-C--lf3bb.js +0 -57
- package/dist/web/client/assets/button-BJZe4vNJ.js +0 -1
- package/dist/web/client/assets/chat-command-palette-D_rm1r9d.js +0 -1
- package/dist/web/client/assets/chevron-up-CqeJYyZO.js +0 -1
- package/dist/web/client/assets/collapsible-DauSnbYp.js +0 -1
- package/dist/web/client/assets/create-project-dialog-m-9aoobN.js +0 -1
- package/dist/web/client/assets/createBaseUIEventDetails-DklXWq23.js +0 -1
- package/dist/web/client/assets/dialog-Ddouieuu.js +0 -1
- package/dist/web/client/assets/eye-Cs0lNChA.js +0 -1
- package/dist/web/client/assets/globals-C961mr-b.css +0 -2
- package/dist/web/client/assets/index-Bz5W4EOn.js +0 -13
- package/dist/web/client/assets/input-Def1xOZz.js +0 -1
- package/dist/web/client/assets/markdown-Big27m-v.js +0 -2
- package/dist/web/client/assets/markdown-code-7L4RiS50.js +0 -3
- package/dist/web/client/assets/message-queue-Bg2MiJHM.js +0 -1
- package/dist/web/client/assets/mutation-DOi2Qgfa.js +0 -1
- package/dist/web/client/assets/notify-DhtmUPfE.js +0 -1
- package/dist/web/client/assets/openui-renderer-MIB3JKYa.js +0 -291
- package/dist/web/client/assets/provider-label-B_vy60P0.js +0 -1
- package/dist/web/client/assets/rehype-katex-A4PtQgTX.js +0 -259
- package/dist/web/client/assets/right-panel-context-DHKWoetk.js +0 -1
- package/dist/web/client/assets/right-panel-registry-hKJN__3l.js +0 -2
- package/dist/web/client/assets/routes-C3h32Lj_.js +0 -16
- package/dist/web/client/assets/select-Buvv1tIo.js +0 -1
- package/dist/web/client/assets/session-reasoning-panel-DmEbXOrR.js +0 -1
- package/dist/web/client/assets/session-tool-renderer-Daol5fJw.js +0 -169
- package/dist/web/client/assets/settings-dialog-DYbx3xuq.js +0 -2
- package/dist/web/client/assets/sparkles-D_ANe-HY.js +0 -1
- package/dist/web/client/assets/subagent-transcript-Bx-rHni-.js +0 -1
- package/dist/web/client/assets/surfaces-B8xTOFeK.js +0 -1
- package/dist/web/client/assets/switch-CDfAwEvs.js +0 -1
- package/dist/web/client/assets/terminal-Ceucj7us.js +0 -1
- package/dist/web/client/assets/toast-9zXN-yVk.js +0 -1
- package/dist/web/client/assets/tool-part-normalizer-NbPs9kd1.js +0 -4
- package/dist/web/client/assets/tool-result-BccnO34D.js +0 -4
- package/dist/web/client/assets/tool-timeline-DlBZyd4j.js +0 -1
- package/dist/web/client/assets/types-D5hZ8IyV.js +0 -1
- package/dist/web/client/assets/ui-preferences-1YaENqef.js +0 -1
- package/dist/web/client/assets/use-hover-capable-MwFjBLZQ.js +0 -1
- package/dist/web/client/assets/workspace-path-nav-BRwuLsFl.js +0 -2
- package/dist/web/client/assets/wrench-BYnD147U.js +0 -1
- package/dist/web/server/_tanstack-start-manifest_v-YlngJGUa-YTWBGR7L.js +0 -93
- package/dist/web/server/chunk-2PAW6K4Q.js +0 -56
- package/dist/web/server/chunk-CHSKEU3V.js +0 -166
- package/dist/web/server/chunk-FB3UHLLN.js +0 -49
- package/dist/web/server/chunk-GLH2GWMG.js +0 -2182
- package/dist/web/server/chunk-OXEAXEWD.js +0 -13
- package/dist/web/server/chunk-SIJVVYQT.js +0 -234
- package/dist/web/server/chunk-UQV2NU63.js +0 -163
- package/dist/web/server/chunk-ZUZPJNLY.js +0 -25217
- package/dist/web/server/router-DZYr-9uT-AEXHEFXF.js +0 -31
- package/dist/web/server/routes-vYxWRhis-AAZ73SNP.js +0 -120
- package/dist/web/server/session-reasoning-panel-XXU2yIOW-XXCKHISS.js +0 -192
- package/dist/web/server/session-tool-renderer-Dtt74Mts-7YYNSWRV.js +0 -29
- package/dist/web/server/tool-timeline-BKWsrZHK-3LGCOTPH.js +0 -12
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Spinner
|
|
3
|
+
} from "./chunk-AXN2OBPF.js";
|
|
4
|
+
import {
|
|
5
|
+
Field,
|
|
6
|
+
FieldDescription,
|
|
7
|
+
FieldLabel,
|
|
8
|
+
Switch$1
|
|
9
|
+
} from "./chunk-Q4ECIATK.js";
|
|
10
|
+
import {
|
|
11
|
+
Alert,
|
|
12
|
+
AlertDescription
|
|
13
|
+
} from "./chunk-GNXIDE26.js";
|
|
14
|
+
import {
|
|
15
|
+
COMPACT_ACTION_BUTTON_CLASS,
|
|
16
|
+
Input$1,
|
|
17
|
+
Select$1,
|
|
18
|
+
notify,
|
|
19
|
+
rowSurface
|
|
20
|
+
} from "./chunk-TXZDDJCT.js";
|
|
21
|
+
import {
|
|
22
|
+
Button$1
|
|
23
|
+
} from "./chunk-FSQWWR2M.js";
|
|
24
|
+
import {
|
|
25
|
+
LoaderCircle,
|
|
26
|
+
Plug,
|
|
27
|
+
Plus,
|
|
28
|
+
RotateCcw,
|
|
29
|
+
Save,
|
|
30
|
+
Trash,
|
|
31
|
+
cn
|
|
32
|
+
} from "./chunk-VDEUVEWL.js";
|
|
33
|
+
|
|
34
|
+
// web/app/dist/server/assets/mcp-connections-section-DtCdKod5.js
|
|
35
|
+
import { useState } from "react";
|
|
36
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
function RowSurface({ className, interactive, padding, tone, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: cn(rowSurface({
|
|
40
|
+
interactive,
|
|
41
|
+
padding,
|
|
42
|
+
tone
|
|
43
|
+
}), className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function ItemRow({ icon, title, subtitle, trailing, className, interactive = true, tone = "default", truncateSubtitle = true, truncateTitle = true }) {
|
|
48
|
+
return /* @__PURE__ */ jsxs(RowSurface, {
|
|
49
|
+
tone,
|
|
50
|
+
padding: "md",
|
|
51
|
+
interactive,
|
|
52
|
+
className: cn("items-center gap-3", className),
|
|
53
|
+
children: [
|
|
54
|
+
icon ? /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "flex size-8 shrink-0 items-center justify-center rounded-md border border-border/40 bg-background/60 text-foreground/70",
|
|
56
|
+
children: icon
|
|
57
|
+
}) : null,
|
|
58
|
+
/* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "min-w-0 flex-1",
|
|
60
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: cn("text-sm font-medium text-foreground", truncateTitle && "truncate"),
|
|
62
|
+
children: title
|
|
63
|
+
}), subtitle ? /* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: cn("mt-0.5 text-xs text-muted-foreground", truncateSubtitle ? "truncate" : "leading-normal"),
|
|
65
|
+
children: subtitle
|
|
66
|
+
}) : null]
|
|
67
|
+
}),
|
|
68
|
+
trailing ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: "flex shrink-0 items-center gap-1.5",
|
|
70
|
+
children: trailing
|
|
71
|
+
}) : null
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function SettingsPane({ actions, children, description, title }) {
|
|
76
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
77
|
+
className: "flex flex-col gap-4",
|
|
78
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: "flex items-start justify-between gap-3",
|
|
80
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "min-w-0 flex-1",
|
|
82
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
83
|
+
className: "text-lg font-medium text-balance",
|
|
84
|
+
children: title
|
|
85
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
86
|
+
className: "mt-1 text-sm text-pretty text-muted-foreground",
|
|
87
|
+
children: description
|
|
88
|
+
})]
|
|
89
|
+
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
90
|
+
className: "flex shrink-0 items-center gap-1.5 pt-0.5",
|
|
91
|
+
children: actions
|
|
92
|
+
}) : null]
|
|
93
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
94
|
+
className: "flex flex-col gap-3",
|
|
95
|
+
children
|
|
96
|
+
})]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function SettingsCommitActions({ dirty, disabled, onRevert, onSave, saving }) {
|
|
100
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [dirty ? /* @__PURE__ */ jsx(Button$1, {
|
|
101
|
+
type: "button",
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
size: "icon-compact",
|
|
104
|
+
className: "text-muted-foreground transition-transform active:scale-[0.96]",
|
|
105
|
+
disabled: disabled || saving,
|
|
106
|
+
onClick: onRevert,
|
|
107
|
+
"aria-label": "Revert changes",
|
|
108
|
+
children: /* @__PURE__ */ jsx(RotateCcw, {})
|
|
109
|
+
}) : null, /* @__PURE__ */ jsxs(Button$1, {
|
|
110
|
+
type: "button",
|
|
111
|
+
variant: "outline",
|
|
112
|
+
size: "compact",
|
|
113
|
+
className: cn(COMPACT_ACTION_BUTTON_CLASS, "transition-transform active:scale-[0.96]", dirty && "border-primary/30 text-primary"),
|
|
114
|
+
disabled: !dirty || disabled || saving,
|
|
115
|
+
onClick: onSave,
|
|
116
|
+
children: [saving ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
117
|
+
className: "animate-spin",
|
|
118
|
+
"data-icon": "inline-start"
|
|
119
|
+
}) : /* @__PURE__ */ jsx(Save, { "data-icon": "inline-start" }), "Commit"]
|
|
120
|
+
})] });
|
|
121
|
+
}
|
|
122
|
+
function Textarea({ className, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
124
|
+
"data-slot": "textarea",
|
|
125
|
+
className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
126
|
+
...props
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function statusLabel(connection) {
|
|
130
|
+
switch (connection.status) {
|
|
131
|
+
case "connected":
|
|
132
|
+
return "Connected";
|
|
133
|
+
case "anonymous":
|
|
134
|
+
return "Available without sign-in";
|
|
135
|
+
case "needs_auth":
|
|
136
|
+
return "Sign-in required";
|
|
137
|
+
case "disabled":
|
|
138
|
+
return "Disabled";
|
|
139
|
+
default:
|
|
140
|
+
return connection.status;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function connectionSubtitle(connection) {
|
|
144
|
+
const details = connection.transport === "http" ? connection.url : connection.commandPreview;
|
|
145
|
+
return [
|
|
146
|
+
connection.source === "builtin" ? "Built-in" : "User",
|
|
147
|
+
connection.transport === "http" ? "HTTP" : "stdio",
|
|
148
|
+
statusLabel(connection),
|
|
149
|
+
details
|
|
150
|
+
].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
151
|
+
}
|
|
152
|
+
function McpConnectionsSection({ connections, description = "Connect built-in and user MCP servers. Tokens stay on the server; this list only shows status and environment-variable names.", isLoading, isPending, onOAuth, onRemove, onUpsert, title = "MCP" }) {
|
|
153
|
+
const [adding, setAdding] = useState(false);
|
|
154
|
+
const [transport, setTransport] = useState("http");
|
|
155
|
+
const [name, setName] = useState("");
|
|
156
|
+
const [url, setUrl] = useState("");
|
|
157
|
+
const [oauth, setOauth] = useState(true);
|
|
158
|
+
const [bearerTokenEnvVar, setBearerTokenEnvVar] = useState("");
|
|
159
|
+
const [command, setCommand] = useState("");
|
|
160
|
+
const [args, setArgs] = useState("");
|
|
161
|
+
const [cwd, setCwd] = useState("");
|
|
162
|
+
const [envLines, setEnvLines] = useState("");
|
|
163
|
+
const [confirmRemove, setConfirmRemove] = useState(null);
|
|
164
|
+
const resetAddForm = () => {
|
|
165
|
+
setName("");
|
|
166
|
+
setUrl("");
|
|
167
|
+
setOauth(true);
|
|
168
|
+
setBearerTokenEnvVar("");
|
|
169
|
+
setCommand("");
|
|
170
|
+
setArgs("");
|
|
171
|
+
setCwd("");
|
|
172
|
+
setEnvLines("");
|
|
173
|
+
setTransport("http");
|
|
174
|
+
setAdding(false);
|
|
175
|
+
};
|
|
176
|
+
const handleAdd = async () => {
|
|
177
|
+
if (!onUpsert) return;
|
|
178
|
+
const trimmedName = name.trim();
|
|
179
|
+
try {
|
|
180
|
+
if (transport === "http") await onUpsert({
|
|
181
|
+
name: trimmedName,
|
|
182
|
+
transport: "http",
|
|
183
|
+
url: url.trim(),
|
|
184
|
+
...!oauth && bearerTokenEnvVar.trim() ? { bearerTokenEnvVar: bearerTokenEnvVar.trim() } : { oauth: true },
|
|
185
|
+
force: true
|
|
186
|
+
});
|
|
187
|
+
else {
|
|
188
|
+
const parsedArgs = args.split(/\s+/).map((part) => part.trim()).filter(Boolean);
|
|
189
|
+
const env = envLines.split("\n").map((line) => line.trim()).filter(Boolean).flatMap((line) => {
|
|
190
|
+
const equals = line.indexOf("=");
|
|
191
|
+
if (equals <= 0) return [];
|
|
192
|
+
const child = line.slice(0, equals).trim();
|
|
193
|
+
const source = line.slice(equals + 1).trim();
|
|
194
|
+
if (!child || !source) return [];
|
|
195
|
+
return [{
|
|
196
|
+
child,
|
|
197
|
+
source
|
|
198
|
+
}];
|
|
199
|
+
});
|
|
200
|
+
await onUpsert({
|
|
201
|
+
name: trimmedName,
|
|
202
|
+
transport: "stdio",
|
|
203
|
+
command: command.trim(),
|
|
204
|
+
...parsedArgs.length > 0 ? { args: parsedArgs } : {},
|
|
205
|
+
...cwd.trim() ? { cwd: cwd.trim() } : {},
|
|
206
|
+
...env.length > 0 ? { env } : {},
|
|
207
|
+
force: true
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
notify.success("MCP connection saved");
|
|
211
|
+
resetAddForm();
|
|
212
|
+
} catch (error) {
|
|
213
|
+
notify.error(error instanceof Error ? error.message : "Could not save MCP connection");
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const handleRemove = async (connectionName) => {
|
|
217
|
+
if (!onRemove) return;
|
|
218
|
+
try {
|
|
219
|
+
await onRemove({ name: connectionName });
|
|
220
|
+
notify.success(`Removed ${connectionName}`);
|
|
221
|
+
setConfirmRemove(null);
|
|
222
|
+
} catch (error) {
|
|
223
|
+
notify.error(error instanceof Error ? error.message : "Could not remove MCP connection");
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const handleLogout = async (connectionName) => {
|
|
227
|
+
if (!onOAuth) return;
|
|
228
|
+
try {
|
|
229
|
+
await onOAuth({
|
|
230
|
+
name: connectionName,
|
|
231
|
+
action: "logout"
|
|
232
|
+
});
|
|
233
|
+
notify.success(`Signed out of ${connectionName}`);
|
|
234
|
+
} catch (error) {
|
|
235
|
+
notify.error(error instanceof Error ? error.message : "Could not sign out");
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
return /* @__PURE__ */ jsxs(SettingsPane, {
|
|
239
|
+
title,
|
|
240
|
+
description,
|
|
241
|
+
actions: /* @__PURE__ */ jsxs(Button$1, {
|
|
242
|
+
type: "button",
|
|
243
|
+
size: "compact",
|
|
244
|
+
variant: "outline",
|
|
245
|
+
disabled: isPending || adding,
|
|
246
|
+
onClick: () => setAdding(true),
|
|
247
|
+
children: [/* @__PURE__ */ jsx(Plus, { "data-icon": "inline-start" }), "Add server"]
|
|
248
|
+
}),
|
|
249
|
+
children: [
|
|
250
|
+
isLoading ? /* @__PURE__ */ jsxs("div", {
|
|
251
|
+
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
252
|
+
children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), "Loading MCP connections\u2026"]
|
|
253
|
+
}) : null,
|
|
254
|
+
adding ? /* @__PURE__ */ jsxs("div", {
|
|
255
|
+
className: "flex flex-col gap-3 rounded-xl border p-4",
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Name" }), /* @__PURE__ */ jsx(Input$1, {
|
|
258
|
+
value: name,
|
|
259
|
+
onChange: (event) => setName(event.target.value),
|
|
260
|
+
"aria-label": "MCP server name"
|
|
261
|
+
})] }),
|
|
262
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Transport" }), /* @__PURE__ */ jsx(Select$1, {
|
|
263
|
+
value: transport,
|
|
264
|
+
onValueChange: (value) => setTransport(value),
|
|
265
|
+
options: [{
|
|
266
|
+
label: "HTTP",
|
|
267
|
+
value: "http"
|
|
268
|
+
}, {
|
|
269
|
+
label: "stdio",
|
|
270
|
+
value: "stdio"
|
|
271
|
+
}]
|
|
272
|
+
})] }),
|
|
273
|
+
transport === "http" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
274
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "URL" }), /* @__PURE__ */ jsx(Input$1, {
|
|
275
|
+
value: url,
|
|
276
|
+
onChange: (event) => setUrl(event.target.value),
|
|
277
|
+
"aria-label": "MCP server URL"
|
|
278
|
+
})] }),
|
|
279
|
+
/* @__PURE__ */ jsxs(Field, {
|
|
280
|
+
orientation: "horizontal",
|
|
281
|
+
className: "items-center justify-between",
|
|
282
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "OAuth" }), /* @__PURE__ */ jsx(FieldDescription, { children: "Sign in from Prime Agent's terminal after saving this server." })] }), /* @__PURE__ */ jsx(Switch$1, {
|
|
283
|
+
checked: oauth,
|
|
284
|
+
onCheckedChange: (checked) => {
|
|
285
|
+
setOauth(checked);
|
|
286
|
+
if (checked) setBearerTokenEnvVar("");
|
|
287
|
+
},
|
|
288
|
+
"aria-label": "Use OAuth"
|
|
289
|
+
})]
|
|
290
|
+
}),
|
|
291
|
+
!oauth ? /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Bearer token environment variable" }), /* @__PURE__ */ jsx(Input$1, {
|
|
292
|
+
value: bearerTokenEnvVar,
|
|
293
|
+
onChange: (event) => setBearerTokenEnvVar(event.target.value),
|
|
294
|
+
"aria-label": "Bearer token environment variable",
|
|
295
|
+
placeholder: "MCP_BEARER_TOKEN"
|
|
296
|
+
})] }) : null
|
|
297
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
298
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Command" }), /* @__PURE__ */ jsx(Input$1, {
|
|
299
|
+
value: command,
|
|
300
|
+
onChange: (event) => setCommand(event.target.value),
|
|
301
|
+
"aria-label": "MCP command"
|
|
302
|
+
})] }),
|
|
303
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Arguments" }), /* @__PURE__ */ jsx(Input$1, {
|
|
304
|
+
value: args,
|
|
305
|
+
onChange: (event) => setArgs(event.target.value),
|
|
306
|
+
"aria-label": "MCP command arguments"
|
|
307
|
+
})] }),
|
|
308
|
+
/* @__PURE__ */ jsxs(Field, { children: [
|
|
309
|
+
/* @__PURE__ */ jsx(FieldLabel, { children: "Working directory" }),
|
|
310
|
+
/* @__PURE__ */ jsx(Input$1, {
|
|
311
|
+
value: cwd,
|
|
312
|
+
onChange: (event) => setCwd(event.target.value),
|
|
313
|
+
"aria-label": "MCP working directory"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ jsx(FieldDescription, { children: "Must stay inside the current workspace." })
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ jsxs(Field, { children: [
|
|
318
|
+
/* @__PURE__ */ jsx(FieldLabel, { children: "Environment mappings" }),
|
|
319
|
+
/* @__PURE__ */ jsx(Textarea, {
|
|
320
|
+
value: envLines,
|
|
321
|
+
onChange: (event) => setEnvLines(event.target.value),
|
|
322
|
+
"aria-label": "MCP environment mappings",
|
|
323
|
+
placeholder: "CHILD=SOURCE"
|
|
324
|
+
}),
|
|
325
|
+
/* @__PURE__ */ jsx(FieldDescription, { children: "One CHILD=SOURCE pair per line. Only variable names are stored." })
|
|
326
|
+
] })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ jsxs("div", {
|
|
329
|
+
className: "flex justify-end gap-2",
|
|
330
|
+
children: [/* @__PURE__ */ jsx(Button$1, {
|
|
331
|
+
type: "button",
|
|
332
|
+
size: "compact",
|
|
333
|
+
variant: "ghost",
|
|
334
|
+
onClick: resetAddForm,
|
|
335
|
+
children: "Cancel"
|
|
336
|
+
}), /* @__PURE__ */ jsxs(Button$1, {
|
|
337
|
+
type: "button",
|
|
338
|
+
size: "compact",
|
|
339
|
+
disabled: isPending || !name.trim(),
|
|
340
|
+
onClick: () => void handleAdd(),
|
|
341
|
+
children: [isPending ? /* @__PURE__ */ jsx(Spinner, { "data-icon": "inline-start" }) : null, "Save"]
|
|
342
|
+
})]
|
|
343
|
+
})
|
|
344
|
+
]
|
|
345
|
+
}) : null,
|
|
346
|
+
!isLoading && connections.length === 0 && !adding ? /* @__PURE__ */ jsx("p", {
|
|
347
|
+
className: "text-sm text-muted-foreground",
|
|
348
|
+
children: "No MCP connections yet."
|
|
349
|
+
}) : null,
|
|
350
|
+
/* @__PURE__ */ jsx("div", {
|
|
351
|
+
className: "flex flex-col gap-2",
|
|
352
|
+
children: connections.map((connection) => /* @__PURE__ */ jsxs("div", {
|
|
353
|
+
className: "flex flex-col gap-2",
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ jsx(ItemRow, {
|
|
356
|
+
icon: /* @__PURE__ */ jsx(Plug, { className: "size-4" }),
|
|
357
|
+
title: connection.label,
|
|
358
|
+
subtitle: connectionSubtitle(connection),
|
|
359
|
+
trailing: /* @__PURE__ */ jsxs("div", {
|
|
360
|
+
className: "flex items-center gap-1.5",
|
|
361
|
+
children: [connection.usesOAuth && connection.status !== "needs_auth" ? /* @__PURE__ */ jsx(Button$1, {
|
|
362
|
+
type: "button",
|
|
363
|
+
size: "compact",
|
|
364
|
+
variant: "ghost",
|
|
365
|
+
disabled: isPending || !onOAuth,
|
|
366
|
+
onClick: () => {
|
|
367
|
+
handleLogout(connection.name);
|
|
368
|
+
},
|
|
369
|
+
children: "Sign out"
|
|
370
|
+
}) : null, connection.source === "user" ? confirmRemove === connection.name ? /* @__PURE__ */ jsx(Button$1, {
|
|
371
|
+
type: "button",
|
|
372
|
+
size: "compact",
|
|
373
|
+
variant: "destructive",
|
|
374
|
+
disabled: isPending,
|
|
375
|
+
onClick: () => {
|
|
376
|
+
handleRemove(connection.name);
|
|
377
|
+
},
|
|
378
|
+
children: "Confirm remove"
|
|
379
|
+
}) : /* @__PURE__ */ jsx(Button$1, {
|
|
380
|
+
type: "button",
|
|
381
|
+
size: "compact",
|
|
382
|
+
variant: "ghost",
|
|
383
|
+
disabled: isPending || !onRemove,
|
|
384
|
+
"aria-label": `Remove ${connection.name}`,
|
|
385
|
+
onClick: () => setConfirmRemove(connection.name),
|
|
386
|
+
children: /* @__PURE__ */ jsx(Trash, { className: "size-3.5" })
|
|
387
|
+
}) : null]
|
|
388
|
+
})
|
|
389
|
+
}),
|
|
390
|
+
connection.error ? /* @__PURE__ */ jsx(Alert, {
|
|
391
|
+
className: "px-3 py-2",
|
|
392
|
+
children: /* @__PURE__ */ jsx(AlertDescription, {
|
|
393
|
+
className: "text-xs text-pretty",
|
|
394
|
+
children: connection.error
|
|
395
|
+
})
|
|
396
|
+
}) : null,
|
|
397
|
+
connection.usesOAuth && connection.status === "needs_auth" ? /* @__PURE__ */ jsx(Alert, {
|
|
398
|
+
className: "px-3 py-2",
|
|
399
|
+
children: /* @__PURE__ */ jsxs(AlertDescription, {
|
|
400
|
+
className: "text-xs text-pretty",
|
|
401
|
+
children: [
|
|
402
|
+
"MCP OAuth sign-in from Fleet settings is unavailable. Launch Prime Agent in a terminal using the same configuration directory as Fleet and complete sign-in for ",
|
|
403
|
+
connection.label,
|
|
404
|
+
" there. Restart Fleet afterward to reload the credentials."
|
|
405
|
+
]
|
|
406
|
+
})
|
|
407
|
+
}) : null
|
|
408
|
+
]
|
|
409
|
+
}, `${connection.source}:${connection.name}`))
|
|
410
|
+
})
|
|
411
|
+
]
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export {
|
|
416
|
+
RowSurface,
|
|
417
|
+
ItemRow,
|
|
418
|
+
SettingsPane,
|
|
419
|
+
SettingsCommitActions,
|
|
420
|
+
McpConnectionsSection
|
|
421
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OpenPanelActionSchema
|
|
3
|
+
} from "./chunk-KDCSEISZ.js";
|
|
4
|
+
|
|
5
|
+
// web/app/dist/server/assets/open-panel-action-message-BwUMd9G_.js
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
// node_modules/.pnpm/react-error-boundary@6.1.6_@types+react@19.3.0_react@19.3.0/node_modules/react-error-boundary/dist/react-error-boundary.js
|
|
9
|
+
import { createContext as l, useMemo as h, createElement as i, Component as y, useContext as p, useState as E, forwardRef as B } from "react";
|
|
10
|
+
var f = l(null);
|
|
11
|
+
function m({
|
|
12
|
+
children: r,
|
|
13
|
+
didCatch: e,
|
|
14
|
+
error: t,
|
|
15
|
+
resetErrorBoundary: o
|
|
16
|
+
}) {
|
|
17
|
+
const n = h(
|
|
18
|
+
() => ({ didCatch: e, error: t, resetErrorBoundary: o }),
|
|
19
|
+
[e, t, o]
|
|
20
|
+
);
|
|
21
|
+
return i(f.Provider, { value: n }, r);
|
|
22
|
+
}
|
|
23
|
+
var d = {
|
|
24
|
+
didCatch: false,
|
|
25
|
+
error: null
|
|
26
|
+
};
|
|
27
|
+
var C = class extends y {
|
|
28
|
+
constructor(e) {
|
|
29
|
+
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = d;
|
|
30
|
+
}
|
|
31
|
+
static getDerivedStateFromError(e) {
|
|
32
|
+
return { didCatch: true, error: e };
|
|
33
|
+
}
|
|
34
|
+
resetErrorBoundary(...e) {
|
|
35
|
+
const { didCatch: t } = this.state;
|
|
36
|
+
t && (this.props.onReset?.({
|
|
37
|
+
args: e,
|
|
38
|
+
reason: "imperative-api"
|
|
39
|
+
}), this.setState(d));
|
|
40
|
+
}
|
|
41
|
+
componentDidCatch(e, t) {
|
|
42
|
+
this.props.onError?.(e, t);
|
|
43
|
+
}
|
|
44
|
+
componentDidUpdate(e, t) {
|
|
45
|
+
const { didCatch: o } = this.state, { resetKeys: n } = this.props;
|
|
46
|
+
o && t.didCatch && g(e.resetKeys, n) && (this.props.onReset?.({
|
|
47
|
+
next: n,
|
|
48
|
+
prev: e.resetKeys,
|
|
49
|
+
reason: "keys"
|
|
50
|
+
}), this.setState(d));
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const { children: e, fallbackRender: t, FallbackComponent: o, fallback: n } = this.props, { didCatch: s, error: a } = this.state;
|
|
54
|
+
let c = e;
|
|
55
|
+
if (s) {
|
|
56
|
+
const u = {
|
|
57
|
+
error: a,
|
|
58
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
59
|
+
};
|
|
60
|
+
if (typeof t == "function")
|
|
61
|
+
c = t(u);
|
|
62
|
+
else if (o)
|
|
63
|
+
c = i(o, u);
|
|
64
|
+
else if ("fallback" in this.props)
|
|
65
|
+
c = n;
|
|
66
|
+
else
|
|
67
|
+
throw a;
|
|
68
|
+
}
|
|
69
|
+
return i(
|
|
70
|
+
m,
|
|
71
|
+
{
|
|
72
|
+
didCatch: s,
|
|
73
|
+
error: a,
|
|
74
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
75
|
+
},
|
|
76
|
+
c
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function g(r = [], e = []) {
|
|
81
|
+
return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// web/app/dist/server/assets/open-panel-action-message-BwUMd9G_.js
|
|
85
|
+
function DefaultFallback({ error, resetErrorBoundary }) {
|
|
86
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
87
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
88
|
+
className: "flex flex-col items-center justify-center gap-2 rounded-lg border border-destructive/20 bg-destructive/5 p-4 text-sm text-destructive",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx("p", {
|
|
91
|
+
className: "font-medium",
|
|
92
|
+
children: "Unable to render this view"
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("p", {
|
|
95
|
+
className: "text-xs opacity-70",
|
|
96
|
+
children: message
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ jsx("button", {
|
|
99
|
+
type: "button",
|
|
100
|
+
onClick: resetErrorBoundary,
|
|
101
|
+
className: "text-destructive-foreground mt-1 rounded-md bg-destructive px-3 py-1 text-xs font-medium transition-opacity hover:opacity-90",
|
|
102
|
+
children: "Retry"
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function UiErrorBoundary({ children, fallback, onReset, resetKeys }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(C, {
|
|
109
|
+
FallbackComponent: fallback ? () => fallback : DefaultFallback,
|
|
110
|
+
onReset,
|
|
111
|
+
resetKeys,
|
|
112
|
+
children
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
var OPEN_PANEL_ACTION_PREFIX = "fleet-prime:open-panel:";
|
|
116
|
+
function encodeOpenPanelActionMessage(action) {
|
|
117
|
+
return `${OPEN_PANEL_ACTION_PREFIX}${JSON.stringify(action)}`;
|
|
118
|
+
}
|
|
119
|
+
function decodeOpenPanelActionMessage(message) {
|
|
120
|
+
if (!message.startsWith(OPEN_PANEL_ACTION_PREFIX)) return void 0;
|
|
121
|
+
try {
|
|
122
|
+
return OpenPanelActionSchema.parse(JSON.parse(message.slice(23)));
|
|
123
|
+
} catch {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// web/app/dist/server/assets/safe-external-url-Dd4WdO3j.js
|
|
129
|
+
function isSafeExternalUrl(value) {
|
|
130
|
+
try {
|
|
131
|
+
const url = new URL(value);
|
|
132
|
+
return url.protocol === "http:" || url.protocol === "https:";
|
|
133
|
+
} catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// web/app/dist/server/assets/openui-utils-CJM45X5h.js
|
|
139
|
+
var OPENUI_FENCE_PATTERN = /```(?:openui|openui-lang)(?:[ \t]*\r?\n|[ \t]+)([\s\S]*?)```/gi;
|
|
140
|
+
function appendSegment(segments, ordinals, type, content) {
|
|
141
|
+
const ordinal = ordinals[type];
|
|
142
|
+
ordinals[type] += 1;
|
|
143
|
+
segments.push({
|
|
144
|
+
content,
|
|
145
|
+
id: `${type}-${ordinal}`,
|
|
146
|
+
type
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function stripOpenUIWrapper(content) {
|
|
150
|
+
const cleaned = content.trim();
|
|
151
|
+
const fences = Array.from(cleaned.matchAll(OPENUI_FENCE_PATTERN));
|
|
152
|
+
const onlyFence = fences[0];
|
|
153
|
+
if (fences.length === 1 && onlyFence?.index === 0 && onlyFence[0].length === cleaned.length) return onlyFence[1].trim();
|
|
154
|
+
return cleaned;
|
|
155
|
+
}
|
|
156
|
+
function isOpenUIProgram(content) {
|
|
157
|
+
return stripOpenUIWrapper(content).startsWith("root =");
|
|
158
|
+
}
|
|
159
|
+
function segmentOpenUIContent(content) {
|
|
160
|
+
const segments = [];
|
|
161
|
+
const ordinals = {
|
|
162
|
+
markdown: 0,
|
|
163
|
+
openui: 0
|
|
164
|
+
};
|
|
165
|
+
const stripped = stripOpenUIWrapper(content);
|
|
166
|
+
if (stripped.startsWith("root =")) {
|
|
167
|
+
appendSegment(segments, ordinals, "openui", stripped);
|
|
168
|
+
return segments;
|
|
169
|
+
}
|
|
170
|
+
let lastIndex = 0;
|
|
171
|
+
for (const match of content.matchAll(OPENUI_FENCE_PATTERN)) {
|
|
172
|
+
const index = match.index;
|
|
173
|
+
const markdown = content.slice(lastIndex, index);
|
|
174
|
+
if (markdown.trim()) appendSegment(segments, ordinals, "markdown", markdown);
|
|
175
|
+
const openUI = match[1].trim();
|
|
176
|
+
const isOpenUI = isOpenUIProgram(openUI);
|
|
177
|
+
appendSegment(segments, ordinals, isOpenUI ? "openui" : "markdown", isOpenUI ? openUI : match[0]);
|
|
178
|
+
lastIndex = index + match[0].length;
|
|
179
|
+
}
|
|
180
|
+
const trailingMarkdown = content.slice(lastIndex);
|
|
181
|
+
if (trailingMarkdown.trim()) appendSegment(segments, ordinals, "markdown", trailingMarkdown);
|
|
182
|
+
if (segments.length > 0) return segments;
|
|
183
|
+
appendSegment(segments, ordinals, "markdown", content);
|
|
184
|
+
return segments;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {
|
|
188
|
+
UiErrorBoundary,
|
|
189
|
+
encodeOpenPanelActionMessage,
|
|
190
|
+
decodeOpenPanelActionMessage,
|
|
191
|
+
isSafeExternalUrl,
|
|
192
|
+
segmentOpenUIContent
|
|
193
|
+
};
|