@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
|
@@ -8,53 +8,84 @@ import {
|
|
|
8
8
|
getToolStatus,
|
|
9
9
|
useElapsedTime,
|
|
10
10
|
useToolComplete
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-R4BS3KYI.js";
|
|
12
12
|
import {
|
|
13
|
+
ActionSwapRollText,
|
|
14
|
+
AgentDisclosure,
|
|
13
15
|
CodeBlock,
|
|
14
16
|
FileDiff,
|
|
15
17
|
ToolResult,
|
|
16
18
|
ToolResultOutput
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KBMRRJQN.js";
|
|
20
|
+
import {
|
|
21
|
+
LazyMarkdown,
|
|
22
|
+
Trace,
|
|
23
|
+
TraceCollapsible,
|
|
24
|
+
TraceCollapsibleContent,
|
|
25
|
+
TraceCollapsibleTrigger,
|
|
26
|
+
TraceDescription,
|
|
27
|
+
TraceIcon,
|
|
28
|
+
TraceLine,
|
|
29
|
+
TraceTitle,
|
|
30
|
+
normalizeToolPart$1,
|
|
31
|
+
stripSandboxPrefixes,
|
|
32
|
+
toolActionIconForName,
|
|
33
|
+
useHoverCapable
|
|
34
|
+
} from "./chunk-V2GCVTDP.js";
|
|
18
35
|
import {
|
|
19
36
|
Collapsible$1,
|
|
20
37
|
CollapsibleContent,
|
|
21
38
|
CollapsibleTrigger
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
isSafeExternalUrl
|
|
25
|
-
} from "./chunk-OXEAXEWD.js";
|
|
39
|
+
} from "./chunk-5MOXRFX6.js";
|
|
26
40
|
import {
|
|
27
|
-
ActionSwapRollText,
|
|
28
|
-
AgentDisclosure,
|
|
29
41
|
EASE_IN_OUT,
|
|
30
42
|
EASE_OUT,
|
|
31
|
-
LazyMarkdown,
|
|
32
43
|
SPRING_LAYOUT,
|
|
33
44
|
SPRING_PRESS,
|
|
34
|
-
SPRING_SWAP
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
SPRING_SWAP
|
|
46
|
+
} from "./chunk-RX2ZJARF.js";
|
|
47
|
+
import {
|
|
48
|
+
isSafeExternalUrl
|
|
49
|
+
} from "./chunk-TQ2RECTH.js";
|
|
50
|
+
import {
|
|
51
|
+
useRender
|
|
52
|
+
} from "./chunk-CE7U5QB2.js";
|
|
38
53
|
import {
|
|
39
54
|
AnimatePresence,
|
|
40
55
|
m,
|
|
41
56
|
useReducedMotion
|
|
42
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-7DQQMT5V.js";
|
|
43
58
|
import {
|
|
44
59
|
mono
|
|
45
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-TXZDDJCT.js";
|
|
61
|
+
import {
|
|
62
|
+
bundledLanguages,
|
|
63
|
+
createHighlighter,
|
|
64
|
+
createJavaScriptRegexEngine,
|
|
65
|
+
createOnigurumaEngine,
|
|
66
|
+
normalizeTheme,
|
|
67
|
+
toHtml
|
|
68
|
+
} from "./chunk-2UGQEBXG.js";
|
|
69
|
+
import {
|
|
70
|
+
__exportAll
|
|
71
|
+
} from "./chunk-OO7NBFQQ.js";
|
|
72
|
+
import {
|
|
73
|
+
cva,
|
|
74
|
+
mergeProps
|
|
75
|
+
} from "./chunk-FSQWWR2M.js";
|
|
46
76
|
import {
|
|
47
|
-
|
|
77
|
+
ArrowUpRight,
|
|
48
78
|
Check,
|
|
49
79
|
ChevronDown,
|
|
50
80
|
ChevronRight,
|
|
51
|
-
ChevronUp,
|
|
52
81
|
ChevronsDown,
|
|
53
82
|
ChevronsUp,
|
|
83
|
+
Circle,
|
|
54
84
|
CircleAlert,
|
|
85
|
+
CircleCheck,
|
|
86
|
+
CircleDot,
|
|
55
87
|
CircleX,
|
|
56
88
|
Earth,
|
|
57
|
-
ExternalLink,
|
|
58
89
|
Eye,
|
|
59
90
|
FileCodeCorner,
|
|
60
91
|
FilePlus,
|
|
@@ -65,30 +96,17 @@ import {
|
|
|
65
96
|
ListTodo,
|
|
66
97
|
LoaderCircle,
|
|
67
98
|
LogOut,
|
|
68
|
-
MessageCircleQuestionMark,
|
|
69
99
|
RotateCcw,
|
|
100
|
+
Route,
|
|
70
101
|
Search,
|
|
71
102
|
ShieldCheck,
|
|
72
103
|
Sparkles,
|
|
73
104
|
Terminal,
|
|
74
|
-
X
|
|
75
|
-
} from "./chunk-GLH2GWMG.js";
|
|
76
|
-
import {
|
|
77
|
-
bundledLanguages,
|
|
78
|
-
createHighlighter,
|
|
79
|
-
createJavaScriptRegexEngine,
|
|
80
|
-
createOnigurumaEngine,
|
|
81
|
-
normalizeTheme,
|
|
82
|
-
toHtml
|
|
83
|
-
} from "./chunk-2UGQEBXG.js";
|
|
84
|
-
import {
|
|
85
|
-
__exportAll
|
|
86
|
-
} from "./chunk-OO7NBFQQ.js";
|
|
87
|
-
import {
|
|
105
|
+
X,
|
|
88
106
|
cn
|
|
89
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-VDEUVEWL.js";
|
|
90
108
|
|
|
91
|
-
// web/app/dist/server/assets/session-tool-renderer-
|
|
109
|
+
// web/app/dist/server/assets/session-tool-renderer-Cg_ZPHxS.js
|
|
92
110
|
import React, { memo, useCallback as useCallback4, useEffect as useEffect3, useId, useLayoutEffect as useLayoutEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
93
111
|
import { Fragment as Fragment$1, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
94
112
|
|
|
@@ -12230,7 +12248,7 @@ function MultiFileDiff({ oldFile, newFile, options, editorOptions, editStateKey,
|
|
|
12230
12248
|
});
|
|
12231
12249
|
}
|
|
12232
12250
|
|
|
12233
|
-
// web/app/dist/server/assets/session-tool-renderer-
|
|
12251
|
+
// web/app/dist/server/assets/session-tool-renderer-Cg_ZPHxS.js
|
|
12234
12252
|
function getFaviconUrl(value) {
|
|
12235
12253
|
try {
|
|
12236
12254
|
return new URL("/favicon.ico", value).toString();
|
|
@@ -12261,27 +12279,29 @@ function CitationFavicon({ url, className }) {
|
|
|
12261
12279
|
}
|
|
12262
12280
|
function CitationRow({ citation, index, idPrefix }) {
|
|
12263
12281
|
const safeUrl = citation.url && isSafeExternalUrl(citation.url) ? citation.url : void 0;
|
|
12264
|
-
const content = /* @__PURE__ */ jsxs3(
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
className: "
|
|
12270
|
-
children: citation.title
|
|
12271
|
-
|
|
12272
|
-
|
|
12282
|
+
const content = /* @__PURE__ */ jsxs3(TraceLine, {
|
|
12283
|
+
className: "w-full max-w-full rounded-md px-1.5 py-1 text-sm group-hover/citation:text-foreground",
|
|
12284
|
+
children: [
|
|
12285
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(CitationFavicon, { url: citation.url }) }),
|
|
12286
|
+
/* @__PURE__ */ jsxs3(TraceTitle, {
|
|
12287
|
+
className: "font-medium text-foreground/80 transition-colors group-hover/citation:text-foreground",
|
|
12288
|
+
children: [citation.title, safeUrl ? /* @__PURE__ */ jsx7("span", {
|
|
12289
|
+
className: "sr-only",
|
|
12290
|
+
children: " (opens in a new tab)"
|
|
12291
|
+
}) : null]
|
|
12292
|
+
}),
|
|
12293
|
+
citation.domain ? /* @__PURE__ */ jsx7(TraceDescription, {
|
|
12294
|
+
className: "max-w-40 truncate",
|
|
12273
12295
|
children: citation.domain
|
|
12274
|
-
}) : null
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
className: "flex shrink-0 items-center gap-1.5",
|
|
12278
|
-
children: [/* @__PURE__ */ jsx7("span", {
|
|
12279
|
-
className: "grid size-5 place-items-center rounded-md bg-foreground/[0.05] text-micro font-semibold tabular-nums text-muted-foreground",
|
|
12296
|
+
}) : null,
|
|
12297
|
+
/* @__PURE__ */ jsx7(TraceDescription, {
|
|
12298
|
+
className: "rounded-md bg-foreground/[0.05] px-1.5 py-0.5 text-micro font-semibold",
|
|
12280
12299
|
children: index
|
|
12281
|
-
}),
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
|
|
12300
|
+
}),
|
|
12301
|
+
safeUrl ? /* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(ArrowUpRight, {}) }) : null
|
|
12302
|
+
]
|
|
12303
|
+
});
|
|
12304
|
+
const className = "group/citation block rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
12285
12305
|
const id = citationTargetId(idPrefix, citation.id);
|
|
12286
12306
|
return safeUrl ? /* @__PURE__ */ jsx7("a", {
|
|
12287
12307
|
id,
|
|
@@ -12300,8 +12320,8 @@ function CitationList({ citations, idPrefix, className }) {
|
|
|
12300
12320
|
const reduce = useReducedMotion() ?? false;
|
|
12301
12321
|
const baseId = useId();
|
|
12302
12322
|
const resolvedPrefix = idPrefix ?? `citation-list-${baseId.replace(/:/g, "")}`;
|
|
12303
|
-
return /* @__PURE__ */ jsx7(
|
|
12304
|
-
className: cn("
|
|
12323
|
+
return /* @__PURE__ */ jsx7(Trace, {
|
|
12324
|
+
className: cn("gap-0.5", className),
|
|
12305
12325
|
children: /* @__PURE__ */ jsx7(AnimatePresence, {
|
|
12306
12326
|
mode: "popLayout",
|
|
12307
12327
|
children: citations.map((citation, index) => /* @__PURE__ */ jsx7(m.div, {
|
|
@@ -12336,9 +12356,7 @@ function CitationList({ citations, idPrefix, className }) {
|
|
|
12336
12356
|
});
|
|
12337
12357
|
}
|
|
12338
12358
|
function Citations({ citations, title = "Sources", open, defaultOpen = false, onOpenChange, idPrefix, className }) {
|
|
12339
|
-
const reduce = useReducedMotion() ?? false;
|
|
12340
12359
|
const baseId = useId();
|
|
12341
|
-
const contentId = `${baseId}-content`;
|
|
12342
12360
|
const resolvedPrefix = idPrefix ?? `citation-${baseId.replace(/:/g, "")}`;
|
|
12343
12361
|
const [internalOpen, setInternalOpen] = useState4(defaultOpen);
|
|
12344
12362
|
const currentOpen = open ?? internalOpen;
|
|
@@ -12346,41 +12364,25 @@ function Citations({ citations, title = "Sources", open, defaultOpen = false, on
|
|
|
12346
12364
|
if (open === void 0) setInternalOpen(next);
|
|
12347
12365
|
onOpenChange?.(next);
|
|
12348
12366
|
}, [onOpenChange, open]);
|
|
12349
|
-
return /* @__PURE__ */
|
|
12350
|
-
className: cn("
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
"aria-expanded": currentOpen,
|
|
12354
|
-
"aria-controls": contentId,
|
|
12355
|
-
onClick: () => setOpen(!currentOpen),
|
|
12356
|
-
className: "group -ml-1 flex min-h-8 items-center gap-2 rounded-lg px-1 text-left text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
12357
|
-
children: [
|
|
12358
|
-
/* @__PURE__ */ jsx7(BookOpenText, { className: "size-4" }),
|
|
12359
|
-
/* @__PURE__ */ jsx7("span", {
|
|
12360
|
-
className: "font-medium",
|
|
12361
|
-
children: title
|
|
12362
|
-
}),
|
|
12363
|
-
/* @__PURE__ */ jsx7("span", {
|
|
12364
|
-
className: "rounded-full bg-muted px-1.5 py-0.5 text-micro font-semibold tabular-nums",
|
|
12365
|
-
children: citations.length
|
|
12366
|
-
}),
|
|
12367
|
-
/* @__PURE__ */ jsx7(m.span, {
|
|
12368
|
-
"aria-hidden": "true",
|
|
12369
|
-
animate: { rotate: currentOpen ? 180 : 0 },
|
|
12370
|
-
transition: reduce ? { duration: 0 } : SPRING_SWAP,
|
|
12371
|
-
className: "text-muted-foreground/60",
|
|
12372
|
-
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
12373
|
-
})
|
|
12374
|
-
]
|
|
12375
|
-
}), /* @__PURE__ */ jsx7(AgentDisclosure, {
|
|
12376
|
-
id: contentId,
|
|
12367
|
+
return /* @__PURE__ */ jsx7(Trace, {
|
|
12368
|
+
className: cn("text-sm", className),
|
|
12369
|
+
"data-testid": "sources-trace",
|
|
12370
|
+
children: /* @__PURE__ */ jsxs3(TraceCollapsible, {
|
|
12377
12371
|
open: currentOpen,
|
|
12378
|
-
|
|
12372
|
+
onOpenChange: setOpen,
|
|
12373
|
+
children: [/* @__PURE__ */ jsx7(TraceCollapsibleTrigger, {
|
|
12374
|
+
"aria-label": `${typeof title === "string" || typeof title === "number" ? title : "Sources"} ${citations.length}`,
|
|
12375
|
+
children: /* @__PURE__ */ jsxs3(TraceLine, { children: [/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(Earth, {}) }), /* @__PURE__ */ jsxs3(TraceTitle, { children: [
|
|
12376
|
+
title,
|
|
12377
|
+
" (",
|
|
12378
|
+
citations.length,
|
|
12379
|
+
")"
|
|
12380
|
+
] })] })
|
|
12381
|
+
}), /* @__PURE__ */ jsx7(TraceCollapsibleContent, { children: /* @__PURE__ */ jsx7(CitationList, {
|
|
12379
12382
|
citations,
|
|
12380
|
-
idPrefix: resolvedPrefix
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
})]
|
|
12383
|
+
idPrefix: resolvedPrefix
|
|
12384
|
+
}) })]
|
|
12385
|
+
})
|
|
12384
12386
|
});
|
|
12385
12387
|
}
|
|
12386
12388
|
var STATUS_TEXT = {
|
|
@@ -12690,54 +12692,45 @@ function AgentPlan({ steps, activeIndex, className, ...props }) {
|
|
|
12690
12692
|
const total = steps.length;
|
|
12691
12693
|
const completed = !(total > 0) ? 0 : Math.floor(clamp(activeIndex, 0, total));
|
|
12692
12694
|
const allDone = completed >= total;
|
|
12693
|
-
const
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12695
|
+
const occurrences = /* @__PURE__ */ new Map();
|
|
12696
|
+
const stepKeys = steps.map((step) => {
|
|
12697
|
+
const occurrence = occurrences.get(step) ?? 0;
|
|
12698
|
+
occurrences.set(step, occurrence + 1);
|
|
12699
|
+
return `${step}:${occurrence}`;
|
|
12700
|
+
});
|
|
12701
|
+
return /* @__PURE__ */ jsx7(Trace, {
|
|
12702
|
+
"data-testid": "plan-trace",
|
|
12703
|
+
className: cn("max-w-sm", className),
|
|
12697
12704
|
...props,
|
|
12698
|
-
children:
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
}), /* @__PURE__ */ jsxs3("span", {
|
|
12705
|
-
className: cn(mono, "text-foreground/35 tabular-nums"),
|
|
12705
|
+
children: /* @__PURE__ */ jsxs3(TraceCollapsible, {
|
|
12706
|
+
defaultOpen: true,
|
|
12707
|
+
children: [/* @__PURE__ */ jsx7(TraceCollapsibleTrigger, {
|
|
12708
|
+
"aria-label": props["aria-label"] ?? `Plan: ${completed} of ${total} done`,
|
|
12709
|
+
children: /* @__PURE__ */ jsxs3(TraceLine, {
|
|
12710
|
+
status: allDone ? void 0 : "running",
|
|
12706
12711
|
children: [
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12712
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(Route, {}) }),
|
|
12713
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: "Plan" }),
|
|
12714
|
+
/* @__PURE__ */ jsx7(TraceDescription, {
|
|
12715
|
+
className: cn(mono, "text-xs"),
|
|
12716
|
+
children: `${completed} of ${total} done`
|
|
12717
|
+
})
|
|
12710
12718
|
]
|
|
12711
|
-
})]
|
|
12712
|
-
}),
|
|
12713
|
-
/* @__PURE__ */ jsx7("div", {
|
|
12714
|
-
className: "bg-foreground/[0.06] h-[3px] w-full overflow-hidden rounded-full",
|
|
12715
|
-
children: /* @__PURE__ */ jsx7("span", {
|
|
12716
|
-
className: "bg-foreground/80 block h-full rounded-full transition-[width] duration-500",
|
|
12717
|
-
style: { width: `${progress}%` }
|
|
12718
12719
|
})
|
|
12719
|
-
}),
|
|
12720
|
-
|
|
12721
|
-
|
|
12720
|
+
}), /* @__PURE__ */ jsx7(TraceCollapsibleContent, { children: /* @__PURE__ */ jsx7(Trace, {
|
|
12721
|
+
className: "gap-1",
|
|
12722
|
+
"data-slot": "plan-content",
|
|
12722
12723
|
children: steps.map((step, i) => {
|
|
12723
12724
|
const done = allDone || i < completed;
|
|
12724
12725
|
const active = !allDone && i === completed;
|
|
12725
|
-
return /* @__PURE__ */ jsxs3(
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
"aria-hidden": true,
|
|
12731
|
-
className: "bg-foreground/15 size-1.5 rounded-full"
|
|
12732
|
-
})
|
|
12733
|
-
}), /* @__PURE__ */ jsx7("span", {
|
|
12734
|
-
className: cn(done && "text-foreground/40", active && "text-foreground/90", !done && !active && "text-foreground/35"),
|
|
12735
|
-
children: step
|
|
12736
|
-
})]
|
|
12737
|
-
}, step);
|
|
12726
|
+
return /* @__PURE__ */ jsxs3(TraceLine, {
|
|
12727
|
+
"data-plan-step": true,
|
|
12728
|
+
status: active ? "running" : !done ? "pending" : void 0,
|
|
12729
|
+
children: [/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(done ? CircleCheck : active ? CircleDot : Circle, {}) }), /* @__PURE__ */ jsx7(TraceTitle, { children: step })]
|
|
12730
|
+
}, stepKeys[i]);
|
|
12738
12731
|
})
|
|
12739
|
-
})
|
|
12740
|
-
|
|
12732
|
+
}) })]
|
|
12733
|
+
})
|
|
12741
12734
|
});
|
|
12742
12735
|
}
|
|
12743
12736
|
function sessionAgentPlanPresentation(items) {
|
|
@@ -13083,6 +13076,75 @@ function TodoList({ items, title = "To-dos", open, defaultOpen = true, onOpenCha
|
|
|
13083
13076
|
})]
|
|
13084
13077
|
});
|
|
13085
13078
|
}
|
|
13079
|
+
var itemVariants = cva("group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", {
|
|
13080
|
+
variants: {
|
|
13081
|
+
variant: {
|
|
13082
|
+
default: "border-transparent",
|
|
13083
|
+
outline: "border-border",
|
|
13084
|
+
muted: "border-transparent bg-muted/50"
|
|
13085
|
+
},
|
|
13086
|
+
size: {
|
|
13087
|
+
default: "gap-2.5 px-3 py-2.5",
|
|
13088
|
+
sm: "gap-2.5 px-3 py-2.5",
|
|
13089
|
+
xs: "gap-2 px-2.5 py-2"
|
|
13090
|
+
}
|
|
13091
|
+
},
|
|
13092
|
+
defaultVariants: {
|
|
13093
|
+
variant: "default",
|
|
13094
|
+
size: "default"
|
|
13095
|
+
}
|
|
13096
|
+
});
|
|
13097
|
+
function Item({ className, variant = "default", size = "default", render: render2, ...props }) {
|
|
13098
|
+
return useRender({
|
|
13099
|
+
defaultTagName: "div",
|
|
13100
|
+
props: mergeProps({ className: cn(itemVariants({
|
|
13101
|
+
variant,
|
|
13102
|
+
size,
|
|
13103
|
+
className
|
|
13104
|
+
})) }, props),
|
|
13105
|
+
render: render2,
|
|
13106
|
+
state: {
|
|
13107
|
+
slot: "item",
|
|
13108
|
+
variant,
|
|
13109
|
+
size
|
|
13110
|
+
}
|
|
13111
|
+
});
|
|
13112
|
+
}
|
|
13113
|
+
function ItemMedia({ className, ...props }) {
|
|
13114
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13115
|
+
"data-slot": "item-media",
|
|
13116
|
+
className: cn("flex shrink-0 items-center justify-center [&_svg]:size-4", className),
|
|
13117
|
+
...props
|
|
13118
|
+
});
|
|
13119
|
+
}
|
|
13120
|
+
function ItemContent({ className, ...props }) {
|
|
13121
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13122
|
+
"data-slot": "item-content",
|
|
13123
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-1", className),
|
|
13124
|
+
...props
|
|
13125
|
+
});
|
|
13126
|
+
}
|
|
13127
|
+
function ItemTitle({ className, ...props }) {
|
|
13128
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13129
|
+
"data-slot": "item-title",
|
|
13130
|
+
className: cn("text-sm font-medium leading-snug", className),
|
|
13131
|
+
...props
|
|
13132
|
+
});
|
|
13133
|
+
}
|
|
13134
|
+
function ItemDescription({ className, ...props }) {
|
|
13135
|
+
return /* @__PURE__ */ jsx7("p", {
|
|
13136
|
+
"data-slot": "item-description",
|
|
13137
|
+
className: cn("text-sm leading-normal text-muted-foreground", className),
|
|
13138
|
+
...props
|
|
13139
|
+
});
|
|
13140
|
+
}
|
|
13141
|
+
function ItemActions({ className, ...props }) {
|
|
13142
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13143
|
+
"data-slot": "item-actions",
|
|
13144
|
+
className: cn("flex items-center gap-2", className),
|
|
13145
|
+
...props
|
|
13146
|
+
});
|
|
13147
|
+
}
|
|
13086
13148
|
function getStatusCopy(status) {
|
|
13087
13149
|
if (status === "approving") return "Approving";
|
|
13088
13150
|
if (status === "approved") return "Approved";
|
|
@@ -13115,61 +13177,55 @@ function ToolApproval({ tool, title = "Allow this tool to run?", description, pa
|
|
|
13115
13177
|
if (previousStatus.current === "pending" && status !== "pending") setOpen(false);
|
|
13116
13178
|
previousStatus.current = status;
|
|
13117
13179
|
}, [setOpen, status]);
|
|
13118
|
-
return /* @__PURE__ */ jsxs3(
|
|
13180
|
+
return /* @__PURE__ */ jsxs3(Item, {
|
|
13181
|
+
variant: "outline",
|
|
13182
|
+
size: "sm",
|
|
13119
13183
|
"data-state": status,
|
|
13120
13184
|
"aria-busy": busy,
|
|
13121
|
-
className: cn("
|
|
13122
|
-
children: [
|
|
13185
|
+
className: cn("items-start rounded-2xl bg-muted/20 p-4", className),
|
|
13186
|
+
children: [/* @__PURE__ */ jsx7(ItemMedia, {
|
|
13187
|
+
"aria-hidden": "true",
|
|
13188
|
+
className: cn("mt-0.5 grid size-8 place-items-center rounded-xl border border-border/60 bg-background text-muted-foreground", error && "text-destructive"),
|
|
13189
|
+
children: busy ? /* @__PURE__ */ jsx7(LoaderCircle, { className: cn("size-4", !reduce && "animate-spin") }) : error ? /* @__PURE__ */ jsx7(CircleAlert, { className: "size-4" }) : status === "denied" ? /* @__PURE__ */ jsx7(X, { className: "size-4" }) : status === "approved" || status === "complete" ? /* @__PURE__ */ jsx7(Check, { className: "size-4" }) : /* @__PURE__ */ jsx7(ShieldCheck, { className: "size-4" })
|
|
13190
|
+
}), /* @__PURE__ */ jsxs3(ItemContent, { children: [
|
|
13123
13191
|
/* @__PURE__ */ jsxs3("div", {
|
|
13124
|
-
className: "flex items-start gap-3
|
|
13125
|
-
children: [/* @__PURE__ */
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
className: "font-medium text-foreground",
|
|
13138
|
-
children: title
|
|
13139
|
-
}), /* @__PURE__ */ jsx7("div", {
|
|
13140
|
-
className: "mt-0.5 truncate font-mono text-xs text-muted-foreground",
|
|
13141
|
-
children: tool
|
|
13142
|
-
})]
|
|
13143
|
-
}), /* @__PURE__ */ jsx7("span", {
|
|
13144
|
-
className: cn("shrink-0 rounded-full border px-2 py-0.5 text-caption font-medium transition-colors", getStatusBadgeClass(status)),
|
|
13145
|
-
children: getStatusCopy(status)
|
|
13146
|
-
})]
|
|
13147
|
-
}),
|
|
13148
|
-
description ? /* @__PURE__ */ jsx7("p", {
|
|
13149
|
-
className: "mt-2 leading-5 text-muted-foreground",
|
|
13150
|
-
children: description
|
|
13151
|
-
}) : null,
|
|
13152
|
-
parameters.length ? /* @__PURE__ */ jsxs3("button", {
|
|
13153
|
-
type: "button",
|
|
13154
|
-
"aria-expanded": currentOpen,
|
|
13155
|
-
"aria-controls": detailsId,
|
|
13156
|
-
onClick: () => setOpen(!currentOpen),
|
|
13157
|
-
className: "mt-2 inline-flex items-center gap-1 rounded-md text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
13158
|
-
children: ["View details", /* @__PURE__ */ jsx7(m.span, {
|
|
13159
|
-
"aria-hidden": "true",
|
|
13160
|
-
animate: { rotate: currentOpen ? 180 : 0 },
|
|
13161
|
-
transition: reduce ? { duration: 0 } : SPRING_SWAP,
|
|
13162
|
-
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
13163
|
-
})]
|
|
13164
|
-
}) : null
|
|
13165
|
-
]
|
|
13192
|
+
className: "flex min-w-0 items-start justify-between gap-3",
|
|
13193
|
+
children: [/* @__PURE__ */ jsxs3("div", {
|
|
13194
|
+
className: "min-w-0",
|
|
13195
|
+
children: [/* @__PURE__ */ jsx7(ItemTitle, {
|
|
13196
|
+
className: "text-foreground",
|
|
13197
|
+
children: title
|
|
13198
|
+
}), /* @__PURE__ */ jsx7("div", {
|
|
13199
|
+
className: "mt-0.5 truncate font-mono text-xs text-muted-foreground",
|
|
13200
|
+
children: tool
|
|
13201
|
+
})]
|
|
13202
|
+
}), /* @__PURE__ */ jsx7("span", {
|
|
13203
|
+
className: cn("shrink-0 rounded-full border px-2 py-0.5 text-caption font-medium transition-colors", getStatusBadgeClass(status)),
|
|
13204
|
+
children: getStatusCopy(status)
|
|
13166
13205
|
})]
|
|
13167
13206
|
}),
|
|
13207
|
+
description ? /* @__PURE__ */ jsx7(ItemDescription, {
|
|
13208
|
+
className: "mt-1 leading-5",
|
|
13209
|
+
children: description
|
|
13210
|
+
}) : null,
|
|
13211
|
+
parameters.length ? /* @__PURE__ */ jsxs3("button", {
|
|
13212
|
+
type: "button",
|
|
13213
|
+
"aria-expanded": currentOpen,
|
|
13214
|
+
"aria-controls": detailsId,
|
|
13215
|
+
onClick: () => setOpen(!currentOpen),
|
|
13216
|
+
className: "mt-2 inline-flex items-center gap-1 rounded-md text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
13217
|
+
children: ["View details", /* @__PURE__ */ jsx7(m.span, {
|
|
13218
|
+
"aria-hidden": "true",
|
|
13219
|
+
animate: { rotate: currentOpen ? 180 : 0 },
|
|
13220
|
+
transition: reduce ? { duration: 0 } : SPRING_SWAP,
|
|
13221
|
+
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
13222
|
+
})]
|
|
13223
|
+
}) : null,
|
|
13168
13224
|
/* @__PURE__ */ jsx7(AgentDisclosure, {
|
|
13169
13225
|
id: detailsId,
|
|
13170
13226
|
open: currentOpen,
|
|
13171
13227
|
children: /* @__PURE__ */ jsx7("dl", {
|
|
13172
|
-
className: "
|
|
13228
|
+
className: "mt-3 grid gap-2 rounded-xl border border-border/50 bg-background/70 p-3",
|
|
13173
13229
|
children: parameters.map((parameter) => /* @__PURE__ */ jsxs3("div", {
|
|
13174
13230
|
className: "grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] items-center gap-3 text-xs",
|
|
13175
13231
|
children: [/* @__PURE__ */ jsx7("dt", {
|
|
@@ -13184,7 +13240,7 @@ function ToolApproval({ tool, title = "Allow this tool to run?", description, pa
|
|
|
13184
13240
|
}),
|
|
13185
13241
|
/* @__PURE__ */ jsx7(AnimatePresence, {
|
|
13186
13242
|
initial: false,
|
|
13187
|
-
children: pending ? /* @__PURE__ */
|
|
13243
|
+
children: pending ? /* @__PURE__ */ jsx7(m.div, {
|
|
13188
13244
|
initial: reduce ? { opacity: 0 } : {
|
|
13189
13245
|
opacity: 0,
|
|
13190
13246
|
y: 4
|
|
@@ -13198,672 +13254,37 @@ function ToolApproval({ tool, title = "Allow this tool to run?", description, pa
|
|
|
13198
13254
|
duration: reduce ? 0.12 : 0.22,
|
|
13199
13255
|
ease: EASE_OUT
|
|
13200
13256
|
},
|
|
13201
|
-
className: "
|
|
13202
|
-
children:
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13257
|
+
className: "mt-2",
|
|
13258
|
+
children: /* @__PURE__ */ jsxs3(ItemActions, {
|
|
13259
|
+
className: "flex-wrap",
|
|
13260
|
+
children: [
|
|
13261
|
+
/* @__PURE__ */ jsx7(m.button, {
|
|
13262
|
+
type: "button",
|
|
13263
|
+
onClick: onApprove,
|
|
13264
|
+
whileTap: reduce ? void 0 : { scale: 0.96 },
|
|
13265
|
+
transition: SPRING_PRESS,
|
|
13266
|
+
className: "rounded-xl bg-foreground px-3 py-1.5 text-xs font-medium text-background outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
13267
|
+
children: "Allow once"
|
|
13268
|
+
}),
|
|
13269
|
+
onAlwaysAllow ? /* @__PURE__ */ jsx7(m.button, {
|
|
13270
|
+
type: "button",
|
|
13271
|
+
onClick: onAlwaysAllow,
|
|
13272
|
+
whileTap: reduce ? void 0 : { scale: 0.96 },
|
|
13273
|
+
transition: SPRING_PRESS,
|
|
13274
|
+
className: "rounded-xl border border-border/60 bg-background px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
|
|
13275
|
+
children: "Always allow"
|
|
13276
|
+
}) : null,
|
|
13277
|
+
/* @__PURE__ */ jsx7("button", {
|
|
13278
|
+
type: "button",
|
|
13279
|
+
onClick: onDeny,
|
|
13280
|
+
className: "rounded-xl px-3 py-1.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
13281
|
+
children: "Deny"
|
|
13282
|
+
})
|
|
13283
|
+
]
|
|
13284
|
+
})
|
|
13226
13285
|
}) : null
|
|
13227
13286
|
})
|
|
13228
|
-
]
|
|
13229
|
-
});
|
|
13230
|
-
}
|
|
13231
|
-
function asRecord(value) {
|
|
13232
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
13233
|
-
}
|
|
13234
|
-
function parseRecord(value) {
|
|
13235
|
-
const direct = asRecord(value);
|
|
13236
|
-
if (direct) return direct;
|
|
13237
|
-
if (typeof value !== "string") return void 0;
|
|
13238
|
-
try {
|
|
13239
|
-
return asRecord(JSON.parse(value));
|
|
13240
|
-
} catch {
|
|
13241
|
-
return;
|
|
13242
|
-
}
|
|
13243
|
-
}
|
|
13244
|
-
function getString(record, ...keys) {
|
|
13245
|
-
for (const key of keys) {
|
|
13246
|
-
const value = record?.[key];
|
|
13247
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
13248
|
-
}
|
|
13249
|
-
}
|
|
13250
|
-
function getNumber(record, ...keys) {
|
|
13251
|
-
for (const key of keys) {
|
|
13252
|
-
const value = record?.[key];
|
|
13253
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
13254
|
-
if (typeof value === "string" && value.trim()) {
|
|
13255
|
-
const parsed = Number(value);
|
|
13256
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
13257
|
-
}
|
|
13258
|
-
}
|
|
13259
|
-
}
|
|
13260
|
-
function getBoolean(record, ...keys) {
|
|
13261
|
-
for (const key of keys) {
|
|
13262
|
-
const value = record?.[key];
|
|
13263
|
-
if (typeof value === "boolean") return value;
|
|
13264
|
-
}
|
|
13265
|
-
}
|
|
13266
|
-
function stringifyToolValue(value) {
|
|
13267
|
-
if (typeof value === "string") return value;
|
|
13268
|
-
if (value === void 0 || value === null) return "";
|
|
13269
|
-
try {
|
|
13270
|
-
return JSON.stringify(value, null, 2);
|
|
13271
|
-
} catch {
|
|
13272
|
-
return String(value);
|
|
13273
|
-
}
|
|
13274
|
-
}
|
|
13275
|
-
function getOutput(part) {
|
|
13276
|
-
if (part.output !== void 0 && part.output !== null) return part.output;
|
|
13277
|
-
return part.result;
|
|
13278
|
-
}
|
|
13279
|
-
function summarizeOutput(output) {
|
|
13280
|
-
const record = parseRecord(output);
|
|
13281
|
-
const details = parseRecord(record?.details);
|
|
13282
|
-
const fields = {
|
|
13283
|
-
...record ?? {},
|
|
13284
|
-
...details ?? {}
|
|
13285
|
-
};
|
|
13286
|
-
const result = fields.result;
|
|
13287
|
-
const stdout = getString(fields, "stdout", "standardOutput", "standard_output");
|
|
13288
|
-
const stderr = getString(fields, "stderr", "standardError", "standard_error");
|
|
13289
|
-
const errorValue = fields.error ?? fields.errorMessage ?? fields.evalue;
|
|
13290
|
-
const error = errorValue === void 0 ? void 0 : stringifyToolValue(errorValue);
|
|
13291
|
-
const durationMs = getNumber(fields, "durationMs", "duration_ms", "duration");
|
|
13292
|
-
const kernelRestarted = getBoolean(fields, "kernelRestarted", "kernel_restarted");
|
|
13293
|
-
const structuredKeys = /* @__PURE__ */ new Set([
|
|
13294
|
-
"stdout",
|
|
13295
|
-
"stderr",
|
|
13296
|
-
"standardOutput",
|
|
13297
|
-
"standard_output",
|
|
13298
|
-
"standardError",
|
|
13299
|
-
"standard_error",
|
|
13300
|
-
"error",
|
|
13301
|
-
"errorMessage",
|
|
13302
|
-
"evalue",
|
|
13303
|
-
"durationMs",
|
|
13304
|
-
"duration_ms",
|
|
13305
|
-
"duration",
|
|
13306
|
-
"kernelRestarted",
|
|
13307
|
-
"kernel_restarted",
|
|
13308
|
-
"status",
|
|
13309
|
-
"isError"
|
|
13310
|
-
]);
|
|
13311
|
-
const hasStructuredFields = Object.keys(fields).some((key) => !structuredKeys.has(key));
|
|
13312
|
-
return {
|
|
13313
|
-
record,
|
|
13314
|
-
details,
|
|
13315
|
-
stdout,
|
|
13316
|
-
stderr,
|
|
13317
|
-
result,
|
|
13318
|
-
error,
|
|
13319
|
-
durationMs,
|
|
13320
|
-
kernelRestarted,
|
|
13321
|
-
structured: !stdout && !stderr && !error && (typeof result === "object" && result !== null || hasStructuredFields)
|
|
13322
|
-
};
|
|
13323
|
-
}
|
|
13324
|
-
function getOutputSections(summary, output) {
|
|
13325
|
-
const sections = [];
|
|
13326
|
-
if (summary.stdout) sections.push({
|
|
13327
|
-
label: "stdout",
|
|
13328
|
-
content: summary.stdout,
|
|
13329
|
-
language: "text"
|
|
13330
|
-
});
|
|
13331
|
-
if (summary.stderr) sections.push({
|
|
13332
|
-
label: "stderr",
|
|
13333
|
-
content: summary.stderr,
|
|
13334
|
-
language: "text"
|
|
13335
|
-
});
|
|
13336
|
-
if (summary.result !== void 0) sections.push({
|
|
13337
|
-
label: "result",
|
|
13338
|
-
content: stringifyToolValue(summary.result),
|
|
13339
|
-
language: typeof summary.result === "object" && summary.result !== null ? "json" : "text"
|
|
13340
|
-
});
|
|
13341
|
-
if (summary.error) sections.push({
|
|
13342
|
-
label: "error",
|
|
13343
|
-
content: summary.error,
|
|
13344
|
-
language: "text"
|
|
13345
|
-
});
|
|
13346
|
-
if (sections.length > 0) return sections;
|
|
13347
|
-
const record = summary.details ?? summary.record;
|
|
13348
|
-
if (record) {
|
|
13349
|
-
const withoutEnvelope = { ...record };
|
|
13350
|
-
delete withoutEnvelope.details;
|
|
13351
|
-
delete withoutEnvelope.isError;
|
|
13352
|
-
if (Object.keys(withoutEnvelope).length > 0) return [{
|
|
13353
|
-
label: "result",
|
|
13354
|
-
content: stringifyToolValue(withoutEnvelope),
|
|
13355
|
-
language: "json"
|
|
13356
|
-
}];
|
|
13357
|
-
}
|
|
13358
|
-
const fallback = stringifyToolValue(output);
|
|
13359
|
-
return fallback.trim() ? [{
|
|
13360
|
-
label: "output",
|
|
13361
|
-
content: fallback,
|
|
13362
|
-
language: "text"
|
|
13363
|
-
}] : [];
|
|
13364
|
-
}
|
|
13365
|
-
function getOutputContent(summary, output) {
|
|
13366
|
-
return getOutputSections(summary, output).map((section) => `${section.label}
|
|
13367
|
-
${section.content}`).join("\n\n");
|
|
13368
|
-
}
|
|
13369
|
-
function getInput(part) {
|
|
13370
|
-
return parseRecord(part.input) ?? parseRecord(part.args);
|
|
13371
|
-
}
|
|
13372
|
-
function getArray(record, ...keys) {
|
|
13373
|
-
for (const key of keys) {
|
|
13374
|
-
const value = record?.[key];
|
|
13375
|
-
if (Array.isArray(value)) return value;
|
|
13376
|
-
}
|
|
13377
|
-
}
|
|
13378
|
-
function getDiff(input, summary) {
|
|
13379
|
-
return getString(summary.details ?? summary.record, "diff", "patch") ?? getString(input, "diff", "patch");
|
|
13380
|
-
}
|
|
13381
|
-
function getFilePath(input, summary) {
|
|
13382
|
-
return getString(input, "path", "filePath", "filename", "file") ?? getString(summary.details ?? summary.record, "path", "filePath", "filename", "file") ?? "workspace file";
|
|
13383
|
-
}
|
|
13384
|
-
function parseDiffLines(diff) {
|
|
13385
|
-
return diff.split("\n").map((content, index) => ({
|
|
13386
|
-
id: `${index}-${content.slice(0, 16)}`,
|
|
13387
|
-
type: content.startsWith("+") && !content.startsWith("+++") ? "added" : content.startsWith("-") && !content.startsWith("---") ? "removed" : "context",
|
|
13388
|
-
content
|
|
13389
|
-
}));
|
|
13390
|
-
}
|
|
13391
|
-
function getTodos(input, summary) {
|
|
13392
|
-
const output = summary.details ?? summary.record;
|
|
13393
|
-
const plan = parseRecord(input?.plan) ?? parseRecord(output?.plan);
|
|
13394
|
-
const source = getArray(input, "todos") ?? getArray(plan, "todos", "items") ?? getArray(output, "todos", "newTodos", "items");
|
|
13395
|
-
if (!source) return [];
|
|
13396
|
-
return source.flatMap((item, index) => {
|
|
13397
|
-
const record = asRecord(item);
|
|
13398
|
-
if (!record) return [];
|
|
13399
|
-
const title = getString(record, "content", "title", "text", "label");
|
|
13400
|
-
if (!title) return [];
|
|
13401
|
-
const rawStatus = getString(record, "status");
|
|
13402
|
-
const status = rawStatus === "in_progress" || rawStatus === "in-progress" ? "in-progress" : rawStatus === "completed" ? "completed" : rawStatus === "cancelled" ? "cancelled" : "pending";
|
|
13403
|
-
return [{
|
|
13404
|
-
id: `${index}-${title}`,
|
|
13405
|
-
title,
|
|
13406
|
-
status
|
|
13407
|
-
}];
|
|
13408
|
-
});
|
|
13409
|
-
}
|
|
13410
|
-
function getCitations(summary) {
|
|
13411
|
-
const source = getArray(summary.details ?? summary.record, "results", "sources", "citations");
|
|
13412
|
-
if (!source) return [];
|
|
13413
|
-
return source.flatMap((item, index) => {
|
|
13414
|
-
const record = asRecord(item);
|
|
13415
|
-
if (!record) return [];
|
|
13416
|
-
const title = getString(record, "title", "name", "snippet");
|
|
13417
|
-
if (!title) return [];
|
|
13418
|
-
const rawUrl = getString(record, "url", "link");
|
|
13419
|
-
const url = rawUrl && isSafeExternalUrl(rawUrl) ? rawUrl : void 0;
|
|
13420
|
-
return [{
|
|
13421
|
-
id: `${index}-${title}`,
|
|
13422
|
-
title,
|
|
13423
|
-
url,
|
|
13424
|
-
domain: getString(record, "domain", "source")
|
|
13425
|
-
}];
|
|
13426
|
-
});
|
|
13427
|
-
}
|
|
13428
|
-
function getImageUrl(summary) {
|
|
13429
|
-
return getString(summary.details ?? summary.record, "url", "imageUrl", "image_url");
|
|
13430
|
-
}
|
|
13431
|
-
function getApproval(input, summary) {
|
|
13432
|
-
return asRecord(input?.approval) ?? asRecord(summary.details?.approval) ?? asRecord(summary.record?.approval);
|
|
13433
|
-
}
|
|
13434
|
-
function toolName(part) {
|
|
13435
|
-
const type = typeof part.type === "string" ? part.type : "Tool";
|
|
13436
|
-
return type.startsWith("tool-") ? type.slice(5) : type;
|
|
13437
|
-
}
|
|
13438
|
-
function resultStatus(part, chatStatus) {
|
|
13439
|
-
const state = typeof part.state === "string" ? part.state : void 0;
|
|
13440
|
-
if (state === "output-error" || state === "error") return "error";
|
|
13441
|
-
if (state === "output-available" || state === "complete" || state === "success") return "success";
|
|
13442
|
-
if (state === "cancelled" || state === "canceled" || state === "aborted" || state === "interrupted") return "cancelled";
|
|
13443
|
-
if (part.error !== void 0) return "error";
|
|
13444
|
-
if (state === "input-streaming" || state === "streaming") return chatStatus === "streaming" ? "running" : "cancelled";
|
|
13445
|
-
if (part.output !== void 0 || part.result !== void 0) return "success";
|
|
13446
|
-
return chatStatus === "streaming" ? "running" : "cancelled";
|
|
13447
|
-
}
|
|
13448
|
-
function languageFor(name, structured) {
|
|
13449
|
-
if (structured || name.toLowerCase().includes("json")) return "json";
|
|
13450
|
-
if (name.toLowerCase().includes("bash") || name.toLowerCase().includes("shell")) return "bash";
|
|
13451
|
-
if (name.toLowerCase().includes("python")) return "python";
|
|
13452
|
-
return "text";
|
|
13453
|
-
}
|
|
13454
|
-
function sourceLanguageFor(name, command) {
|
|
13455
|
-
if (!command) return void 0;
|
|
13456
|
-
const lowerName = name.toLowerCase();
|
|
13457
|
-
if (lowerName.includes("bash") || lowerName.includes("shell")) return "bash";
|
|
13458
|
-
if (lowerName.includes("python")) return /^\s*%%bash(?:\s|$)/im.test(command) ? "bash" : "python";
|
|
13459
|
-
return "text";
|
|
13460
|
-
}
|
|
13461
|
-
function sourceLabelFor(name, language) {
|
|
13462
|
-
if (!language) return void 0;
|
|
13463
|
-
const lowerName = name.toLowerCase();
|
|
13464
|
-
if (lowerName.includes("ipython")) return "IPython";
|
|
13465
|
-
if (lowerName.includes("bash") || lowerName.includes("shell")) return "Bash";
|
|
13466
|
-
if (lowerName.includes("python")) return "Python";
|
|
13467
|
-
if (language === "json") return "JSON";
|
|
13468
|
-
if (language === "text") return "Text";
|
|
13469
|
-
return language.toUpperCase();
|
|
13470
|
-
}
|
|
13471
|
-
var normalizeCache = /* @__PURE__ */ new WeakMap();
|
|
13472
|
-
function normalizeToolPart(part, chatStatus) {
|
|
13473
|
-
if (part && typeof part === "object") {
|
|
13474
|
-
const cached = normalizeCache.get(part);
|
|
13475
|
-
if (cached && cached.chatStatus === chatStatus) return cached.value;
|
|
13476
|
-
const value = normalizeToolPartUncached(part, chatStatus);
|
|
13477
|
-
normalizeCache.set(part, {
|
|
13478
|
-
chatStatus,
|
|
13479
|
-
value
|
|
13480
|
-
});
|
|
13481
|
-
return value;
|
|
13482
|
-
}
|
|
13483
|
-
return normalizeToolPartUncached(part, chatStatus);
|
|
13484
|
-
}
|
|
13485
|
-
function normalizeToolPartUncached(part, chatStatus) {
|
|
13486
|
-
const source = asRecord(part);
|
|
13487
|
-
if (!source) return void 0;
|
|
13488
|
-
const name = toolName(source);
|
|
13489
|
-
const lowerName = name.toLowerCase();
|
|
13490
|
-
const input = getInput(source);
|
|
13491
|
-
const output = getOutput(source);
|
|
13492
|
-
const outputSummary = summarizeOutput(output);
|
|
13493
|
-
const status = resultStatus(source, chatStatus);
|
|
13494
|
-
const command = getString(input, "command", "cmd", "code", "script");
|
|
13495
|
-
const sourceLanguage = sourceLanguageFor(name, command);
|
|
13496
|
-
const metadata = [];
|
|
13497
|
-
if (outputSummary.durationMs !== void 0) metadata.push(`${outputSummary.durationMs}ms`);
|
|
13498
|
-
if (outputSummary.kernelRestarted) metadata.push("kernel restarted");
|
|
13499
|
-
const diff = getDiff(input, outputSummary);
|
|
13500
|
-
const todos = lowerName.includes("todo") || lowerName.includes("plan") ? getTodos(input, outputSummary) : [];
|
|
13501
|
-
const citations = lowerName.includes("search") || lowerName.includes("web") || lowerName.includes("source") || lowerName.includes("citation") ? getCitations(outputSummary) : [];
|
|
13502
|
-
const imageUrl = lowerName.includes("image") || lowerName.includes("generat") ? getImageUrl(outputSummary) : void 0;
|
|
13503
|
-
const approval = getApproval(input, outputSummary);
|
|
13504
|
-
const content = getOutputContent(outputSummary, output);
|
|
13505
|
-
const hasOutputContent = Boolean(content.trim());
|
|
13506
|
-
const id = typeof source.toolCallId === "string" && source.toolCallId ? source.toolCallId : `${name}-${JSON.stringify(input ?? {})}`;
|
|
13507
|
-
let detail;
|
|
13508
|
-
if (todos.length > 0) detail = {
|
|
13509
|
-
kind: "todo",
|
|
13510
|
-
title: lowerName.includes("plan") ? "Plan" : "Todo list",
|
|
13511
|
-
items: todos
|
|
13512
|
-
};
|
|
13513
|
-
else if (citations.length > 0) detail = {
|
|
13514
|
-
kind: "citations",
|
|
13515
|
-
citations
|
|
13516
|
-
};
|
|
13517
|
-
else if (imageUrl) detail = {
|
|
13518
|
-
kind: "image",
|
|
13519
|
-
url: imageUrl
|
|
13520
|
-
};
|
|
13521
|
-
else if (diff && (lowerName.includes("edit") || lowerName.includes("write") || lowerName.includes("patch"))) detail = {
|
|
13522
|
-
kind: "diff",
|
|
13523
|
-
file: getFilePath(input, outputSummary),
|
|
13524
|
-
lines: parseDiffLines(diff),
|
|
13525
|
-
copyText: diff
|
|
13526
|
-
};
|
|
13527
|
-
else if (command || hasOutputContent || approval || metadata.length > 0) detail = {
|
|
13528
|
-
kind: "output",
|
|
13529
|
-
content,
|
|
13530
|
-
language: languageFor(name, outputSummary.structured),
|
|
13531
|
-
structured: outputSummary.structured,
|
|
13532
|
-
sections: getOutputSections(outputSummary, output),
|
|
13533
|
-
sourceCode: command,
|
|
13534
|
-
sourceLanguage,
|
|
13535
|
-
sourceLabel: sourceLabelFor(name, sourceLanguage)
|
|
13536
|
-
};
|
|
13537
|
-
return {
|
|
13538
|
-
id,
|
|
13539
|
-
name,
|
|
13540
|
-
lowerName,
|
|
13541
|
-
status,
|
|
13542
|
-
input,
|
|
13543
|
-
output,
|
|
13544
|
-
outputSummary,
|
|
13545
|
-
command,
|
|
13546
|
-
metadata,
|
|
13547
|
-
approval,
|
|
13548
|
-
detail
|
|
13549
|
-
};
|
|
13550
|
-
}
|
|
13551
|
-
var QUESTION_CUSTOM_ID = "__custom__";
|
|
13552
|
-
function optionBadge(idx) {
|
|
13553
|
-
return String.fromCharCode(65 + idx);
|
|
13554
|
-
}
|
|
13555
|
-
function seedPromptState(initialAnswer, questionKind, customEnabled) {
|
|
13556
|
-
if (!initialAnswer || initialAnswer.kind === "skip") return {
|
|
13557
|
-
selectedIds: [],
|
|
13558
|
-
customText: "",
|
|
13559
|
-
textValue: ""
|
|
13560
|
-
};
|
|
13561
|
-
if (questionKind === "text") return {
|
|
13562
|
-
selectedIds: [],
|
|
13563
|
-
customText: "",
|
|
13564
|
-
textValue: initialAnswer.text ?? ""
|
|
13565
|
-
};
|
|
13566
|
-
const nextSelected = new Set(initialAnswer.selectedIds ?? []);
|
|
13567
|
-
const nextCustomText = initialAnswer.text ?? "";
|
|
13568
|
-
if (customEnabled && nextCustomText.trim().length > 0) nextSelected.add(QUESTION_CUSTOM_ID);
|
|
13569
|
-
return {
|
|
13570
|
-
selectedIds: Array.from(nextSelected),
|
|
13571
|
-
customText: nextCustomText,
|
|
13572
|
-
textValue: ""
|
|
13573
|
-
};
|
|
13574
|
-
}
|
|
13575
|
-
function QuestionPrompt({ questions, questionIndex = 1, totalQuestions, onPreviousQuestion, onNextQuestion, submitLabel = "Send", nextLabel = "Next", skipLabel = "Skip", allowSkip = true, initialAnswer, onSubmit, onSkip, className }) {
|
|
13576
|
-
const resolvedTotal = totalQuestions ?? questions.length;
|
|
13577
|
-
const clampedIndex = Math.max(1, Math.min(questionIndex, resolvedTotal));
|
|
13578
|
-
const activeQuestion = questions[clampedIndex - 1];
|
|
13579
|
-
const customEnabled = activeQuestion?.allowCustom ?? false;
|
|
13580
|
-
const [selectedIds, setSelectedIds] = useState4(() => seedPromptState(initialAnswer, activeQuestion?.kind, customEnabled).selectedIds);
|
|
13581
|
-
const [customText, setCustomText] = useState4(() => seedPromptState(initialAnswer, activeQuestion?.kind, customEnabled).customText);
|
|
13582
|
-
const [textValue, setTextValue] = useState4(() => seedPromptState(initialAnswer, activeQuestion?.kind, customEnabled).textValue);
|
|
13583
|
-
const showNav = resolvedTotal > 1 && (!!onPreviousQuestion || !!onNextQuestion);
|
|
13584
|
-
const canGoPrev = clampedIndex > 1;
|
|
13585
|
-
const canGoNext = clampedIndex < resolvedTotal;
|
|
13586
|
-
const isLastQuestion = clampedIndex >= resolvedTotal;
|
|
13587
|
-
const selectedIdSet = useMemo2(() => new Set(selectedIds), [selectedIds]);
|
|
13588
|
-
const primaryLabel = isLastQuestion ? submitLabel : nextLabel;
|
|
13589
|
-
const canSubmit = useMemo2(() => {
|
|
13590
|
-
if (activeQuestion?.kind === "text") return textValue.trim().length > 0;
|
|
13591
|
-
const total = selectedIds.filter((id) => id !== QUESTION_CUSTOM_ID).length + (customText.trim().length > 0 ? 1 : 0);
|
|
13592
|
-
if (activeQuestion?.kind === "single") return total === 1;
|
|
13593
|
-
const min = activeQuestion?.minSelections ?? 1;
|
|
13594
|
-
const max = activeQuestion?.maxSelections;
|
|
13595
|
-
if (total < min) return false;
|
|
13596
|
-
if (typeof max === "number" && total > max) return false;
|
|
13597
|
-
return total > 0;
|
|
13598
|
-
}, [
|
|
13599
|
-
activeQuestion?.kind,
|
|
13600
|
-
activeQuestion?.minSelections,
|
|
13601
|
-
activeQuestion?.maxSelections,
|
|
13602
|
-
selectedIds,
|
|
13603
|
-
customText,
|
|
13604
|
-
textValue
|
|
13605
|
-
]);
|
|
13606
|
-
const toggleMulti = (id) => {
|
|
13607
|
-
setSelectedIds((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]);
|
|
13608
|
-
};
|
|
13609
|
-
const handleSingleSelect = (id) => {
|
|
13610
|
-
setSelectedIds([id]);
|
|
13611
|
-
};
|
|
13612
|
-
const handleCustomTextChange = (nextValue) => {
|
|
13613
|
-
setCustomText(nextValue);
|
|
13614
|
-
if (!activeQuestion) return;
|
|
13615
|
-
if (activeQuestion.kind === "single") {
|
|
13616
|
-
setSelectedIds(nextValue.trim().length > 0 ? [QUESTION_CUSTOM_ID] : []);
|
|
13617
|
-
return;
|
|
13618
|
-
}
|
|
13619
|
-
setSelectedIds((prev) => {
|
|
13620
|
-
const hasCustom = prev.includes(QUESTION_CUSTOM_ID);
|
|
13621
|
-
if (nextValue.trim().length > 0 && !hasCustom) return [...prev, QUESTION_CUSTOM_ID];
|
|
13622
|
-
if (nextValue.trim().length === 0 && hasCustom) return prev.filter((id) => id !== QUESTION_CUSTOM_ID);
|
|
13623
|
-
return prev;
|
|
13624
|
-
});
|
|
13625
|
-
};
|
|
13626
|
-
const handleSubmit = () => {
|
|
13627
|
-
if (!canSubmit || !activeQuestion) return;
|
|
13628
|
-
if (activeQuestion.kind === "text") {
|
|
13629
|
-
onSubmit({
|
|
13630
|
-
kind: "text",
|
|
13631
|
-
questionId: activeQuestion.id,
|
|
13632
|
-
text: textValue.trim()
|
|
13633
|
-
});
|
|
13634
|
-
return;
|
|
13635
|
-
}
|
|
13636
|
-
const selectedNonCustom = selectedIds.filter((id) => id !== QUESTION_CUSTOM_ID);
|
|
13637
|
-
const answerText = customText.trim() || void 0;
|
|
13638
|
-
onSubmit({
|
|
13639
|
-
kind: activeQuestion.kind,
|
|
13640
|
-
questionId: activeQuestion.id,
|
|
13641
|
-
selectedIds: selectedNonCustom,
|
|
13642
|
-
text: answerText || void 0
|
|
13643
|
-
});
|
|
13644
|
-
};
|
|
13645
|
-
const handleSkip = () => {
|
|
13646
|
-
onSkip?.();
|
|
13647
|
-
onSubmit({ kind: "skip" });
|
|
13648
|
-
};
|
|
13649
|
-
if (!activeQuestion) return null;
|
|
13650
|
-
return /* @__PURE__ */ jsxs3("div", {
|
|
13651
|
-
className: cn("flex flex-col gap-2 bg-background px-3 py-2", className),
|
|
13652
|
-
children: [
|
|
13653
|
-
/* @__PURE__ */ jsx7("div", {
|
|
13654
|
-
className: "flex items-center justify-between gap-px",
|
|
13655
|
-
"data-total-questions": resolvedTotal,
|
|
13656
|
-
children: /* @__PURE__ */ jsxs3("div", {
|
|
13657
|
-
className: "flex items-center gap-2 text-sm text-foreground",
|
|
13658
|
-
children: [/* @__PURE__ */ jsx7("span", {
|
|
13659
|
-
className: "inline-flex h-5 min-w-5 items-center justify-center rounded px-1 text-sm font-medium text-muted-foreground",
|
|
13660
|
-
children: clampedIndex
|
|
13661
|
-
}), /* @__PURE__ */ jsx7("span", { children: activeQuestion.title })]
|
|
13662
|
-
})
|
|
13663
|
-
}),
|
|
13664
|
-
activeQuestion.kind !== "text" && (activeQuestion.options?.length ?? 0) > 0 && /* @__PURE__ */ jsxs3("div", {
|
|
13665
|
-
className: "flex flex-col gap-px",
|
|
13666
|
-
children: [activeQuestion.options.map((option, idx) => {
|
|
13667
|
-
const optionId = option.id ?? option.value ?? option.label;
|
|
13668
|
-
const checked = selectedIdSet.has(optionId);
|
|
13669
|
-
return /* @__PURE__ */ jsxs3("button", {
|
|
13670
|
-
type: "button",
|
|
13671
|
-
onClick: () => {
|
|
13672
|
-
if (activeQuestion.kind === "single") {
|
|
13673
|
-
handleSingleSelect(optionId);
|
|
13674
|
-
if (customEnabled) setCustomText("");
|
|
13675
|
-
} else toggleMulti(optionId);
|
|
13676
|
-
},
|
|
13677
|
-
className: "-mx-2 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-secondary",
|
|
13678
|
-
children: [/* @__PURE__ */ jsx7("span", {
|
|
13679
|
-
className: cn("inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium", checked ? "border-primary bg-primary text-primary-foreground" : "border-border bg-transparent text-muted-foreground"),
|
|
13680
|
-
children: optionBadge(idx)
|
|
13681
|
-
}), /* @__PURE__ */ jsxs3("span", {
|
|
13682
|
-
className: "text-sm text-foreground",
|
|
13683
|
-
children: [option.label, option.description && /* @__PURE__ */ jsxs3("span", {
|
|
13684
|
-
className: "text-muted-foreground",
|
|
13685
|
-
children: [" ", option.description]
|
|
13686
|
-
})]
|
|
13687
|
-
})]
|
|
13688
|
-
}, optionId);
|
|
13689
|
-
}), customEnabled && /* @__PURE__ */ jsxs3("div", {
|
|
13690
|
-
className: "flex items-center gap-2 pt-1",
|
|
13691
|
-
children: [/* @__PURE__ */ jsx7("span", {
|
|
13692
|
-
className: cn("inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium", selectedIds.includes(QUESTION_CUSTOM_ID) ? "border-primary bg-primary text-primary-foreground" : "border-border bg-transparent text-muted-foreground"),
|
|
13693
|
-
children: optionBadge(activeQuestion.options.length)
|
|
13694
|
-
}), /* @__PURE__ */ jsx7("input", {
|
|
13695
|
-
value: customText,
|
|
13696
|
-
onChange: (event) => handleCustomTextChange(event.target.value),
|
|
13697
|
-
placeholder: activeQuestion.customPlaceholder ?? "Type your answer",
|
|
13698
|
-
className: "h-7 w-full rounded-md border border-border bg-background px-2 text-base text-foreground md:text-sm"
|
|
13699
|
-
})]
|
|
13700
|
-
})]
|
|
13701
|
-
}),
|
|
13702
|
-
activeQuestion.kind === "text" && /* @__PURE__ */ jsx7("textarea", {
|
|
13703
|
-
value: textValue,
|
|
13704
|
-
onChange: (event) => setTextValue(event.target.value),
|
|
13705
|
-
placeholder: activeQuestion.placeholder ?? "Type your answer",
|
|
13706
|
-
rows: 3,
|
|
13707
|
-
className: "w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 text-base text-foreground md:text-sm"
|
|
13708
|
-
}),
|
|
13709
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
13710
|
-
className: cn("flex items-center gap-1.5", showNav ? "justify-between" : "justify-end"),
|
|
13711
|
-
children: [showNav && /* @__PURE__ */ jsxs3("div", {
|
|
13712
|
-
className: "flex items-center gap-1.5",
|
|
13713
|
-
children: [onPreviousQuestion && /* @__PURE__ */ jsx7("button", {
|
|
13714
|
-
type: "button",
|
|
13715
|
-
onClick: onPreviousQuestion,
|
|
13716
|
-
disabled: !canGoPrev,
|
|
13717
|
-
className: "h-6 rounded px-2 text-sm text-muted-foreground hover:text-foreground disabled:opacity-60",
|
|
13718
|
-
children: "Previous"
|
|
13719
|
-
}), onNextQuestion && /* @__PURE__ */ jsx7("button", {
|
|
13720
|
-
type: "button",
|
|
13721
|
-
onClick: onNextQuestion,
|
|
13722
|
-
disabled: !canGoNext,
|
|
13723
|
-
className: "h-6 rounded px-2 text-sm text-muted-foreground hover:text-foreground disabled:opacity-60",
|
|
13724
|
-
children: "Next"
|
|
13725
|
-
})]
|
|
13726
|
-
}), /* @__PURE__ */ jsxs3("div", {
|
|
13727
|
-
className: "flex items-center justify-end gap-1.5",
|
|
13728
|
-
children: [allowSkip && /* @__PURE__ */ jsx7("button", {
|
|
13729
|
-
type: "button",
|
|
13730
|
-
onClick: handleSkip,
|
|
13731
|
-
className: "h-6 rounded px-2 text-sm text-muted-foreground transition-[background-color,color,transform] duration-150 hover:bg-muted/50 hover:text-foreground enabled:active:scale-[0.96]",
|
|
13732
|
-
children: skipLabel
|
|
13733
|
-
}), /* @__PURE__ */ jsx7("button", {
|
|
13734
|
-
type: "button",
|
|
13735
|
-
onClick: handleSubmit,
|
|
13736
|
-
disabled: !canSubmit,
|
|
13737
|
-
className: "h-6 rounded bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-[background-color,transform] duration-150 hover:bg-primary/90 enabled:active:scale-[0.96] disabled:opacity-60 disabled:hover:bg-primary",
|
|
13738
|
-
children: primaryLabel
|
|
13739
|
-
})]
|
|
13740
|
-
})]
|
|
13741
|
-
})
|
|
13742
|
-
]
|
|
13743
|
-
});
|
|
13744
|
-
}
|
|
13745
|
-
function formatAnswer(answer) {
|
|
13746
|
-
if (answer.kind === "skip") return "Skipped";
|
|
13747
|
-
if (answer.kind === "text") return answer.text || "Answered";
|
|
13748
|
-
const ids = answer.selectedIds?.length ? answer.selectedIds.join(", ") : "";
|
|
13749
|
-
if (answer.text) return ids ? `${ids} (${answer.text})` : answer.text;
|
|
13750
|
-
return ids || "Answered";
|
|
13751
|
-
}
|
|
13752
|
-
function QuestionTool({ part }) {
|
|
13753
|
-
const [localIndex, setLocalIndex] = useState4(part.input?.questionIndex ?? 1);
|
|
13754
|
-
const questions = part.input?.questions ?? [];
|
|
13755
|
-
const totalQuestions = part.input?.totalQuestions ?? questions.length;
|
|
13756
|
-
const isControlled = typeof part.input?.questionIndex === "number";
|
|
13757
|
-
const questionIndex = isControlled ? part.input?.questionIndex ?? 1 : questions.length > 0 ? localIndex : part.input?.questionIndex ?? 1;
|
|
13758
|
-
const clampedIndex = Math.max(1, Math.min(questionIndex, totalQuestions));
|
|
13759
|
-
const question = questions[clampedIndex - 1];
|
|
13760
|
-
const [localAnswers, setLocalAnswers] = useState4({});
|
|
13761
|
-
const [prevQuestionIndex, setPrevQuestionIndex] = useState4(part.input?.questionIndex);
|
|
13762
|
-
if (part.input?.questionIndex !== prevQuestionIndex) {
|
|
13763
|
-
setPrevQuestionIndex(part.input?.questionIndex);
|
|
13764
|
-
if (typeof part.input?.questionIndex === "number") setLocalIndex(part.input.questionIndex);
|
|
13765
|
-
}
|
|
13766
|
-
const [prevToolCallId, setPrevToolCallId] = useState4(part.toolCallId);
|
|
13767
|
-
if (part.toolCallId !== prevToolCallId) {
|
|
13768
|
-
setPrevToolCallId(part.toolCallId);
|
|
13769
|
-
setLocalAnswers({});
|
|
13770
|
-
setLocalIndex(part.input?.questionIndex ?? 1);
|
|
13771
|
-
}
|
|
13772
|
-
const outputAnswer = part.output?.answer;
|
|
13773
|
-
const answeredCount = Object.keys(localAnswers).length;
|
|
13774
|
-
const isComplete = totalQuestions === 1 ? !!outputAnswer || answeredCount >= 1 : totalQuestions > 0 && answeredCount >= totalQuestions;
|
|
13775
|
-
const showNavigation = totalQuestions > 1 && !isComplete;
|
|
13776
|
-
const canGoPrev = clampedIndex > 1;
|
|
13777
|
-
const canGoNext = clampedIndex < totalQuestions;
|
|
13778
|
-
const summaryAnswers = useMemo2(() => {
|
|
13779
|
-
if (!isComplete || totalQuestions <= 1) return [];
|
|
13780
|
-
return Array.from({ length: totalQuestions }, (_, idx) => ({
|
|
13781
|
-
index: idx + 1,
|
|
13782
|
-
answer: localAnswers[idx + 1]
|
|
13783
|
-
}));
|
|
13784
|
-
}, [
|
|
13785
|
-
isComplete,
|
|
13786
|
-
localAnswers,
|
|
13787
|
-
totalQuestions
|
|
13788
|
-
]);
|
|
13789
|
-
const summaryText = useMemo2(() => {
|
|
13790
|
-
if (!isComplete) return "";
|
|
13791
|
-
if (summaryAnswers.length > 0) return summaryAnswers.map((item) => `${item.index}: ${item.answer ? formatAnswer(item.answer) : "Pending"}`).join(" \u2022 ");
|
|
13792
|
-
if (outputAnswer) return formatAnswer(outputAnswer);
|
|
13793
|
-
if (localAnswers[clampedIndex]) return formatAnswer(localAnswers[clampedIndex]);
|
|
13794
|
-
return "Pending";
|
|
13795
|
-
}, [
|
|
13796
|
-
isComplete,
|
|
13797
|
-
summaryAnswers,
|
|
13798
|
-
outputAnswer,
|
|
13799
|
-
localAnswers,
|
|
13800
|
-
clampedIndex
|
|
13801
|
-
]);
|
|
13802
|
-
if (!question) return null;
|
|
13803
|
-
const goPrev = () => {
|
|
13804
|
-
if (!canGoPrev) return;
|
|
13805
|
-
part.input?.onPreviousQuestion?.();
|
|
13806
|
-
if (!isControlled) setLocalIndex((prev) => Math.max(1, prev - 1));
|
|
13807
|
-
};
|
|
13808
|
-
const goNext = () => {
|
|
13809
|
-
if (!canGoNext) return;
|
|
13810
|
-
part.input?.onNextQuestion?.();
|
|
13811
|
-
if (!isControlled) setLocalIndex((prev) => Math.min(totalQuestions, prev + 1));
|
|
13812
|
-
};
|
|
13813
|
-
return /* @__PURE__ */ jsxs3("div", {
|
|
13814
|
-
className: "overflow-hidden rounded-chat-tool border border-border bg-muted",
|
|
13815
|
-
children: [/* @__PURE__ */ jsxs3("div", {
|
|
13816
|
-
className: "flex h-7 items-center justify-between border-b border-border px-3 text-xs text-muted-foreground",
|
|
13817
|
-
children: [/* @__PURE__ */ jsxs3("div", {
|
|
13818
|
-
className: "inline-flex items-center gap-1.5",
|
|
13819
|
-
children: [/* @__PURE__ */ jsx7(MessageCircleQuestionMark, { className: "size-3.5" }), "Question"]
|
|
13820
|
-
}), showNavigation && /* @__PURE__ */ jsxs3("div", {
|
|
13821
|
-
className: "inline-flex items-center gap-1",
|
|
13822
|
-
children: [
|
|
13823
|
-
/* @__PURE__ */ jsx7("button", {
|
|
13824
|
-
type: "button",
|
|
13825
|
-
onClick: goPrev,
|
|
13826
|
-
disabled: !canGoPrev,
|
|
13827
|
-
className: "inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-secondary disabled:opacity-40",
|
|
13828
|
-
"aria-label": "Previous question",
|
|
13829
|
-
children: /* @__PURE__ */ jsx7(ChevronUp, { className: "size-3.5" })
|
|
13830
|
-
}),
|
|
13831
|
-
/* @__PURE__ */ jsxs3("span", { children: [
|
|
13832
|
-
clampedIndex,
|
|
13833
|
-
" of ",
|
|
13834
|
-
totalQuestions
|
|
13835
|
-
] }),
|
|
13836
|
-
/* @__PURE__ */ jsx7("button", {
|
|
13837
|
-
type: "button",
|
|
13838
|
-
onClick: goNext,
|
|
13839
|
-
disabled: !canGoNext,
|
|
13840
|
-
className: "inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-secondary disabled:opacity-40",
|
|
13841
|
-
"aria-label": "Next question",
|
|
13842
|
-
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
13843
|
-
})
|
|
13844
|
-
]
|
|
13845
|
-
})]
|
|
13846
|
-
}), isComplete ? /* @__PURE__ */ jsx7("div", {
|
|
13847
|
-
className: "bg-background px-3 py-2 text-xs text-muted-foreground",
|
|
13848
|
-
children: summaryText
|
|
13849
|
-
}) : /* @__PURE__ */ jsx7(QuestionPrompt, {
|
|
13850
|
-
questions,
|
|
13851
|
-
questionIndex: clampedIndex,
|
|
13852
|
-
totalQuestions,
|
|
13853
|
-
initialAnswer: localAnswers[clampedIndex],
|
|
13854
|
-
submitLabel: part.input?.submitLabel,
|
|
13855
|
-
nextLabel: part.input?.nextLabel,
|
|
13856
|
-
skipLabel: part.input?.skipLabel,
|
|
13857
|
-
allowSkip: part.input?.allowSkip,
|
|
13858
|
-
onSubmit: (nextAnswer) => {
|
|
13859
|
-
setLocalAnswers((prev) => ({
|
|
13860
|
-
...prev,
|
|
13861
|
-
[clampedIndex]: nextAnswer
|
|
13862
|
-
}));
|
|
13863
|
-
part.input?.onSubmitAnswer?.(nextAnswer);
|
|
13864
|
-
if (clampedIndex < totalQuestions) goNext();
|
|
13865
|
-
}
|
|
13866
|
-
}, `${clampedIndex}-${question.title}`)]
|
|
13287
|
+
] })]
|
|
13867
13288
|
});
|
|
13868
13289
|
}
|
|
13869
13290
|
function extractCommandSummary(cmd) {
|
|
@@ -14141,8 +13562,8 @@ function EditToolDiffCard({ step, state, onComplete, input, output, isCollapsibl
|
|
|
14141
13562
|
}
|
|
14142
13563
|
var EditTool = memo(function EditTool2({ part, isCollapsible = false, onFilePathClick }) {
|
|
14143
13564
|
const approval = part.input?.approval ?? part.args?.approval;
|
|
14144
|
-
const
|
|
14145
|
-
const { step, stepState } = adaptToolPart(part,
|
|
13565
|
+
const toolName = part.type?.replace("tool-", "") || "Edit";
|
|
13566
|
+
const { step, stepState } = adaptToolPart(part, toolName);
|
|
14146
13567
|
const noop = () => {
|
|
14147
13568
|
};
|
|
14148
13569
|
return /* @__PURE__ */ jsx7(EditToolDiffCard, {
|
|
@@ -14651,8 +14072,8 @@ function normalizeResults(value) {
|
|
|
14651
14072
|
return parsed.length > 0 ? parsed : void 0;
|
|
14652
14073
|
}
|
|
14653
14074
|
var SearchTool = memo(function SearchTool2({ part, results, defaultOpen }) {
|
|
14654
|
-
const
|
|
14655
|
-
const { step, stepState } = adaptToolPart(part,
|
|
14075
|
+
const toolName = part.type?.replace("tool-", "") || "WebSearch";
|
|
14076
|
+
const { step, stepState } = adaptToolPart(part, toolName);
|
|
14656
14077
|
const stepStates = { [step.id]: stepState };
|
|
14657
14078
|
const noop = () => {
|
|
14658
14079
|
};
|
|
@@ -15023,11 +14444,11 @@ function parseMcpToolType(partType) {
|
|
|
15023
14444
|
const separatorIndex = withoutPrefix.indexOf("__");
|
|
15024
14445
|
if (separatorIndex === -1) return null;
|
|
15025
14446
|
const serverName = withoutPrefix.slice(0, separatorIndex);
|
|
15026
|
-
const
|
|
14447
|
+
const toolName = withoutPrefix.slice(separatorIndex + 2);
|
|
15027
14448
|
return {
|
|
15028
14449
|
serverName,
|
|
15029
|
-
toolName
|
|
15030
|
-
displayName:
|
|
14450
|
+
toolName,
|
|
14451
|
+
displayName: toolName.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim(),
|
|
15031
14452
|
category: "other"
|
|
15032
14453
|
};
|
|
15033
14454
|
}
|
|
@@ -15167,57 +14588,82 @@ var ToolGroup = memo(function ToolGroup2({ part, nestedTools = EMPTY_NESTED_TOOL
|
|
|
15167
14588
|
const subtitle = (() => {
|
|
15168
14589
|
if (isPending && hasNestedTools) return streamCounts;
|
|
15169
14590
|
if (!isPending && hasNestedTools) {
|
|
15170
|
-
const
|
|
15171
|
-
if (
|
|
14591
|
+
const summary2 = summarizeNestedTools(nestedTools);
|
|
14592
|
+
if (summary2) return summary2;
|
|
15172
14593
|
}
|
|
15173
14594
|
if (!description) return "";
|
|
15174
14595
|
return description.length > 60 ? `${description.slice(0, 57)}\u2026` : description;
|
|
15175
14596
|
})();
|
|
15176
14597
|
const elapsedTimeDisplay = formatElapsedTime(!isPending && outputDuration ? outputDuration : elapsedMs);
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
14598
|
+
const TaskIcon = toolActionIconForName(part.type === "tool-Agent" ? "agent" : "task");
|
|
14599
|
+
const statusText = isPending ? "running" : isInterrupted ? "interrupted" : "done";
|
|
14600
|
+
const summary = isPending && shimmerLabel ? shimmerLabel : completeLabel;
|
|
14601
|
+
const summaryLine = /* @__PURE__ */ jsxs3(TraceLine, {
|
|
14602
|
+
status: isPending ? "running" : void 0,
|
|
14603
|
+
children: [
|
|
14604
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(TaskIcon, {}) }),
|
|
14605
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: isPending && shimmerLabel ? /* @__PURE__ */ jsx7(ToolTextShimmer, {
|
|
14606
|
+
as: "span",
|
|
14607
|
+
duration: 1.2,
|
|
14608
|
+
className: "m-0 inline-flex h-4 items-center leading-none",
|
|
14609
|
+
children: summary
|
|
14610
|
+
}) : summary }),
|
|
14611
|
+
subtitle ? /* @__PURE__ */ jsx7(TraceDescription, {
|
|
14612
|
+
className: "max-w-56 truncate",
|
|
14613
|
+
children: subtitle
|
|
14614
|
+
}) : null,
|
|
14615
|
+
/* @__PURE__ */ jsx7(TraceDescription, { children: statusText }),
|
|
14616
|
+
showElapsed && elapsedTimeDisplay ? /* @__PURE__ */ jsx7(TraceDescription, { children: elapsedTimeDisplay }) : null
|
|
14617
|
+
]
|
|
15180
14618
|
});
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
14619
|
+
const childTrace = /* @__PURE__ */ jsx7(Trace, {
|
|
14620
|
+
className: "gap-1",
|
|
14621
|
+
children: (isPending ? nestedTools.slice(0, Math.max(visibleCount, 0)) : nestedTools).map((nestedPart, idx) => {
|
|
14622
|
+
const derivedPart = isPending ? {
|
|
14623
|
+
...nestedPart,
|
|
14624
|
+
state: idx === visibleCount - 1 ? "input-streaming" : "output-available"
|
|
14625
|
+
} : nestedPart;
|
|
14626
|
+
const nestedMeta = toolRegistry[derivedPart.type];
|
|
14627
|
+
if (!nestedMeta) return null;
|
|
14628
|
+
const { isPending: nestedIsPending, isError: nestedIsError } = getToolStatus(derivedPart, chatStatus);
|
|
14629
|
+
const NestedIcon = nestedMeta.icon;
|
|
14630
|
+
return /* @__PURE__ */ jsxs3(TraceLine, {
|
|
14631
|
+
status: nestedIsPending ? "running" : nestedIsError ? "error" : void 0,
|
|
14632
|
+
children: [
|
|
14633
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(NestedIcon, {}) }),
|
|
14634
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: nestedMeta.title(derivedPart) }),
|
|
14635
|
+
nestedMeta.subtitle?.(derivedPart) ? /* @__PURE__ */ jsx7(TraceDescription, {
|
|
14636
|
+
className: "max-w-56 truncate",
|
|
14637
|
+
children: nestedMeta.subtitle(derivedPart)
|
|
14638
|
+
}) : null
|
|
14639
|
+
]
|
|
14640
|
+
}, derivedPart.toolCallId ?? derivedPart.id ?? `${derivedPart.type}-${nestedMeta.title(derivedPart)}`);
|
|
14641
|
+
})
|
|
14642
|
+
});
|
|
14643
|
+
if (isInterrupted && !part.output) return /* @__PURE__ */ jsx7(Trace, { children: /* @__PURE__ */ jsxs3(TraceLine, { children: [
|
|
14644
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(TaskIcon, {}) }),
|
|
14645
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: interruptedLabel }),
|
|
14646
|
+
/* @__PURE__ */ jsx7(TraceDescription, { children: "interrupted" })
|
|
14647
|
+
] }) });
|
|
14648
|
+
return /* @__PURE__ */ jsx7(Trace, { children: hasNestedTools ? /* @__PURE__ */ jsxs3(TraceCollapsible, {
|
|
14649
|
+
open: expanded,
|
|
14650
|
+
onOpenChange: (next) => {
|
|
15189
14651
|
userToggledRef.current = true;
|
|
15190
|
-
setExpanded(
|
|
14652
|
+
setExpanded(next);
|
|
15191
14653
|
},
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
children:
|
|
15195
|
-
}) :
|
|
15196
|
-
children: /* @__PURE__ */ jsxs3("div", {
|
|
14654
|
+
children: [/* @__PURE__ */ jsx7(TraceCollapsibleTrigger, {
|
|
14655
|
+
"aria-label": `${summary}: ${subtitle || nestedTools.length} ${statusText}`,
|
|
14656
|
+
children: summaryLine
|
|
14657
|
+
}), /* @__PURE__ */ jsx7(TraceCollapsibleContent, { children: /* @__PURE__ */ jsxs3("div", {
|
|
15197
14658
|
className: "relative",
|
|
15198
14659
|
children: [isPending && expanded && visibleToolCount > maskThreshold && /* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-10 bg-linear-to-b from-background to-transparent" }), /* @__PURE__ */ jsx7("div", {
|
|
15199
14660
|
ref: listRef,
|
|
15200
|
-
className: cn(
|
|
14661
|
+
className: cn(isPending && expanded && visibleToolCount > maskThreshold && "overflow-y-auto"),
|
|
15201
14662
|
style: isPending && expanded && visibleToolCount > maskThreshold ? { height: `${streamHeight}px` } : void 0,
|
|
15202
|
-
children:
|
|
15203
|
-
const derivedPart = isPending ? {
|
|
15204
|
-
...nestedPart,
|
|
15205
|
-
state: idx === visibleCount - 1 ? "input-streaming" : "output-available"
|
|
15206
|
-
} : nestedPart;
|
|
15207
|
-
const nestedMeta = toolRegistry[derivedPart.type];
|
|
15208
|
-
if (!nestedMeta) return null;
|
|
15209
|
-
const { isPending: nestedIsPending, isError: nestedIsError } = getToolStatus(derivedPart, chatStatus);
|
|
15210
|
-
return /* @__PURE__ */ jsx7(GenericTool, {
|
|
15211
|
-
icon: nestedMeta.icon,
|
|
15212
|
-
title: nestedMeta.title(derivedPart),
|
|
15213
|
-
subtitle: nestedMeta.subtitle?.(derivedPart),
|
|
15214
|
-
isPending: nestedIsPending,
|
|
15215
|
-
isError: nestedIsError
|
|
15216
|
-
}, derivedPart.toolCallId ?? derivedPart.id ?? `${derivedPart.type}-${nestedMeta.title(derivedPart)}`);
|
|
15217
|
-
})
|
|
14663
|
+
children: childTrace
|
|
15218
14664
|
})]
|
|
15219
|
-
})
|
|
15220
|
-
});
|
|
14665
|
+
}) })]
|
|
14666
|
+
}) : summaryLine });
|
|
15221
14667
|
});
|
|
15222
14668
|
function deriveToolStatus(part, chatStatus) {
|
|
15223
14669
|
if (part.state === "input-streaming") return "streaming";
|
|
@@ -15250,11 +14696,6 @@ var ToolRenderer = memo(function ToolRenderer2({ part, nestedTools, chatStatus,
|
|
|
15250
14696
|
part,
|
|
15251
14697
|
chatStatus
|
|
15252
14698
|
});
|
|
15253
|
-
case "tool-Question":
|
|
15254
|
-
return /* @__PURE__ */ jsx7(QuestionTool, {
|
|
15255
|
-
part,
|
|
15256
|
-
chatStatus
|
|
15257
|
-
});
|
|
15258
14699
|
case "tool-Task":
|
|
15259
14700
|
case "tool-Agent": {
|
|
15260
14701
|
const labelBase = part.type === "tool-Agent" ? "Agent" : "Task";
|
|
@@ -15289,10 +14730,10 @@ var ToolRenderer = memo(function ToolRenderer2({ part, nestedTools, chatStatus,
|
|
|
15289
14730
|
});
|
|
15290
14731
|
}
|
|
15291
14732
|
if (toolRenderers && partType.startsWith("tool-")) {
|
|
15292
|
-
const
|
|
15293
|
-
const CustomRenderer = toolRenderers[
|
|
14733
|
+
const toolName2 = partType.slice(5);
|
|
14734
|
+
const CustomRenderer = toolRenderers[toolName2];
|
|
15294
14735
|
if (CustomRenderer) return /* @__PURE__ */ jsx7(CustomRenderer, {
|
|
15295
|
-
name:
|
|
14736
|
+
name: toolName2,
|
|
15296
14737
|
input: part.input ?? {},
|
|
15297
14738
|
output: part.output ?? part.result,
|
|
15298
14739
|
status: deriveToolStatus(part, chatStatus)
|
|
@@ -15308,10 +14749,10 @@ var ToolRenderer = memo(function ToolRenderer2({ part, nestedTools, chatStatus,
|
|
|
15308
14749
|
isError: isError2
|
|
15309
14750
|
});
|
|
15310
14751
|
}
|
|
15311
|
-
const
|
|
14752
|
+
const toolName = partType.startsWith("tool-") ? partType.slice(5) : partType;
|
|
15312
14753
|
const { isPending, isError } = getToolStatus(part, chatStatus);
|
|
15313
14754
|
return /* @__PURE__ */ jsx7(GenericTool, {
|
|
15314
|
-
title: isPending ? `Running ${
|
|
14755
|
+
title: isPending ? `Running ${toolName}` : toolName,
|
|
15315
14756
|
isPending,
|
|
15316
14757
|
isError
|
|
15317
14758
|
});
|
|
@@ -15358,7 +14799,7 @@ function SourceBlock({ code, language, languageLabel, status }) {
|
|
|
15358
14799
|
wrap: true
|
|
15359
14800
|
});
|
|
15360
14801
|
}
|
|
15361
|
-
var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools, chatStatus, toolRenderers }) {
|
|
14802
|
+
var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools, chatStatus, toolRenderers, insideTrace = false }) {
|
|
15362
14803
|
const partType = part.type;
|
|
15363
14804
|
if (partType === "tool-Thinking" || partType === "tool-FleetReasoning") return null;
|
|
15364
14805
|
const renderFallback = () => /* @__PURE__ */ jsx7(ToolRenderer, {
|
|
@@ -15368,7 +14809,7 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15368
14809
|
toolRenderers
|
|
15369
14810
|
});
|
|
15370
14811
|
if (!partType.startsWith("tool-")) return renderFallback();
|
|
15371
|
-
const normalized = normalizeToolPart(part, chatStatus);
|
|
14812
|
+
const normalized = normalizeToolPart$1(part, chatStatus);
|
|
15372
14813
|
if (!normalized || normalized.lowerName === "question") return renderFallback();
|
|
15373
14814
|
const { detail, status } = normalized;
|
|
15374
14815
|
if (!detail) return renderFallback();
|
|
@@ -15416,16 +14857,8 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15416
14857
|
defaultOpen: status === "running"
|
|
15417
14858
|
});
|
|
15418
14859
|
const content = detail.content || "No output.";
|
|
15419
|
-
|
|
15420
|
-
|
|
15421
|
-
title: normalized.name,
|
|
15422
|
-
status,
|
|
15423
|
-
kind: normalized.lowerName.includes("bash") || normalized.lowerName.includes("shell") || normalized.lowerName.includes("python") ? "terminal" : "custom",
|
|
15424
|
-
meta: normalized.metadata.length > 0 ? normalized.metadata.join(" \xB7 ") : void 0,
|
|
15425
|
-
defaultOpen: status === "running",
|
|
15426
|
-
collapseOnComplete: false,
|
|
15427
|
-
maxHeight: 240,
|
|
15428
|
-
copyText: content,
|
|
14860
|
+
const details = /* @__PURE__ */ jsxs3("div", {
|
|
14861
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
15429
14862
|
children: [
|
|
15430
14863
|
detail.sourceCode ? /* @__PURE__ */ jsx7(SourceBlock, {
|
|
15431
14864
|
code: detail.sourceCode,
|
|
@@ -15436,6 +14869,7 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15436
14869
|
detail.sections.map((section) => /* @__PURE__ */ jsx7(ToolResultOutput, {
|
|
15437
14870
|
language: section.language,
|
|
15438
14871
|
label: section.label,
|
|
14872
|
+
error: section.label === "reported-error",
|
|
15439
14873
|
children: section.content
|
|
15440
14874
|
}, section.label)),
|
|
15441
14875
|
/* @__PURE__ */ jsx7(Approval, {
|
|
@@ -15445,6 +14879,19 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15445
14879
|
})
|
|
15446
14880
|
]
|
|
15447
14881
|
});
|
|
14882
|
+
if (insideTrace) return details;
|
|
14883
|
+
return /* @__PURE__ */ jsx7(ToolResult, {
|
|
14884
|
+
tool: "Prime",
|
|
14885
|
+
title: normalized.name,
|
|
14886
|
+
status,
|
|
14887
|
+
kind: normalized.lowerName.includes("bash") || normalized.lowerName.includes("shell") || normalized.lowerName.includes("python") ? "terminal" : "custom",
|
|
14888
|
+
meta: normalized.metadata.length > 0 ? normalized.metadata.join(" \xB7 ") : void 0,
|
|
14889
|
+
defaultOpen: status === "running",
|
|
14890
|
+
collapseOnComplete: false,
|
|
14891
|
+
maxHeight: 240,
|
|
14892
|
+
copyText: content,
|
|
14893
|
+
children: details
|
|
14894
|
+
});
|
|
15448
14895
|
});
|
|
15449
14896
|
|
|
15450
14897
|
export {
|